1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _CPPCANVAS_BASEGFXFACTORY_HXX
21 #define _CPPCANVAS_BASEGFXFACTORY_HXX
23 #include <cppcanvas/canvas.hxx>
24 #include <cppcanvas/bitmapcanvas.hxx>
25 #include <cppcanvas/spritecanvas.hxx>
26 #include <cppcanvas/polypolygon.hxx>
27 #include <cppcanvas/bitmap.hxx>
28 #include <cppcanvas/renderer.hxx>
29 #include <cppcanvas/text.hxx>
30 #include <cppcanvas/sprite.hxx>
31 #include <basegfx/vector/b2isize.hxx>
33 #include <cppcanvas/cppcanvasdllapi.h>
42 /* Definition of BaseGfxFactory class */
46 /** The BaseGfxFactory creates Canvas objects for various basegfx
47 primitives, such as polygons and bitmaps (not yet
50 Please note that the objects created for a specific Canvas can
51 only be drawn on exactly that canvas. You have to regenerate
52 them for different canvases.
54 class CPPCANVAS_DLLPUBLIC BaseGfxFactory
57 static BaseGfxFactory
& getInstance();
59 /** Create a polygon from a ::basegfx::B2DPolygon
61 The created polygon initially has the same size in user
62 coordinate space as the source polygon
64 PolyPolygonSharedPtr
createPolyPolygon( const CanvasSharedPtr
&, const ::basegfx::B2DPolygon
& rPoly
) const;
66 /** Create an uninitialized bitmap with the given size
68 BitmapSharedPtr
createBitmap( const CanvasSharedPtr
&, const ::basegfx::B2ISize
& rSize
) const;
70 /** Create an uninitialized alpha bitmap with the given size
72 BitmapSharedPtr
createAlphaBitmap( const CanvasSharedPtr
&, const ::basegfx::B2ISize
& rSize
) const;
75 friend struct InitInstance2
;
80 // default: disabled copy/assignment
81 BaseGfxFactory(const BaseGfxFactory
&);
82 BaseGfxFactory
& operator=( const BaseGfxFactory
& );
87 #endif /* _CPPCANVAS_BASEGFXFACTORY_HXX */
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */