]> git.lyx.org Git - lyx.git/blobdiff - src/Row.h
* docstream: factorize out some code and introduce odocfstream::reset()
[lyx.git] / src / Row.h
index e93ea8735d8806a8c8479933bf0b1569e4f45589..cb25a4dcd99f17608fad48271527f2b71c6f427f 100644 (file)
--- a/src/Row.h
+++ b/src/Row.h
@@ -33,46 +33,39 @@ public:
        Row();
        ///
        Row(pos_type pos);
+       ///
+       bool changed() const { return changed_; }
+       ///
+       void setChanged(bool c) { changed_ = c; }
+       ///
+       void setCrc(size_type crc) const;
+       ///
+       void setSelection(pos_type sel_beg, pos_type sel_end);
+
        ///
        void pos(pos_type p);
        ///
-       pos_type pos() const;
+       pos_type pos() const { return pos_; }
        ///
        void endpos(pos_type p);
        ///
-       pos_type endpos() const;
+       pos_type endpos() const { return end_; }
+       ///
+       void setDimension(Dimension const & dim);
        ///
        Dimension const & dimension() const { return dim_; }
        ///
        int height() const { return dim_.height(); }
        ///
-       void width(int w) { dim_.wid = w; }
-       ///
        int width() const { return dim_.wid; }
        ///
-       void ascent(int a) { dim_.asc = a; }
-       ///
        int ascent() const { return dim_.asc; }
        ///
-       void descent(int d) { dim_.des = d; }
-       ///
        int descent() const { return dim_.des; }
-       /// 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_;
-       /// Row dimension.
-       Dimension dim_;
-};
 
+       /// current debugging only
+       void dump(char const * = "") const;
 
-class RowMetrics {
-public:
-       RowMetrics();
        /// width of a separator (i.e. space)
        double separator;
        /// width of hfills in the body
@@ -81,10 +74,24 @@ public:
        double label_hfill;
        /// the x position of the row
        double x;
+       ///
+       pos_type sel_beg;
+       ///
+       pos_type sel_end;
+private:
+       /// has the Row appearance changed since last drawing?
+       mutable bool changed_;
+       /// CRC of row contents.
+       mutable size_type crc_;
+       /// first pos covered by this row
+       pos_type pos_;
+       /// one behind last pos covered by this row
+       pos_type end_;
+       /// Row dimension.
+       Dimension dim_;
 };
 
 
-
 } // namespace lyx
 
 #endif