LibreOffice Module canvas (master)  1
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 "canvas.hxx"
25 #include "spritecanvas.hxx"
26 
27 
28 using namespace ::com::sun::star;
29 
31 
32 namespace vclcanvas
33 {
34  static uno::Reference<uno::XInterface> initCanvas( Canvas* pCanvas )
35  {
36  uno::Reference<uno::XInterface> xRet(static_cast<cppu::OWeakObject*>(pCanvas));
37  pCanvas->initialize();
38  return xRet;
39  }
40 
43  serviceImpl1,
46 
47  static uno::Reference<uno::XInterface> initSpriteCanvas( SpriteCanvas* pCanvas )
48  {
49  uno::Reference<uno::XInterface> xRet(static_cast<cppu::OWeakObject*>(pCanvas));
50  pCanvas->initialize();
51  return xRet;
52  }
53 
56  serviceImpl2,
59 }
60 
61 // The C shared lib entry points
62 extern "C"
63 SAL_DLLPUBLIC_EXPORT void* vclcanvas_component_getFactory( char const* pImplName,
64  void*, void* )
65 {
66  return sdecl::component_getFactoryHelper( pImplName, {&vclcanvas::vclCanvasDecl, &vclcanvas::vclSpriteCanvasDecl} );
67 }
68 
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC_EXPORT void * vclcanvas_component_getFactory(char const *pImplName, void *, void *)
Definition: services.cxx:63
#define SPRITECANVAS_IMPLEMENTATION_NAME
#define CANVAS_IMPLEMENTATION_NAME
const sdecl::ServiceDecl vclSpriteCanvasDecl(serviceImpl2, SPRITECANVAS_IMPLEMENTATION_NAME, SPRITECANVAS_SERVICE_NAME)
Product of this component's factory.
#define SPRITECANVAS_SERVICE_NAME
Product of this component's factory.
Definition: canvas.hxx:76
sdecl::class_< Canvas, sdecl::with_args< true > > const serviceImpl1 & initCanvas
Definition: services.cxx:41
const sdecl::ServiceDecl vclCanvasDecl(serviceImpl1, CANVAS_IMPLEMENTATION_NAME, CANVAS_SERVICE_NAME)
#define CANVAS_SERVICE_NAME
void initialize()
Definition: canvas.cxx:62
sdecl::class_< SpriteCanvas, sdecl::with_args< true > > const serviceImpl2 & initSpriteCanvas
Definition: services.cxx:54