wxMaxima
Loading...
Searching...
No Matches
EMFout.h
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2//
3// Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4// Copyright (C) 2015 Gunter Königsmann <wxMaxima@physikbuch.de>
5//
6// This program is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 2 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16//
17// You should have received a copy of the GNU General Public License
18// along with this program; if not, write to the Free Software
19// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20//
21// SPDX-License-Identifier: GPL-2.0+
22
23#ifndef EMFOUT_H
24#define EMFOUT_H
25
26#include "precomp.h"
27#include "OutCommon.h"
28
29#if wxUSE_ENH_METAFILE
30#include <wx/msw/enhmeta.h>
31#include <memory>
32
34class Emfout final
35{
36public:
37 explicit Emfout(const Configuration * const *configuration, const wxString &filename = {});
38 explicit Emfout(const Configuration * const *configuration, std::unique_ptr<Cell> &&tree, const wxString &filename = {});
39 ~Emfout();
40
46 wxSize Render(std::unique_ptr<Cell> &&tree);
47
48 wxSize GetSize() const { return m_size; }
49 bool IsOk() const { return m_isOk; }
50
52 bool ToClipboard();
53
55 std::unique_ptr<wxEnhMetaFileDataObject> GetDataObject() const;
56
57private:
58 std::unique_ptr<Cell> m_tree;
59 OutCommon m_cmn;
61 wxEnhMetaFileDC m_recalculationDc;
63 std::unique_ptr<wxEnhMetaFile> m_metaFile;
64 wxSize m_size = wxDefaultSize;
65 bool m_isOk = false;
66
67 bool Layout();
68};
69
70#endif // wxUSE_ENH_METAFILE
71#endif // EMFOUT_H
This is the header for common code used by various file output modules that render cells to files.
The configuration storage for the current worksheet.
Definition: Configuration.h:85
A collection of common code used in rendering the cells to a non-default output, e....
Definition: OutCommon.h:43