: type(t), pos(p), endpos(p + 1), font(f), change(ch) {}
: type(t), pos(p), endpos(p + 1), font(f), change(ch) {}
// Return total width of element, including separator overhead
// FIXME: Cache this value or the number of expanders?
double full_width() const { return dim.wid + extra * countExpanders(); }
// Return total width of element, including separator overhead
// FIXME: Cache this value or the number of expanders?
double full_width() const { return dim.wid + extra * countExpanders(); }
*/
pos_type x2pos(int &x) const;
/** Break the element in two if possible, so that its width is less
*/
pos_type x2pos(int &x) const;
/** Break the element in two if possible, so that its width is less
- * than \param w.
- * \return a vector of elements containing the remainder of
- * the text (empty if nothing happened).
- * \param width maximum width of the row.
- * \param next_width available width on next row.
+ * than the required values.
+ * \return true if something has been done ; false if this is
+ * not needed or not possible.
+ * \param width: maximum width of the row.
+ * \param next_width: available width on next rows.
* \param force: if true, cut string at any place, even for
* languages that wrap at word delimiters; if false, do not
* break at all if first element would larger than \c width.
* \param force: if true, cut string at any place, even for
* languages that wrap at word delimiters; if false, do not
* break at all if first element would larger than \c width.
*/
// FIXME: ideally last parameter should be Elements&, but it is not possible.
bool splitAt(int width, int next_width, bool force, std::vector<Element> & tail);
*/
// FIXME: ideally last parameter should be Elements&, but it is not possible.
bool splitAt(int width, int next_width, bool force, std::vector<Element> & tail);
// Set the extra spacing for every expanding character in STRING-type
// elements. \param w is the total amount of extra width for the row to be
// distributed among expanders. \return false if the justification fails.
// Set the extra spacing for every expanding character in STRING-type
// elements. \param w is the total amount of extra width for the row to be
// distributed among expanders. \return false if the justification fails.
Font const & f, Change const & ch);
///
void add(pos_type pos, char_type const c,
Font const & f, Change const & ch);
///
void add(pos_type pos, char_type const c,
///
void addVirtual(pos_type pos, docstring const & s,
Font const & f, Change const & ch);
///
void addSpace(pos_type pos, int width, Font const & f, Change const & ch);
///
void addVirtual(pos_type pos, docstring const & s,
Font const & f, Change const & ch);
///
void addSpace(pos_type pos, int width, Font const & f, Change const & ch);
/// one behind last pos covered by this row
pos_type end_ = 0;
// Is there a boundary at the end of the row (display inset...)
/// one behind last pos covered by this row
pos_type end_ = 0;
// Is there a boundary at the end of the row (display inset...)