LibreOffice Module sdext (master)
1
|
Main entry from the parser. More...
#include <pdfiprocessor.hxx>
Public Member Functions | |
PDFIProcessor (const css::uno::Reference< css::task::XStatusIndicator > &xStat, css::uno::Reference< css::uno::XComponentContext > const &xContext) | |
void | emit (XmlEmitter &rEmitter, const TreeVisitorFactory &rVisitorFactory) |
sal_Int32 | getGCId (const GraphicsContext &rGC) |
const GraphicsContext & | getGraphicsContext (sal_Int32 nGCId) const |
GraphicsContext & | getCurrentContext () |
const GraphicsContext & | getCurrentContext () const |
const css::uno::Reference< css::task::XStatusIndicator > & | getStatusIndicator () const |
const FontAttributes & | getFont (sal_Int32 nFontId) const |
sal_Int32 | getFontId (const FontAttributes &rAttr) const |
![]() | |
virtual | ~ContentSink () |
Static Public Member Functions | |
static void | sortElements (Element *pElement) |
static OUString | mirrorString (const OUString &i_rInString) |
Public Attributes | |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
basegfx::B2DHomMatrix | prevTextMatrix |
double | prevCharWidth |
Private Types | |
typedef std::unordered_map< sal_Int32, FontAttributes > | IdToFontMap |
typedef std::unordered_map< FontAttributes, sal_Int32, FontAttrHash > | FontToIdMap |
typedef std::unordered_map< sal_Int32, GraphicsContext > | IdToGCMap |
typedef std::unordered_map< GraphicsContext, sal_Int32, GraphicsContextHash > | GCToIdMap |
typedef std::vector< GraphicsContext > | GraphicsContextStack |
Private Member Functions | |
void | processGlyphLine () |
virtual void | setPageNum (sal_Int32 nNumPages) override |
Total number of pages for upcoming document. More... | |
virtual void | startPage (const css::geometry::RealSize2D &rSize) override |
virtual void | endPage () override |
virtual void | hyperLink (const css::geometry::RealRectangle2D &rBounds, const OUString &rURI) override |
virtual void | pushState () override |
virtual void | popState () override |
virtual void | setFlatness (double) override |
virtual void | setTransformation (const css::geometry::AffineMatrix2D &rMatrix) override |
virtual void | setLineDash (const css::uno::Sequence< double > &dashes, double start) override |
virtual void | setLineJoin (sal_Int8) override |
virtual void | setLineCap (sal_Int8) override |
virtual void | setMiterLimit (double) override |
virtual void | setLineWidth (double) override |
virtual void | setFillColor (const css::rendering::ARGBColor &rColor) override |
virtual void | setStrokeColor (const css::rendering::ARGBColor &rColor) override |
virtual void | setFont (const FontAttributes &rFont) override |
virtual void | setTextRenderMode (sal_Int32) override |
virtual void | strokePath (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override |
virtual void | fillPath (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override |
virtual void | eoFillPath (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override |
virtual void | intersectClip (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override |
virtual void | intersectEoClip (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override |
virtual void | drawGlyphs (const OUString &rGlyphs, const css::geometry::RealRectangle2D &rRect, const css::geometry::Matrix2D &rFontMatrix, double fontSize) override |
virtual void | endText () override |
issued when a sequence of associated glyphs is drawn More... | |
virtual void | drawMask (const css::uno::Sequence< css::beans::PropertyValue > &xBitmap, bool bInvert) override |
draws given bitmap as a mask (using current fill color) More... | |
virtual void | drawImage (const css::uno::Sequence< css::beans::PropertyValue > &xBitmap) override |
Given image must already be color-mapped and normalized to sRGB. More... | |
virtual void | drawColorMaskedImage (const css::uno::Sequence< css::beans::PropertyValue > &xBitmap, const css::uno::Sequence< css::uno::Any > &xMaskColors) override |
Given image must already be color-mapped and normalized to sRGB. More... | |
virtual void | drawMaskedImage (const css::uno::Sequence< css::beans::PropertyValue > &xBitmap, const css::uno::Sequence< css::beans::PropertyValue > &xMask, bool bInvertMask) override |
virtual void | drawAlphaMaskedImage (const css::uno::Sequence< css::beans::PropertyValue > &xImage, const css::uno::Sequence< css::beans::PropertyValue > &xMask) override |
void | startIndicator (const OUString &rText) |
void | endIndicator () |
void | setupImage (ImageId nImage) |
Private Attributes | |
std::vector< CharGlyph > | m_GlyphsList |
std::shared_ptr< DocumentElement > | m_pDocument |
PageElement * | m_pCurPage |
Element * | m_pCurElement |
sal_Int32 | m_nNextFontId |
IdToFontMap | m_aIdToFont |
FontToIdMap | m_aFontToId |
GraphicsContextStack | m_aGCStack |
sal_Int32 | m_nNextGCId |
IdToGCMap | m_aIdToGC |
GCToIdMap | m_aGCToId |
ImageContainer | m_aImages |
sal_Int32 | m_nPages |
sal_Int32 | m_nNextZOrder |
css::uno::Reference< css::task::XStatusIndicator > | m_xStatusIndicator |
Main entry from the parser.
Creates the internal DOM tree from the render calls
Definition at line 55 of file pdfiprocessor.hxx.
|
private |
Definition at line 158 of file pdfiprocessor.hxx.
|
private |
Definition at line 161 of file pdfiprocessor.hxx.
|
private |
Definition at line 163 of file pdfiprocessor.hxx.
|
private |
Definition at line 157 of file pdfiprocessor.hxx.
|
private |
Definition at line 160 of file pdfiprocessor.hxx.
|
explicit |
Definition at line 44 of file pdfiprocessor.cxx.
References pdfi::FontAttributes::familyName, pdfi::FontAttributes::fontWeight, pdfi::FontAttributes::isItalic, m_aFontToId, m_aGCStack, m_aGCToId, m_aIdToFont, m_aIdToGC, PDFI_OUTDEV_RESOLUTION, pdfi::FontAttributes::size, and u.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 377 of file pdfiprocessor.cxx.
|
overrideprivatevirtual |
Given image must already be color-mapped and normalized to sRGB.
maskColors must contain two sequences of color components
Implements pdfi::ContentSink.
Definition at line 362 of file pdfiprocessor.cxx.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 261 of file pdfiprocessor.cxx.
References basegfx::fTools::equalZero(), basegfx::B2DHomMatrix::get(), getCurrentContext(), pdfi::CharGlyph::getGC(), basegfx::B2DHomMatrix::invert(), basegfx::B2DHomMatrix::scale(), pdfi::GraphicsContext::Transformation, and basegfx::B2DHomMatrix::translate().
|
overrideprivatevirtual |
Given image must already be color-mapped and normalized to sRGB.
Implements pdfi::ContentSink.
Definition at line 357 of file pdfiprocessor.cxx.
|
overrideprivatevirtual |
draws given bitmap as a mask (using current fill color)
Implements pdfi::ContentSink.
Definition at line 350 of file pdfiprocessor.cxx.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 369 of file pdfiprocessor.cxx.
void pdfi::PDFIProcessor::emit | ( | XmlEmitter & | rEmitter, |
const TreeVisitorFactory & | rVisitorFactory | ||
) |
Definition at line 535 of file pdfiprocessor.cxx.
References pdfi::XmlEmitter::beginTag(), pdfi::TreeVisitorFactory::createEmittingVisitor(), pdfi::TreeVisitorFactory::createOptimizingVisitor(), pdfi::TreeVisitorFactory::createStyleCollectingVisitor(), pdfi::StyleContainer::emit(), pdfi::XmlEmitter::endTag(), m_xContext, OASIS_STR, and pdfi::EmitContext::rEmitter.
|
private |
Definition at line 622 of file pdfiprocessor.cxx.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 502 of file pdfiprocessor.cxx.
|
overrideprivatevirtual |
issued when a sequence of associated glyphs is drawn
Implements pdfi::ContentSink.
Definition at line 318 of file pdfiprocessor.cxx.
References pdfi::Element::Parent.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 414 of file pdfiprocessor.cxx.
References basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(), getCurrentContext(), pdfi::PATH_EOFILL, basegfx::B2DPolyPolygon::transform(), Transformation, pdfi::PolyPolyElement::updateGeometry(), and pdfi::DrawElement::ZOrder.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 400 of file pdfiprocessor.cxx.
References basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(), getCurrentContext(), pdfi::PATH_FILL, basegfx::B2DPolyPolygon::transform(), Transformation, pdfi::PolyPolyElement::updateGeometry(), and pdfi::DrawElement::ZOrder.
|
inline |
Definition at line 71 of file pdfiprocessor.hxx.
References m_aGCStack.
Referenced by setFillColor(), setFlatness(), setFont(), setLineCap(), setLineDash(), setLineJoin(), setLineWidth(), setStrokeColor(), and setTransformation().
|
inline |
Definition at line 72 of file pdfiprocessor.hxx.
References m_aGCStack.
const FontAttributes & pdfi::PDFIProcessor::getFont | ( | sal_Int32 | nFontId | ) | const |
Definition at line 469 of file pdfiprocessor.cxx.
Referenced by pdfi::ParagraphElement::getLineHeight(), pdfi::ParagraphElement::isSingleLined(), pdfi::PageElement::resolveUnderlines(), pdfi::WriterXmlOptimizer::visit(), pdfi::WriterXmlFinalizer::visit(), and pdfi::DrawXmlFinalizer::visit().
sal_Int32 pdfi::PDFIProcessor::getFontId | ( | const FontAttributes & | rAttr | ) | const |
Definition at line 179 of file pdfiprocessor.cxx.
References getCurrentContext().
Referenced by pdfi::PageElement::resolveUnderlines().
sal_Int32 pdfi::PDFIProcessor::getGCId | ( | const GraphicsContext & | rGC | ) |
Definition at line 477 of file pdfiprocessor.cxx.
Referenced by pdfi::WriterXmlOptimizer::visit(), and pdfi::DrawXmlOptimizer::visit().
const GraphicsContext & pdfi::PDFIProcessor::getGraphicsContext | ( | sal_Int32 | nGCId | ) | const |
Definition at line 494 of file pdfiprocessor.cxx.
Referenced by pdfi::WriterXmlEmitter::fillFrameProps(), pdfi::DrawXmlEmitter::fillFrameProps(), pdfi::WriterXmlOptimizer::optimizeTextElements(), pdfi::DrawXmlOptimizer::optimizeTextElements(), pdfi::PageElement::resolveUnderlines(), pdfi::WriterXmlOptimizer::visit(), pdfi::DrawXmlOptimizer::visit(), pdfi::WriterXmlFinalizer::visit(), and pdfi::DrawXmlFinalizer::visit().
|
inline |
Definition at line 74 of file pdfiprocessor.hxx.
References m_xStatusIndicator.
Referenced by pdfi::WriterXmlOptimizer::visit(), pdfi::DrawXmlOptimizer::visit(), pdfi::WriterXmlFinalizer::visit(), and pdfi::DrawXmlFinalizer::visit().
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 454 of file pdfiprocessor.cxx.
References pdfi::Element::h, pLink, pdfi::Element::w, pdfi::Element::x, and pdfi::Element::y.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 428 of file pdfiprocessor.cxx.
References basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(), basegfx::utils::clipPolyPolygonOnPolyPolygon(), basegfx::B2DPolyPolygon::count(), getCurrentContext(), basegfx::B2DPolyPolygon::transform(), and Transformation.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 441 of file pdfiprocessor.cxx.
References basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(), basegfx::utils::clipPolyPolygonOnPolyPolygon(), basegfx::B2DPolyPolygon::count(), getCurrentContext(), basegfx::B2DPolyPolygon::transform(), and Transformation.
|
static |
Definition at line 699 of file pdfiprocessor.cxx.
References GetMirroredChar(), and i.
Referenced by pdfi::DrawXmlEmitter::visit().
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 84 of file pdfiprocessor.cxx.
References m_aGCStack.
|
private |
Definition at line 190 of file pdfiprocessor.cxx.
References ch, pdfi::GraphicalElement::FontSize, frame, pdfi::Element::h, i, pdfi::GraphicalElement::IsForText, text, pdfi::TextElement::Text, pdfi::Element::updateGeometryWith(), pdfi::Element::w, pdfi::Element::x, pdfi::Element::y, and pdfi::DrawElement::ZOrder.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 78 of file pdfiprocessor.cxx.
References a, and m_aGCStack.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 129 of file pdfiprocessor.cxx.
References pdfi::GraphicsContext::FillColor, and getCurrentContext().
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 89 of file pdfiprocessor.cxx.
References pdfi::GraphicsContext::Flatness, and getCurrentContext().
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 139 of file pdfiprocessor.cxx.
References FillColor, pdfi::GraphicsContext::FontId, pdfi::FontAttributes::fontWeight, getCurrentContext(), pdfi::FontAttributes::isOutline, LineColor, m_aFontToId, m_aIdToFont, m_nNextFontId, pdfi::GraphicsContext::TextRenderMode, and u.
Implements pdfi::ContentSink.
Definition at line 114 of file pdfiprocessor.cxx.
References getCurrentContext(), and pdfi::GraphicsContext::LineCap.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 101 of file pdfiprocessor.cxx.
References pdfi::GraphicsContext::DashArray, getCurrentContext(), and comphelper::sequenceToContainer().
Implements pdfi::ContentSink.
Definition at line 109 of file pdfiprocessor.cxx.
References getCurrentContext(), and pdfi::GraphicsContext::LineJoin.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 124 of file pdfiprocessor.cxx.
References getCurrentContext(), and pdfi::GraphicsContext::LineWidth.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 119 of file pdfiprocessor.cxx.
References SAL_WARN.
|
overrideprivatevirtual |
Total number of pages for upcoming document.
Implements pdfi::ContentSink.
Definition at line 72 of file pdfiprocessor.cxx.
References m_nPages.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 134 of file pdfiprocessor.cxx.
References getCurrentContext(), and pdfi::GraphicsContext::LineColor.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 170 of file pdfiprocessor.cxx.
References pdfi::GraphicsContext::FontId, getCurrentContext(), and pdfi::GraphicsContext::TextRenderMode.
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 94 of file pdfiprocessor.cxx.
References getCurrentContext(), basegfx::unotools::homMatrixFromAffineMatrix(), and Transformation.
Definition at line 325 of file pdfiprocessor.cxx.
References basegfx::B2DHomMatrix::decompose(), getCurrentContext(), Tuple2D< double >::getX(), Tuple2D< double >::getY(), pdfi::Element::h, pdfi::GraphicalElement::MirrorVertical, pdfi::GraphicsContext::Transformation, pdfi::Element::w, pdfi::Element::x, pdfi::Element::y, and pdfi::DrawElement::ZOrder.
Definition at line 688 of file pdfiprocessor.cxx.
References pdfi::Element::Children, and pdfi::lr_tb_sort().
Referenced by pdfi::WriterXmlOptimizer::visit(), and pdfi::DrawXmlOptimizer::visit().
|
private |
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 512 of file pdfiprocessor.cxx.
References basegfx::utils::createPolygonFromRect(), and getCurrentContext().
|
overrideprivatevirtual |
Implements pdfi::ContentSink.
Definition at line 386 of file pdfiprocessor.cxx.
References basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(), getCurrentContext(), pdfi::PATH_STROKE, basegfx::B2DPolyPolygon::transform(), Transformation, pdfi::PolyPolyElement::updateGeometry(), and pdfi::DrawElement::ZOrder.
|
private |
Definition at line 172 of file pdfiprocessor.hxx.
Referenced by PDFIProcessor(), and setFont().
|
private |
Definition at line 174 of file pdfiprocessor.hxx.
Referenced by getCurrentContext(), PDFIProcessor(), popState(), and pushState().
|
private |
Definition at line 177 of file pdfiprocessor.hxx.
Referenced by PDFIProcessor().
|
private |
Definition at line 171 of file pdfiprocessor.hxx.
Referenced by PDFIProcessor(), and setFont().
|
private |
Definition at line 176 of file pdfiprocessor.hxx.
Referenced by PDFIProcessor().
|
private |
Definition at line 179 of file pdfiprocessor.hxx.
|
private |
Definition at line 165 of file pdfiprocessor.hxx.
|
private |
Definition at line 170 of file pdfiprocessor.hxx.
Referenced by setFont().
|
private |
Definition at line 175 of file pdfiprocessor.hxx.
|
private |
Definition at line 182 of file pdfiprocessor.hxx.
|
private |
Definition at line 181 of file pdfiprocessor.hxx.
Referenced by setPageNum().
|
private |
Definition at line 169 of file pdfiprocessor.hxx.
|
private |
Definition at line 168 of file pdfiprocessor.hxx.
|
private |
Definition at line 167 of file pdfiprocessor.hxx.
css::uno::Reference< css::uno::XComponentContext > pdfi::PDFIProcessor::m_xContext |
Definition at line 59 of file pdfiprocessor.hxx.
Referenced by pdfi::DrawXmlOptimizer::GetBreakIterator().
|
private |
Definition at line 184 of file pdfiprocessor.hxx.
Referenced by getStatusIndicator().
double pdfi::PDFIProcessor::prevCharWidth |
Definition at line 61 of file pdfiprocessor.hxx.
basegfx::B2DHomMatrix pdfi::PDFIProcessor::prevTextMatrix |
Definition at line 60 of file pdfiprocessor.hxx.