1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pagemanager.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_CANVAS_PAGEMANAGER_HXX
32 #define INCLUDED_CANVAS_PAGEMANAGER_HXX
34 #include <basegfx/vector/b2isize.hxx>
35 #include <canvas/rendering/irendermodule.hxx>
36 #include <canvas/rendering/isurface.hxx>
43 //////////////////////////////////////////////////////////////////////////////////
45 //////////////////////////////////////////////////////////////////////////////////
50 PageManager( const canvas::IRenderModuleSharedPtr pRenderModule
) :
51 mpRenderModule(pRenderModule
)
55 // returns the maximum size of a hardware
56 // accelerated page, e.g. OpenGL texture.
57 ::basegfx::B2ISize
getPageSize() const;
59 canvas::IRenderModuleSharedPtr
getRenderModule() const;
61 FragmentSharedPtr
allocateSpace( const ::basegfx::B2ISize
& rSize
);
62 void free( const FragmentSharedPtr
& pFragment
);
64 void nakedFragment( const FragmentSharedPtr
& pFragment
);
69 // the pagemanager needs access to the rendermodule
70 // since we query for system resources from it.
71 canvas::IRenderModuleSharedPtr mpRenderModule
;
73 // here we collect all fragments that will be created
74 // since we need them for relocation purposes.
75 typedef std::list
<FragmentSharedPtr
> FragmentContainer_t
;
76 FragmentContainer_t maFragments
;
78 // this is the container holding all created pages,
79 // behind the scenes these are real hardware surfaces.
80 typedef std::list
<PageSharedPtr
> PageContainer_t
;
81 PageContainer_t maPages
;
83 bool relocate( const FragmentSharedPtr
& pFragment
);
86 //////////////////////////////////////////////////////////////////////////////////
87 // PageManagerSharedPtr
88 //////////////////////////////////////////////////////////////////////////////////
90 typedef ::boost::shared_ptr
< PageManager
> PageManagerSharedPtr
;
92 //////////////////////////////////////////////////////////////////////////////////
94 //////////////////////////////////////////////////////////////////////////////////