#ifndef MICROTEX_SPLIT_H #define MICROTEX_SPLIT_H #include #include "box/box.h" #include "box/box_group.h" #include "core/glue.h" namespace microtex { #ifdef HAVE_LOG void printBox(const sptr& box); #endif // HAVE_LOG class BoxSplitter { public: struct Position { int _index; sptr _box; Position(int index, const sptr& box) : _index(index), _box(box) {} }; private: static float canBreak(std::stack& stack, const sptr& hbox, float width); static int getBreakPosition(const sptr& hb, int index); static std::pair> split(const sptr& hb, float width, float lineSpace); public: static std::pair> split(const sptr& box, float width, float lineSpace); }; } // namespace microtex #endif // MICROTEX_SPLIT_H