From: Abdelrazak Younes Date: Sat, 20 Jan 2007 00:55:24 +0000 (+0000) Subject: Prepare for independent decoration drawing. X-Git-Tag: 1.6.10~11130 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5c4844af4301f51fa01765defe9d4ad256962cb4;p=lyx.git Prepare for independent decoration drawing. * InsetBase::drawDecoration(): new method. * all other files: implement drawDecoration(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16772 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/insetbase.h b/src/insets/insetbase.h index bd3b914e21..540f117e3a 100644 --- a/src/insets/insetbase.h +++ b/src/insets/insetbase.h @@ -114,6 +114,10 @@ public: virtual bool editing(BufferView * bv) const; /// virtual bool showInsetDialog(BufferView *) const { return false; } + + /// draw inset decoration if necessary. + /// This can use \c drawMarkers() for example. + virtual void drawDecoration(PainterInfo &, int, int) const {} /// draw four angular markers void drawMarkers(PainterInfo & pi, int x, int y) const; /// draw two angular markers diff --git a/src/mathed/InsetMathBinom.h b/src/mathed/InsetMathBinom.h index 80ed9473f6..baf2b8d6bf 100644 --- a/src/mathed/InsetMathBinom.h +++ b/src/mathed/InsetMathBinom.h @@ -31,6 +31,9 @@ public: bool metrics(MetricsInfo & mi, Dimension & dim) const; /// void draw(PainterInfo &, int x, int y) const; + /// draw decorations. + void drawDecoration(PainterInfo & pi, int x, int y) const + { drawMarkers2(pi, x, y); } /// bool extraBraces() const; private: diff --git a/src/mathed/InsetMathGrid.h b/src/mathed/InsetMathGrid.h index b08ad54be5..f3485916a1 100644 --- a/src/mathed/InsetMathGrid.h +++ b/src/mathed/InsetMathGrid.h @@ -103,6 +103,9 @@ public: /// void drawWithMargin(PainterInfo & pi, int x, int y, int lmargin = 0, int rmargin = 0) const; + /// draw decorations. + void drawDecoration(PainterInfo & pi, int x, int y) const + { drawMarkers2(pi, x, y); } /// void metricsT(TextMetricsInfo const & mi, Dimension & dim) const; /// diff --git a/src/mathed/InsetMathMacro.h b/src/mathed/InsetMathMacro.h index 8a6a6997c7..478f08066c 100644 --- a/src/mathed/InsetMathMacro.h +++ b/src/mathed/InsetMathMacro.h @@ -33,6 +33,9 @@ public: void drawExpanded(PainterInfo & pi, int x, int y) const; /// draw selection background void drawSelection(PainterInfo & pi, int x, int y) const; + /// draw decorations. + void drawDecoration(PainterInfo & pi, int x, int y) const + { drawMarkers2(pi, x, y); } /// bool metrics(MetricsInfo & mi, Dimension & dim) const; /// get cursor position diff --git a/src/mathed/InsetMathNest.h b/src/mathed/InsetMathNest.h index a01198749a..604b3b41e5 100644 --- a/src/mathed/InsetMathNest.h +++ b/src/mathed/InsetMathNest.h @@ -35,6 +35,9 @@ public: void draw(PainterInfo & pi, int x, int y) const; /// draw selection background void drawSelection(PainterInfo & pi, int x, int y) const; + /// draw decorations. + void drawDecoration(PainterInfo & pi, int x, int y) const + { drawMarkers(pi, x, y); } /// identifies NestInsets InsetMathNest * asNestInset() { return this; } /// identifies NestInsets