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: cairo_win32_cairo.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 _CAIROCANVAS_WIN32_CAIRO_HXX
32 #define _CAIROCANVAS_WIN32_CAIRO_HXX
35 # include <tools/prewin.h>
37 # include <tools/postwin.h>
40 #include "cairo_cairo.hxx"
44 class Win32Surface
: public Surface
46 CairoSurfaceSharedPtr mpSurface
;
49 /// takes over ownership of passed cairo_surface
50 explicit Win32Surface( const CairoSurfaceSharedPtr
& pSurface
);
51 /// create surface on subarea of given drawable
52 Win32Surface( HDC hDC
, int x
, int y
);
53 /// create surface for given bitmap data
54 Win32Surface( const BitmapSystemData
& rBmpData
);
57 virtual CairoSharedPtr
getCairo() const;
58 virtual CairoSurfaceSharedPtr
getCairoSurface() const { return mpSurface
; }
59 virtual SurfaceSharedPtr
getSimilar( Content aContent
, int width
, int height
) const;
61 virtual boost::shared_ptr
<VirtualDevice
> createVirtualDevice() const;
63 virtual void Resize( int width
, int height
);
65 virtual void flush() const;
70 unsigned long ucs4toindex(unsigned int ucs4
, HFONT hfont
);