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

68 lines
2.5 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.9 $
*
* 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
#include "cairo_cairo.hxx"
#ifdef WNT
# include <tools/prewin.h>
# include <windows.h>
# include <tools/postwin.h>
#endif
#include <vcl/sysdata.hxx>
#include <vcl/syschild.hxx>
namespace cairo
{
/****************************************************************************************
* Platform independent part of surface backends for OpenOffice.org Cairo Canvas *
* For the rest of the functions (and the platform-specific derived *
* Surface classes), see platform specific cairo_<platform>_cairo.cxx *
****************************************************************************************/
const SystemEnvData* GetSysData(const Window *pOutputWindow)
{
const SystemEnvData* pSysData = NULL;
// check whether we're a SysChild: have to fetch system data
// directly from SystemChildWindow, because the GetSystemData
// method is unfortunately not virtual
const SystemChildWindow* pSysChild = dynamic_cast< const SystemChildWindow* >( pOutputWindow );
if( pSysChild )
pSysData = pSysChild->GetSystemData();
else
pSysData = pOutputWindow->GetSystemData();
return pSysData;
}
}