#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* mFont; Colour mHotColour; Colour mActiveColour; Colour mNormalColour; interactive_id mInteractiveId; bool match (IFont* tstFont, Colour tstHotColour, Colour tstActiveColour, Colour tstNormalColour, intptr_t tstInteractiveId) { return (mFont == tstFont) && partal_match (tstHotColour, tstActiveColour, tstNormalColour, tstInteractiveId); } bool match (char const * tstFont, Colour tstHotColour, Colour tstActiveColour, Colour tstNormalColour, intptr_t tstInteractiveId) { return (mFont->getResourceName () == tstFont) && partal_match (tstHotColour, tstActiveColour, tstNormalColour, tstInteractiveId); } bool partal_match (Colour tstHotColour, Colour tstActiveColour, Colour tstNormalColour, intptr_t tstInteractiveId) { return (mHotColour == tstHotColour ) && (mActiveColour == tstActiveColour ) && (mNormalColour == tstNormalColour ) && (mInteractiveId == tstInteractiveId ) ; } }; typedef std::list