]> git.lyx.org Git - lyx.git/blobdiff - src/Row.h
stdmenus.inc: comment out two non-working menu entries
[lyx.git] / src / Row.h
index 7d9a891fd13d2a0c16173375f6d152ed65bdabf3..a3afad4c1164a3f646f36f0753e8615844561194 100644 (file)
--- a/src/Row.h
+++ b/src/Row.h
@@ -17,6 +17,8 @@
 
 #include "support/types.h"
 
+#include "Dimension.h"
+
 
 namespace lyx {
 
@@ -32,59 +34,66 @@ public:
        ///
        Row(pos_type pos);
        ///
-       void pos(pos_type p);
+       bool changed() const { return changed_; }
        ///
-       pos_type pos() const;
+       void setChanged(bool c) { changed_ = c; }
        ///
-       void endpos(pos_type p);
+       void setCrc(size_type crc) const;
+       /// Set the selection begin and end.
+       /**
+         * This is const because we update the selection status only at draw()
+         * time.
+         */
+       void setSelection(pos_type sel_beg, pos_type sel_end) const;
+
        ///
-       pos_type endpos() const;
+       void pos(pos_type p);
        ///
-       int height() const { return ascent_ + descent_; }
+       pos_type pos() const { return pos_; }
        ///
-       void width(int w);
+       void endpos(pos_type p);
        ///
-       int width() const;
+       pos_type endpos() const { return end_; }
        ///
-       void ascent(int b);
+       void setDimension(Dimension const & dim);
        ///
-       int ascent() const;
+       Dimension const & dimension() const { return dim_; }
        ///
-       void descent(int b) { descent_ = b; }
+       int height() const { return dim_.height(); }
        ///
-       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_;
+       int width() const { return dim_.wid; }
        ///
-       int ascent_;
+       int ascent() const { return dim_.asc; }
        ///
-       int descent_;
-       ///
-       int width_;
-};
+       int descent() const { return dim_.des; }
 
+       /// 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
-       double hfill;
        /// width of hfills in the label
        double label_hfill;
        /// the x position of the row
        double x;
+       ///
+       mutable pos_type sel_beg;
+       ///
+       mutable 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