xref: /AOO41X/main/drawinglayer/source/processor2d/processor2dtools.cxx (revision 47148b3bc50811ceb41802e4cc50a5db21535900)
1*a7185797SArmin Le Grand /**************************************************************
2*a7185797SArmin Le Grand  *
3*a7185797SArmin Le Grand  * Licensed to the Apache Software Foundation (ASF) under one
4*a7185797SArmin Le Grand  * or more contributor license agreements.  See the NOTICE file
5*a7185797SArmin Le Grand  * distributed with this work for additional information
6*a7185797SArmin Le Grand  * regarding copyright ownership.  The ASF licenses this file
7*a7185797SArmin Le Grand  * to you under the Apache License, Version 2.0 (the
8*a7185797SArmin Le Grand  * "License"); you may not use this file except in compliance
9*a7185797SArmin Le Grand  * with the License.  You may obtain a copy of the License at
10*a7185797SArmin Le Grand  *
11*a7185797SArmin Le Grand  *   http://www.apache.org/licenses/LICENSE-2.0
12*a7185797SArmin Le Grand  *
13*a7185797SArmin Le Grand  * Unless required by applicable law or agreed to in writing,
14*a7185797SArmin Le Grand  * software distributed under the License is distributed on an
15*a7185797SArmin Le Grand  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*a7185797SArmin Le Grand  * KIND, either express or implied.  See the License for the
17*a7185797SArmin Le Grand  * specific language governing permissions and limitations
18*a7185797SArmin Le Grand  * under the License.
19*a7185797SArmin Le Grand  *
20*a7185797SArmin Le Grand  *************************************************************/
21*a7185797SArmin Le Grand 
22*a7185797SArmin Le Grand // MARKER(update_precomp.py): autogen include statement, do not remove
23*a7185797SArmin Le Grand #include "precompiled_drawinglayer.hxx"
24*a7185797SArmin Le Grand 
25*a7185797SArmin Le Grand #include <drawinglayer/processor2d/processor2dtools.hxx>
26*a7185797SArmin Le Grand #include <drawinglayer/processor2d/vclpixelprocessor2d.hxx>
27*a7185797SArmin Le Grand #include <drawinglayer/processor2d/vclmetafileprocessor2d.hxx>
28*a7185797SArmin Le Grand 
29*a7185797SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
30*a7185797SArmin Le Grand 
31*a7185797SArmin Le Grand using namespace com::sun::star;
32*a7185797SArmin Le Grand 
33*a7185797SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
34*a7185797SArmin Le Grand 
35*a7185797SArmin Le Grand namespace drawinglayer
36*a7185797SArmin Le Grand {
37*a7185797SArmin Le Grand     namespace processor2d
38*a7185797SArmin Le Grand     {
createPixelProcessor2DFromOutputDevice(OutputDevice & rTargetOutDev,const drawinglayer::geometry::ViewInformation2D & rViewInformation2D)39*a7185797SArmin Le Grand         BaseProcessor2D* createPixelProcessor2DFromOutputDevice(
40*a7185797SArmin Le Grand             OutputDevice& rTargetOutDev,
41*a7185797SArmin Le Grand             const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
42*a7185797SArmin Le Grand         {
43*a7185797SArmin Le Grand             // create Pixel Vcl-Processor
44*a7185797SArmin Le Grand             return new VclPixelProcessor2D(rViewInformation2D, rTargetOutDev);
45*a7185797SArmin Le Grand         }
46*a7185797SArmin Le Grand 
createProcessor2DFromOutputDevice(OutputDevice & rTargetOutDev,const drawinglayer::geometry::ViewInformation2D & rViewInformation2D)47*a7185797SArmin Le Grand         BaseProcessor2D* createProcessor2DFromOutputDevice(
48*a7185797SArmin Le Grand             OutputDevice& rTargetOutDev,
49*a7185797SArmin Le Grand             const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
50*a7185797SArmin Le Grand         {
51*a7185797SArmin Le Grand             const GDIMetaFile* pMetaFile = rTargetOutDev.GetConnectMetaFile();
52*a7185797SArmin Le Grand             const bool bOutputToRecordingMetaFile(pMetaFile && pMetaFile->IsRecord() && !pMetaFile->IsPause());
53*a7185797SArmin Le Grand 
54*a7185797SArmin Le Grand             if(bOutputToRecordingMetaFile)
55*a7185797SArmin Le Grand             {
56*a7185797SArmin Le Grand                 // create MetaFile Vcl-Processor and process
57*a7185797SArmin Le Grand                 return new VclMetafileProcessor2D(rViewInformation2D, rTargetOutDev);
58*a7185797SArmin Le Grand             }
59*a7185797SArmin Le Grand             else
60*a7185797SArmin Le Grand             {
61*a7185797SArmin Le Grand                 // create Pixel Vcl-Processor
62*a7185797SArmin Le Grand                 return createPixelProcessor2DFromOutputDevice(
63*a7185797SArmin Le Grand                     rTargetOutDev,
64*a7185797SArmin Le Grand                     rViewInformation2D);
65*a7185797SArmin Le Grand             }
66*a7185797SArmin Le Grand         }
67*a7185797SArmin Le Grand     } // end of namespace processor2d
68*a7185797SArmin Le Grand } // end of namespace drawinglayer
69*a7185797SArmin Le Grand 
70*a7185797SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
71*a7185797SArmin Le Grand // eof
72