Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include <vcl/outdev.hxx>
22 : #include <basegfx/matrix/b2dhommatrix.hxx>
23 : #include <basegfx/range/b2drange.hxx>
24 : #include <vcl/gdimtf.hxx>
25 : #include <basegfx/tools/canvastools.hxx>
26 : #include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
27 : #include "vclmetafileprocessor2d.hxx"
28 : #include "vclpixelprocessor2d.hxx"
29 : #include <vcl/window.hxx>
30 :
31 : //////////////////////////////////////////////////////////////////////////////
32 :
33 : using namespace com::sun::star;
34 :
35 : //////////////////////////////////////////////////////////////////////////////
36 :
37 : namespace drawinglayer
38 : {
39 : namespace processor2d
40 : {
41 17612 : drawinglayer::processor2d::BaseProcessor2D* createBaseProcessor2DFromOutputDevice(
42 : OutputDevice& rTargetOutDev,
43 : const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
44 : {
45 17612 : const GDIMetaFile* pMetaFile = rTargetOutDev.GetConnectMetaFile();
46 17612 : const bool bOutputToRecordingMetaFile(pMetaFile && pMetaFile->IsRecord() && !pMetaFile->IsPause());
47 :
48 17612 : if(bOutputToRecordingMetaFile)
49 : {
50 : // create MetaFile Vcl-Processor and process
51 28 : return new drawinglayer::processor2d::VclMetafileProcessor2D(rViewInformation2D, rTargetOutDev);
52 : }
53 : else
54 : {
55 : // create Pixel Vcl-Processor
56 17584 : return new drawinglayer::processor2d::VclPixelProcessor2D(rViewInformation2D, rTargetOutDev);
57 : }
58 : }
59 : } // end of namespace processor2d
60 408 : } // end of namespace drawinglayer
61 :
62 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|