00001 /* $Id: controller.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */ 00002 /* 00003 Copyright (C) 2009 - 2012 by Ignacio R. Morelle <shadowm2006@gmail.com> 00004 Part of the Battle for Wesnoth Project http://www.wesnoth.org/ 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY. 00012 00013 See the COPYING file for more details. 00014 */ 00015 00016 /** 00017 * @file 00018 * Storyscreen controller (interface). 00019 */ 00020 00021 #ifndef STORYSCREEN_CONTROLLER_HPP_INCLUDED 00022 #define STORYSCREEN_CONTROLLER_HPP_INCLUDED 00023 00024 #include "events.hpp" 00025 #include "interface.hpp" 00026 #include "video.hpp" 00027 00028 #include <boost/shared_ptr.hpp> 00029 00030 class display; 00031 class game_state; 00032 class vconfig; 00033 00034 namespace storyscreen { 00035 00036 enum STORY_RESULT { 00037 NEXT, 00038 BACK, 00039 QUIT 00040 }; 00041 00042 class part; 00043 class part_ui; 00044 class floating_image; 00045 00046 class controller 00047 { 00048 public: 00049 controller(display& disp, const vconfig& data, const std::string& scenario_name, 00050 int segment_index, int total_segments); 00051 00052 /** 00053 * Display all story screen parts in a first..last sequence. 00054 */ 00055 STORY_RESULT show(START_POSITION startpos=START_BEGINNING); 00056 00057 private: 00058 typedef boost::shared_ptr< part > part_pointer_type; 00059 typedef boost::shared_ptr< part_ui > render_pointer_type; 00060 00061 // Executes WML flow instructions and inserts parts. 00062 void resolve_wml(const vconfig& cfg); 00063 00064 display& disp_; 00065 const resize_lock disp_resize_lock_; 00066 const events::event_context evt_context_; 00067 00068 std::string scenario_name_; 00069 int segment_index_; 00070 int total_segments_; 00071 00072 // The part cache. 00073 std::vector< part_pointer_type > parts_; 00074 }; 00075 00076 } // end namespace storyscreen 00077 00078 #endif /* ! STORYSCREEN_CONTROLLER_HPP_INCLUDED */
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:02:53 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |