xref: /trunk/main/canvas/source/vcl/services.cxx (revision 25ea7f45)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_canvas.hxx"
26 
27 #include <canvas/debug.hxx>
28 #include <canvas/verbosetrace.hxx>
29 #include <canvas/canvastools.hxx>
30 
31 #include <com/sun/star/registry/XRegistryKey.hpp>
32 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
33 #include <com/sun/star/uno/XComponentContext.hpp>
34 
35 #include <cppuhelper/factory.hxx>
36 #include <cppuhelper/implementationentry.hxx>
37 #include <comphelper/servicedecl.hxx>
38 
39 #include <vcl/canvastools.hxx>
40 #include <vcl/outdev.hxx>
41 #include <vcl/window.hxx>
42 #include <vcl/bitmapex.hxx>
43 
44 #include <basegfx/tools/canvastools.hxx>
45 
46 #include <algorithm>
47 
48 #include "canvas.hxx"
49 #include "spritecanvas.hxx"
50 
51 
52 using namespace ::com::sun::star;
53 
54 namespace vclcanvas
55 {
56     namespace sdecl = comphelper::service_decl;
57 
initCanvas(Canvas * pCanvas)58     static uno::Reference<uno::XInterface> initCanvas( Canvas* pCanvas )
59     {
60         uno::Reference<uno::XInterface> xRet(static_cast<cppu::OWeakObject*>(pCanvas));
61         pCanvas->initialize();
62         return xRet;
63     }
64 
65     sdecl::class_<Canvas, sdecl::with_args<true> > serviceImpl1(&initCanvas);
66     const sdecl::ServiceDecl vclCanvasDecl(
67         serviceImpl1,
68         CANVAS_IMPLEMENTATION_NAME,
69         CANVAS_SERVICE_NAME );
70 
initSpriteCanvas(SpriteCanvas * pCanvas)71     static uno::Reference<uno::XInterface> initSpriteCanvas( SpriteCanvas* pCanvas )
72     {
73         uno::Reference<uno::XInterface> xRet(static_cast<cppu::OWeakObject*>(pCanvas));
74         pCanvas->initialize();
75         return xRet;
76     }
77 
78     sdecl::class_<SpriteCanvas, sdecl::with_args<true> > serviceImpl2(&initSpriteCanvas);
79     const sdecl::ServiceDecl vclSpriteCanvasDecl(
80         serviceImpl2,
81         SPRITECANVAS_IMPLEMENTATION_NAME,
82         SPRITECANVAS_SERVICE_NAME );
83 }
84 
85 // The C shared lib entry points
86 COMPHELPER_SERVICEDECL_EXPORTS2(vclcanvas::vclCanvasDecl, vclcanvas::vclSpriteCanvasDecl)
87