LibreOffice Module canvas (master)  1
cairo_services.cxx
Go to the documentation of this file.
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 #include <sal/config.h>
21 
23 
24 #include "cairo_canvas.hxx"
25 #include "cairo_spritecanvas.hxx"
26 
27 
28 using namespace ::com::sun::star;
29 
30 #if defined(_WIN32) || defined (MACOSX)
31 # error "The cairo canvas should not be enabled on Windows or Mac cf fdo#46901"
32 #endif
33 
35 
36 namespace cairocanvas
37 {
38  static uno::Reference<uno::XInterface> initCanvas( Canvas* pCanvas )
39  {
40  uno::Reference<uno::XInterface> xRet(static_cast<cppu::OWeakObject*>(pCanvas));
41  pCanvas->initialize();
42  return xRet;
43  }
44 
47  serviceImpl1,
50 
51  static uno::Reference<uno::XInterface> initSpriteCanvas( SpriteCanvas* pCanvas )
52  {
53  uno::Reference<uno::XInterface> xRet(static_cast<cppu::OWeakObject*>(pCanvas));
54  pCanvas->initialize();
55  return xRet;
56  }
57 
58  namespace sdecl = comphelper::service_decl;
61  serviceImpl2,
64 }
65 
66 // The C shared lib entry points
67 extern "C"
68 SAL_DLLPUBLIC_EXPORT void* cairocanvas_component_getFactory( char const* pImplName,
69  void*, void* )
70 {
71  return sdecl::component_getFactoryHelper( pImplName, {&cairocanvas::cairoCanvasDecl, &cairocanvas::cairoSpriteCanvasDecl} );
72 }
73 
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sdecl::class_< SpriteCanvas, sdecl::with_args< true > > const serviceImpl2 & initSpriteCanvas
const sdecl::ServiceDecl cairoSpriteCanvasDecl(serviceImpl2, SPRITECANVAS_IMPLEMENTATION_NAME, SPRITECANVAS_SERVICE_NAME)
#define SPRITECANVAS_IMPLEMENTATION_NAME
#define CANVAS_IMPLEMENTATION_NAME
sdecl::class_< Canvas, sdecl::with_args< true > > const serviceImpl1 & initCanvas
Product of this component's factory.
#define SPRITECANVAS_SERVICE_NAME
Product of this component's factory.
#define CANVAS_SERVICE_NAME
const sdecl::ServiceDecl cairoCanvasDecl(serviceImpl1, CANVAS_IMPLEMENTATION_NAME, CANVAS_SERVICE_NAME)
SAL_DLLPUBLIC_EXPORT void * cairocanvas_component_getFactory(char const *pImplName, void *, void *)