summaryrefslogtreecommitdiff
path: root/include/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-10-15 09:38:56 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-10-18 21:20:40 +0200
commit52c2b0fefcd3743c266cccb321ae194fd00720a4 (patch)
tree96b1e786cdb1f2295d688b99f7ca5e45ae3540b3 /include/vcl
parentcf9dd0ab74db5e1f97c20737290a55a30a8738e5 (diff)
sd: custom annotation marker and draw polygon annotation from PDF
This implements custom annotation marker, which overrides the default marker drawing of comments in Draw/Impress. The polygon is transported from the import of PDF to SdPdfFilter, then the sd::Annotation is set-up, by settuing up the new class CustomAnnotationMarker. CustomAnnotationMarker also supports setting of the line color, line width and fill color. The OverlayPolyPolygon is the new class that is responsible for the marker overlay, mainly to create the Primitive2D of the marker, that will be shown on the screen. This only implements Polygon PDF annotation sub-type. Change-Id: Ic663c31c5b3db5c13179dde63c1a0b81159f4b80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104365 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/vcl')
-rw-r--r--include/vcl/pdf/PDFAnnotationMarker.hxx37
-rw-r--r--include/vcl/pdfread.hxx5
2 files changed, 42 insertions, 0 deletions
diff --git a/include/vcl/pdf/PDFAnnotationMarker.hxx b/include/vcl/pdf/PDFAnnotationMarker.hxx
new file mode 100644
index 000000000000..2cfbeaa31111
--- /dev/null
+++ b/include/vcl/pdf/PDFAnnotationMarker.hxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include <tools/color.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+
+namespace vcl::pdf
+{
+struct VCL_DLLPUBLIC PDFAnnotationMarker
+{
+ PDFAnnotationMarker()
+ : mnWidth(0.0f)
+ , maFillColor(COL_TRANSPARENT)
+ {
+ }
+
+ float mnWidth;
+ Color maFillColor;
+};
+
+struct VCL_DLLPUBLIC PDFAnnotationMarkerPolygon : public PDFAnnotationMarker
+{
+ basegfx::B2DPolygon maPolygon;
+};
+
+} // namespace vcl::pdf
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/pdfread.hxx b/include/vcl/pdfread.hxx
index bffdb104da42..78bc4a305aed 100644
--- a/include/vcl/pdfread.hxx
+++ b/include/vcl/pdfread.hxx
@@ -13,11 +13,13 @@
#include <vector>
#include <tools/gen.hxx>
#include <tools/stream.hxx>
+#include <tools/color.hxx>
#include <vcl/graph.hxx>
#include <basegfx/range/b2drectangle.hxx>
#include <com/sun/star/util/DateTime.hpp>
#include <vcl/pdf/PDFAnnotationSubType.hxx>
+#include <vcl/pdf/PDFAnnotationMarker.hxx>
namespace com::sun::star::uno
{
@@ -43,7 +45,10 @@ struct PDFGraphicAnnotation
basegfx::B2DRectangle maRectangle; // In HMM
css::util::DateTime maDateTime;
+ Color maColor;
+
pdf::PDFAnnotationSubType meSubType;
+ std::shared_ptr<pdf::PDFAnnotationMarker> mpMarker;
};
class PDFGraphicResult