summaryrefslogtreecommitdiff
path: root/canvas/source/cairo/cairo_surfaceprovider.hxx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2008-06-24 09:26:26 +0000
committerKurt Zenker <kz@openoffice.org>2008-06-24 09:26:26 +0000
commitaa5675b6135bc64bb0807927fa83ce400065e5c1 (patch)
treecb342af3ba86f35abb83c422f7fb2dbcdb868c55 /canvas/source/cairo/cairo_surfaceprovider.hxx
parentef2a3925eaa31fc637b1734c1f6fab7e90a0d6a6 (diff)
INTEGRATION: CWS canvas05 (1.1.2); FILE ADDED
2008/05/23 22:03:44 thb 1.1.2.3: Moving all remaining new files to LGPL 3 2008/04/02 22:56:28 thb 1.1.2.2: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.1.2.1: Backbuffer-less canvas implementation on top of cairo
Diffstat (limited to 'canvas/source/cairo/cairo_surfaceprovider.hxx')
-rw-r--r--canvas/source/cairo/cairo_surfaceprovider.hxx85
1 files changed, 85 insertions, 0 deletions
diff --git a/canvas/source/cairo/cairo_surfaceprovider.hxx b/canvas/source/cairo/cairo_surfaceprovider.hxx
new file mode 100644
index 000000000000..1af1454c4706
--- /dev/null
+++ b/canvas/source/cairo/cairo_surfaceprovider.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * 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_surfaceprovider.hxx,v $
+ * $Revision: 1.2 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _CAIROCANVAS_SURFACEPROVIDER_HXX
+#define _CAIROCANVAS_SURFACEPROVIDER_HXX
+
+#include <rtl/ref.hxx>
+#include <com/sun/star/uno/XInterface.hpp>
+
+#include "cairo_cairo.hxx"
+
+using namespace ::cairo;
+
+class OutputDevice;
+class Bitmap;
+
+namespace cairocanvas
+{
+ class Bitmap;
+
+ /* Definition of RepaintTarget interface */
+
+ /** Target interface for XCachedPrimitive implementations
+
+ This interface must be implemented on all canvas
+ implementations that hand out XCachedPrimitives
+ */
+ class SurfaceProvider : public ::com::sun::star::uno::XInterface
+ {
+ public:
+ virtual ~SurfaceProvider() {}
+
+ /** Query surface from this provider
+
+ This should return the default surface to render on.
+ */
+ virtual SurfaceSharedPtr getSurface() = 0;
+
+ /// create new surface in given size
+ virtual SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize,
+ Content aContent = CAIRO_CONTENT_COLOR_ALPHA ) = 0;
+ /// create new surface from given bitmap
+ virtual SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) = 0;
+
+ /** convert surface between alpha and non-alpha
+ channel. returns new surface on success, NULL otherwise
+ */
+ virtual SurfaceSharedPtr changeSurface( bool bHasAlpha, bool bCopyContent ) = 0;
+
+ /** Provides the underlying vcl outputdevice this surface renders on
+ */
+ virtual OutputDevice* getOutputDevice() = 0;
+ };
+
+ typedef ::rtl::Reference< SurfaceProvider > SurfaceProviderRef;
+}
+
+#endif