#include "bookpage.hpp" #include "MyGUI_FontManager.h" #include "MyGUI_RenderItem.h" #include "MyGUI_RenderManager.h" #include "MyGUI_TextureUtility.h" #include "MyGUI_FactoryManager.h" #include #include #include #include #include namespace MWGui { struct TypesetBook; struct PageDisplay; struct BookPage; } using namespace MyGUI; using namespace MWGui; static bool ucs_space (int code_point); static bool ucs_line_break (int code_point); static bool ucs_breaking_space (int code_point); struct IBookTypesetter::IStyle { virtual ~IStyle () {} }; struct MWGui::TypesetBook : ITypesetBook { typedef std::vector content; typedef std::list contents; typedef utf8_stream::point utf8_point; typedef std::pair range; struct style : IBookTypesetter::IStyle { IFont* Font; Colour HotColour; Colour ActiveColour; Colour NormalColour; interactive_id InteractiveId; bool match (IFont* tstFont, Colour tstHotColour, Colour tstActiveColour, Colour tstNormalColour, intptr_t tstInteractiveId) { return (Font == tstFont) && partal_match (tstHotColour, tstActiveColour, tstNormalColour, tstInteractiveId); } bool match (char const * tstFont, Colour tstHotColour, Colour tstActiveColour, Colour tstNormalColour, intptr_t tstInteractiveId) { return (Font->getResourceName () == tstFont) && partal_match (tstHotColour, tstActiveColour, tstNormalColour, tstInteractiveId); } bool partal_match (Colour tstHotColour, Colour tstActiveColour, Colour tstNormalColour, intptr_t tstInteractiveId) { return (HotColour == tstHotColour ) && (ActiveColour == tstActiveColour ) && (NormalColour == tstNormalColour ) && (InteractiveId == tstInteractiveId ) ; } }; typedef std::list