X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FPainterBase.h;h=47fa8c89939a805e7571d2f92711f9c776fe4a1b;hb=ebfcf1c0e72288b7131607af0330500c8739cead;hp=54b3e53f2de4167b387b575e3fce75305b806993;hpb=d6f638ea96150d5a0bb559d520dd2af8baad23d7;p=lyx.git diff --git a/src/PainterBase.h b/src/PainterBase.h index 54b3e53f2d..47fa8c8993 100644 --- a/src/PainterBase.h +++ b/src/PainterBase.h @@ -20,7 +20,6 @@ class WorkArea; class LyXFont; -class LyXScreen; /** A painter class to encapsulate all graphics parameters and operations @@ -36,7 +35,11 @@ class LyXScreen; class PainterBase { protected: /// - static int dummy1, dummy2, dummy3; + static int dummy1; + /// + static int dummy2; + /// + static int dummy3; public: /// enum line_width { @@ -57,18 +60,19 @@ public: }; /// - PainterBase(WorkArea & wa) : owner(wa) {} + explicit PainterBase(WorkArea & wa) : owner(wa) {} /// virtual ~PainterBase() {} - /** Screen geometry */ + /* Screen geometry */ + /// + int paperMargin() const; /// - int paperMargin(); + int paperWidth() const; /// - int paperWidth(); + int paperHeight() const; - /**@Basic drawing routines */ /// Draw a line from point to point virtual PainterBase & line( int x1, int y1, int x2, int y2, @@ -140,38 +144,25 @@ public: /// virtual PainterBase & buttonFrame(int x, int y, int w, int h); - /**@Image stuff */ - /// For the figure inset + // For the figure inset // This can't be part of the base since we don't know what window // system we will be useing, or if are going to use pixmaps at all. //virtual PainterBase & pixmap(int x, int y, Pixmap bitmap)=0; - /**@String functions */ - /// Draw a string at position x, y (y is the baseline) virtual PainterBase & text(int x, int y, - string const &str, LyXFont const & f) = 0; + string const & str, LyXFont const & f) = 0; /** Draw a string at position x, y (y is the baseline) This is just for fast drawing */ - virtual PainterBase & text(int x, int y, char const * str, int l, + virtual PainterBase & text(int x, int y, char const * str, size_t l, LyXFont const & f) = 0; /// Draw a char at position x, y (y is the baseline) virtual PainterBase & text(int x, int y, char c, LyXFont const & f)=0; - /// Get the width of text - int width(string const & s, LyXFont const & f); - - /** Get the width of text - This is just for fast width */ - int width(char const * s, int l, LyXFont const & f); - - /// Get the width of text - int width(char c, LyXFont const & f); - /** Draws a string and encloses it inside a rectangle. Returns the size of the rectangle. If draw is false, we only calculate the size. */ @@ -192,10 +183,8 @@ public: int & width = PainterBase::dummy1, int & ascent = PainterBase::dummy2, int & descent = PainterBase::dummy3); - /// This is preliminary - //BufferView const * getOwner() const { return &owner; } - -private: +protected: + /// WorkArea & owner; };