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 <algorithm> 40 41 #include "cairo_canvas.hxx" 42 #include "cairo_spritecanvas.hxx" 43 44 45 using namespace ::com::sun::star; 46 47 namespace cairocanvas 48 { initCanvas(Canvas * pCanvas)49 static uno::Reference<uno::XInterface> initCanvas( Canvas* pCanvas ) 50 { 51 uno::Reference<uno::XInterface> xRet(static_cast<cppu::OWeakObject*>(pCanvas)); 52 pCanvas->initialize(); 53 return xRet; 54 } 55 56 namespace sdecl = comphelper::service_decl; 57 sdecl::class_< Canvas, sdecl::with_args<true> > serviceImpl1(&initCanvas); 58 const sdecl::ServiceDecl cairoCanvasDecl( 59 serviceImpl1, 60 CANVAS_IMPLEMENTATION_NAME, 61 CANVAS_SERVICE_NAME ); 62 initSpriteCanvas(SpriteCanvas * pCanvas)63 static uno::Reference<uno::XInterface> initSpriteCanvas( SpriteCanvas* pCanvas ) 64 { 65 uno::Reference<uno::XInterface> xRet(static_cast<cppu::OWeakObject*>(pCanvas)); 66 pCanvas->initialize(); 67 return xRet; 68 } 69 70 namespace sdecl = comphelper::service_decl; 71 sdecl::class_< SpriteCanvas, sdecl::with_args<true> > serviceImpl2(&initSpriteCanvas); 72 const sdecl::ServiceDecl cairoSpriteCanvasDecl( 73 serviceImpl2, 74 SPRITECANVAS_IMPLEMENTATION_NAME, 75 SPRITECANVAS_SERVICE_NAME ); 76 } 77 78 // The C shared lib entry points 79 COMPHELPER_SERVICEDECL_EXPORTS2(cairocanvas::cairoCanvasDecl, cairocanvas::cairoSpriteCanvasDecl) 80