diff options
author | Armin Weiss <aw@openoffice.org> | 2007-09-20 08:51:46 +0000 |
---|---|---|
committer | Armin Weiss <aw@openoffice.org> | 2007-09-20 08:51:46 +0000 |
commit | e7ca5458fe9b87768206d1a653b5d0ff60acbf95 (patch) | |
tree | 54aacd5404deda18ed882d3efce3a34093557a9c /drawinglayer/inc | |
parent | d100845363f2d71b8b9d0d7375ad4a1fbec2be80 (diff) |
#i39532# Waveline usage, tuning text primitive
Diffstat (limited to 'drawinglayer/inc')
5 files changed, 166 insertions, 37 deletions
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx index 181d641f4b59..fdd625966bfb 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: drawinglayer_primitivetypes2d.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: aw $ $Date: 2007-08-03 10:43:04 $ + * last change: $Author: aw $ $Date: 2007-09-20 09:51:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -88,6 +88,8 @@ #define PRIMITIVE2D_ID_TEXTHIERARCHYLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 39) #define PRIMITIVE2D_ID_TEXTHIERARCHYPARAGRAPHPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 40) #define PRIMITIVE2D_ID_TEXTHIERARCHYBLOCKPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 41) +#define PRIMITIVE2D_ID_POLYGONWAVEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 42) +#define PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 43) ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx index 64ee7d0a8cdb..ef3ad8117670 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: polygonprimitive2d.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2006-11-07 15:49:05 $ + * last change: $Author: aw $ $Date: 2007-09-20 09:51:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -134,8 +134,8 @@ namespace drawinglayer class PolygonStrokePrimitive2D : public BasePrimitive2D { private: - basegfx::B2DPolygon maPolygon; - attribute::StrokeAttribute maStrokeAttribute; + basegfx::B2DPolygon maPolygon; + attribute::StrokeAttribute maStrokeAttribute; protected: // local decomposition. @@ -163,6 +163,50 @@ namespace drawinglayer } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// +// PolygonStrokePrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class PolygonWavePrimitive2D : public BasePrimitive2D + { + private: + basegfx::B2DPolygon maPolygon; + basegfx::BColor maBColor; + double mfWaveWidth; + double mfWaveHeight; + + protected: + // local decomposition. + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + PolygonWavePrimitive2D( + const basegfx::B2DPolygon& rPolygon, + const basegfx::BColor& rBColor, + double fWaveWidth, + double fWaveHeight); + + // get data + basegfx::B2DPolygon getB2DPolygon() const { return maPolygon; } + const basegfx::BColor& getBColor() const { return maBColor; } + double getWaveWidth() const { return mfWaveWidth; } + double getWaveHeight() const { return mfWaveHeight; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// // PolygonStrokeArrowPrimitive2D class namespace drawinglayer diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx index f5fe74965cee..5a505129e6f9 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: textdecoratedprimitive2d.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2007-08-03 10:43:04 $ + * last change: $Author: aw $ $Date: 2007-09-20 09:51:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -40,6 +40,10 @@ #include <drawinglayer/primitive2d/textprimitive2d.hxx> #endif +#ifndef _COM_SUN_STAR_I18N_XBREAKITERATOR_HPP_ +#include <com/sun/star/i18n/XBreakIterator.hpp> +#endif + ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer @@ -94,29 +98,6 @@ namespace drawinglayer FONT_RELIEF_ENGRAVED }; - class WrongSpellEntry - { - sal_uInt32 mnStart; - sal_uInt32 mnEnd; - - public: - WrongSpellEntry(sal_uInt32 nS, sal_uInt32 nE) - : mnStart(nS), - mnEnd(nE) - {} - - // compare operator - bool operator==(const WrongSpellEntry& rEntry) const - { - return (mnStart == rEntry.mnStart && mnEnd == rEntry.mnEnd); - } - - sal_uInt32 getStart() const { return mnStart; } - sal_uInt32 getEnd() const { return mnEnd; } - }; - - typedef std::vector< WrongSpellEntry > WrongSpellVector; - class TextDecoratedPortionPrimitive2D : public TextSimplePortionPrimitive2D { private: @@ -125,7 +106,6 @@ namespace drawinglayer FontStrikeout meFontStrikeout; FontEmphasisMark meFontEmphasisMark; FontRelief meFontRelief; - WrongSpellVector maWrongSpellVector; // bitfield unsigned mbUnderlineAbove : 1; @@ -134,6 +114,12 @@ namespace drawinglayer unsigned mbEmphasisMarkBelow : 1; unsigned mbShadow : 1; + // break iterator support + // made static so it only needs to be fetched once, even with many single + // constructed VclMetafileProcessor2D. It's still incarnated on demand, + // but exists for OOo runtime now by purpose. + static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > mxBreakIterator; + protected: // local decomposition. virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; @@ -159,8 +145,7 @@ namespace drawinglayer bool bEmphasisMarkAbove = true, bool bEmphasisMarkBelow = false, FontRelief eFontRelief = FONT_RELIEF_NONE, - bool bShadow = false, - const WrongSpellVector& rWrongSpellVector = WrongSpellVector()); + bool bShadow = false); // get data FontUnderline getFontUnderline() const { return meFontUnderline; } @@ -168,7 +153,6 @@ namespace drawinglayer FontEmphasisMark getFontEmphasisMark() const { return meFontEmphasisMark; } FontRelief getFontRelief() const { return meFontRelief; } basegfx::BColor getTextlineColor() const { return maTextlineColor; } - const WrongSpellVector& getWrongSpellVector() const { return maWrongSpellVector; } bool getUnderlineAbove() const { return mbUnderlineAbove; } bool getWordLineMode() const { return mbWordLineMode; } diff --git a/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx new file mode 100644 index 000000000000..91dc7391f36d --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx @@ -0,0 +1,97 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: wrongspellprimitive2d.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: aw $ $Date: 2007-09-20 09:51:21 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WRONGSPELLPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WRONGSPELLPRIMITIVE2D_HXX + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_BASEPRIMITIVE2D_HXX +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#endif + +#ifndef _BGFX_COLOR_BCOLOR_HXX +#include <basegfx/color/bcolor.hxx> +#endif + +#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX +#include <basegfx/matrix/b2dhommatrix.hxx> +#endif + +////////////////////////////////////////////////////////////////////////////// +// WrongSpellPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + class WrongSpellPrimitive2D : public BasePrimitive2D + { + private: + basegfx::B2DHomMatrix maTransformation; + double mfStart; + double mfStop; + basegfx::BColor maColor; + + protected: + // create local decomposition + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + WrongSpellPrimitive2D( + const basegfx::B2DHomMatrix& rTransformation, + double fStart, + double fStop, + const basegfx::BColor& rColor); + + // get data + const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; } + double getStart() const { return mfStart; } + double getStop() const { return mfStop; } + const basegfx::BColor& getColor() const { return maColor; } + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + // provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WRONGSPELLPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx index e1355140e37b..593239caa0bd 100644 --- a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx +++ b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx @@ -4,9 +4,9 @@ * * $RCSfile: vclprocessor2d.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: aw $ $Date: 2007-07-27 09:03:17 $ + * last change: $Author: aw $ $Date: 2007-09-20 09:51:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -70,6 +70,7 @@ namespace drawinglayer { namespace primitive2d { class MarkerArrayPrimitive2D; class PointArrayPrimitive2D; class ModifiedColorPrimitive2D; + class WrongSpellPrimitive2D; }} ////////////////////////////////////////////////////////////////////////////// @@ -106,6 +107,7 @@ namespace drawinglayer void RenderTransformPrimitive2D(const primitive2d::TransformPrimitive2D& rTransformCandidate); void RenderMarkerArrayPrimitive2D(const primitive2d::MarkerArrayPrimitive2D& rMarkerArrayCandidate); void RenderPointArrayPrimitive2D(const primitive2d::PointArrayPrimitive2D& rPointArrayCandidate); + void RenderWrongSpellPrimitive2D(const primitive2d::WrongSpellPrimitive2D& rWrongSpellCandidate); // as tooling, the process() implementation takes over API handling and calls this // virtual render method when the primitive implementation is BasePrimitive2D-based. |