X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxrow.h;h=652366abcf4657dfda909758363ef971fb932f74;hb=b3ced091d2eb7b1f2e174973614157b1c26c7001;hp=9da3170342946a616f99e1c04c768c614f563ee9;hpb=e80ad470cbc712632e53f9b2b240ce5d8dc06459;p=lyx.git diff --git a/src/lyxrow.h b/src/lyxrow.h index 9da3170342..652366abcf 100644 --- a/src/lyxrow.h +++ b/src/lyxrow.h @@ -1,82 +1,90 @@ // -*- C++ -*- -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2000 The LyX Team. +/** + * \file lyxrow.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * ====================================================== */ + * \author Matthias Ettrich + * \author Lars Gullik Bjønnes + * + * Full author contact details are available in file CREDITS. + * + * Metrics for an on-screen text row. + */ #ifndef LYXROW_H #define LYXROW_H -#include "lyxparagraph.h" +#include "support/types.h" + -/// +namespace lyx { + +/** + * An on-screen row of text. A paragraph is broken into a + * RowList for display. Each Row contains position pointers + * into the first and last character positions of that row. + */ class Row { public: /// Row(); /// - void par(LyXParagraph * p); - /// - LyXParagraph * par(); - /// - LyXParagraph * par() const; + Row(pos_type pos); /// - void pos(LyXParagraph::size_type p); + void pos(pos_type p); /// - LyXParagraph::size_type pos() const; + pos_type pos() const; /// - void fill(int f); + void endpos(pos_type p); /// - int fill() const; + pos_type endpos() const; /// - void height(unsigned short h); + int height() const { return ascent_ + descent_; } /// - unsigned short height() const; + void width(int w); /// - void width(unsigned int w); + int width() const; /// - unsigned int width() const; + void ascent(int b); /// - void ascent_of_text(unsigned short a); + int ascent() const; /// - unsigned short ascent_of_text() const; + void descent(int b) { descent_ = b; } /// - void baseline(unsigned int b); - /// - unsigned int baseline() const; - /// - void next(Row * r); - /// - Row * next() const; - /// - void previous(Row * r); - /// - Row * previous() const; + int descent() const { return descent_; } + /// current debugging only + void dump(const char * = "") const; + private: + /// first pos covered by this row + pos_type pos_; + /// one behind last pos covered by this row + pos_type end_; /// - LyXParagraph * par_; + int ascent_; /// - LyXParagraph::size_type pos_; - /** what is missing to a full row can be negative. - Needed for hfills, flushright, block etc. */ - mutable int fill_; + int descent_; /// - unsigned short height_; - /// - unsigned int width_; - /// - unsigned short ascent_of_text_; - /// - unsigned int baseline_; - /// - Row * next_; - /// - Row * previous_; + int width_; +}; + + +class RowMetrics { +public: + RowMetrics(); + /// width of a separator (i.e. space) + double separator; + /// width of hfills in the body + double hfill; + /// width of hfills in the label + double label_hfill; + /// the x position of the row + double x; }; + + +} // namespace lyx + #endif