Files
libreoffice/canvas/source/cairo/cairo_cairo.cxx

132 lines
4.3 KiB
C++
Raw Normal View History

/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: cairo_cairo.cxx,v $
* $Revision: 1.8 $
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_canvas.hxx"
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
/****************************************************************************************
* Platform independent part of surface backends for OpenOffice.org Cairo Canvas *
* For rest of the functions, see platform specific cairo_<platform>_cairo.cxx *
****************************************************************************************/
#include "cairo_cairo.hxx"
namespace cairo
{
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
/**
* Surface::getCairo: Create Cairo for the Canvas surface
*
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
* @return new Cairo or NULL
**/
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
Cairo* Surface::getCairo()
{
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
Cairo *cr = NULL;
if (mpSurface) {
cr = cairo_create( mpSurface );
}
return cr;
}
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
// This is needed to distinguish support for Cairo versions < 1.2.
#if !defined (USE_CAIRO10_APIS)
/**
* Surface::~Surface: Destroy the Canvas surface
*
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
* Cairo itself takes care of freeing any resources, such as
* image data and other references related to the surface.
*
**/
Surface::~Surface()
{
if( mpSurface )
{
cairo_surface_destroy( mpSurface );
mpSurface = NULL;
}
}
/**
* Surface::getSimilar: Create new similar Canvas surface
* @param aContent format of the new surface (cairo_content_t from cairo/src/cairo.h)
* @param width width of the new surface
* @param height height of the new surface
*
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
* Creates a new Canvas surface. This should create platform native surface, even though
* generic function is used.
*
* Cairo surface from aContent (cairo_content_t)
*
* @return new surface or NULL
**/
Surface* Surface::getSimilar( Content aContent, int width, int height )
{
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
// This should create platform native Cairo surface on ALL platforms.
return new Surface( cairo_surface_create_similar( mpSurface, aContent, width, height ) );
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
// For example on Mac OS X, cairo_surface_create_similar() actually results in native surface,
// equivalent to cairo_quartz_surface_create()
}
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
#endif // !defined (USE_CAIRO10_APIS)
/**
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
* Surface::createVirtualDevice: Create new VCL virtual device
*
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
* Creates a new virtual device in VCL, with the current mpSurface contents as data.
* This is used by e.g. cairo_canvashelper_text.cxx to make VCL draw text on the cairo surface.
*
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
* @return new virtual device
**/
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
VirtualDevice* Surface::createVirtualDevice()
{
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
// struct SystemGraphicsData in vcl/inc/sysdata.hxx
SystemGraphicsData aSystemGraphicsData;
aSystemGraphicsData.nSize = sizeof(SystemGraphicsData);
fillSystemGraphicsData( aSystemGraphicsData );
/**
* Contrary to the description of
* VirtualDevice(SystemGraphicsData*, nBitCount); (in vcl/inc/virdev.hxx)
* at least X11 behaves differently, i.e. nBitCount is color depth, not just 1 or 0.
**/
return new VirtualDevice( &aSystemGraphicsData,
sal::static_int_cast<USHORT>(getDepth()) );
}
INTEGRATION: CWS cairoquartz01 (1.4.28); FILE MERGED 2008/03/27 22:50:17 thb 1.4.28.15: Cleaned up a few warnings, made this (almost) build on win32. Still missing the cairo_win32_cairo.cxx file. 2007/07/28 15:30:19 mox 1.4.28.14: RESYNC: (1.4-1.5); FILE MERGED Fix conflicts due to code having been moved around. 2007/07/20 10:11:48 mox 1.4.28.13: Cleanup includes and revise code comments 2007/07/19 17:25:50 mox 1.4.28.12: Cleanup - We don't need to store mpSysData inside the Surface (in 1.2 API). 2007/07/19 07:26:34 mox 1.4.28.11: Legacy cairo API support is not needed on Win32 and Mac OS X Quartz. 2007/07/18 23:08:55 mox 1.4.28.10: Document the new function. 2007/07/18 21:32:40 radekdoulik 1.4.28.9: Issue number: 69066 Submitted by: radekdoulik Reviewed by: radekdoulik Removed platform dependend code from cairo_canvashelper_text.cxx 2007/07/17 22:34:42 mox 1.4.28.8: Rework cross-platform files to be separate for each platform. The <1.2 API support is now mostly in platform specific files. 2007/07/11 18:30:07 mox 1.4.28.7: Add a few comments to cairo Win32 implementation 2007/06/20 14:57:13 mox 1.4.28.6: Cleanup headers and fix compilation bugs. 2007/06/04 21:13:49 mox 1.4.28.5: Enable building different platforms with both Cairo 1.0 and Cairo 1.2 APIs. Only Quartz uses the Cairo 1.2 API by default. 2007/06/02 23:05:32 thb 1.4.28.4: #i70519# Merged in tml's fixes for WinCairo; made code compile warning-free under Linux; added prex/postx.h (which where already referenced); cleaned up a bit; replaces plain round() call with basegfx::fround; asserting unexpected/unimplemented case at selected places 2007/05/26 12:50:12 mox 1.4.28.3: Retain CGContext so that it doesn't get removed unintentionally. 2007/05/01 21:21:43 mox 1.4.28.2: urther fixes: - separate X11 cairo 1.0 API to legacy file: cairo_cairolegacy.cxx. - maximize the use of crossplatform code - fix quartz bugs 2007/04/12 20:15:57 mox 1.4.28.1: Issue number: #69066# initial Cairo Quartz implementation
2008-04-02 08:40:35 +00:00
} // namespace cairo