summaryrefslogtreecommitdiff
path: root/emfio/inc/emfreader.hxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2017-06-15 16:35:31 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-07-15 11:01:29 +0200
commitc7470f5be441d8fe80155ff29605d74d5838be26 (patch)
tree1547af7f13f4d83d972f86115d0fc49a8a734105 /emfio/inc/emfreader.hxx
parentb93d0cadb79f6652dec4d29ef20813f1d57cc708 (diff)
emfplus: add rough version of local reader
Complete redevelopent is too expensive, start with adding a copy of the existing vcl importer which will in the next steps be adapted to import primitives instead of MetaFile(Actions). Adapted namespace, made compile and added sample code to roughly use it Change-Id: I79e7ea0d78099fbbe18e2a595457b2ab353f58ea
Diffstat (limited to 'emfio/inc/emfreader.hxx')
-rw-r--r--emfio/inc/emfreader.hxx55
1 files changed, 55 insertions, 0 deletions
diff --git a/emfio/inc/emfreader.hxx b/emfio/inc/emfreader.hxx
new file mode 100644
index 000000000000..c4f7e17e574d
--- /dev/null
+++ b/emfio/inc/emfreader.hxx
@@ -0,0 +1,55 @@
+/* -*- 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_EMFIO_INC_EMFREADER_HXX
+#define INCLUDED_EMFIO_INC_EMFREADER_HXX
+
+#include <mtftools.hxx>
+
+namespace emfio
+{
+ class EmfReader : public MtfTools
+ {
+ bool bRecordPath;
+ sal_Int32 nRecordCount;
+ bool bEMFPlus;
+
+ bool ReadHeader();
+ // reads and converts the rectangle
+ static tools::Rectangle ReadRectangle(sal_Int32, sal_Int32, sal_Int32, sal_Int32);
+
+ public:
+ EmfReader(SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, FilterConfigItem* pConfigItem = nullptr);
+ ~EmfReader();
+
+ bool ReadEnhWMF();
+ private:
+ template <class T> void ReadAndDrawPolyPolygon();
+ template <class T> void ReadAndDrawPolyLine();
+ template <class T> tools::Polygon ReadPolygon(sal_uInt32 nStartIndex, sal_uInt32 nPoints);
+ template <class T, class Drawer> void ReadAndDrawPolygon(Drawer drawer, const bool skipFirst);
+
+ tools::Rectangle ReadRectangle();
+ void ReadEMFPlusComment(sal_uInt32 length, bool& bHaveDC);
+ };
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */