2010-10-27 12:45:53 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2008-05-13 13:28:21 +00:00
|
|
|
|
2013-11-05 02:20:56 +01:00
|
|
|
#ifndef INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERCANVASHELPER_HXX
|
|
|
|
#define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERCANVASHELPER_HXX
|
2008-05-13 13:28:21 +00:00
|
|
|
|
|
|
|
#include "PresenterTheme.hxx"
|
|
|
|
#include <com/sun/star/awt/Point.hpp>
|
|
|
|
#include <com/sun/star/awt/Rectangle.hpp>
|
2009-09-18 15:39:21 +00:00
|
|
|
#include <com/sun/star/rendering/TextDirection.hpp>
|
2008-05-13 13:28:21 +00:00
|
|
|
#include <com/sun/star/rendering/XCanvas.hpp>
|
|
|
|
#include <com/sun/star/rendering/XCanvasFont.hpp>
|
|
|
|
#include <com/sun/star/rendering/XPolyPolygon2D.hpp>
|
|
|
|
#include <rtl/ref.hxx>
|
|
|
|
#include <boost/noncopyable.hpp>
|
|
|
|
|
|
|
|
namespace sdext { namespace presenter {
|
|
|
|
|
|
|
|
/** Collection of functions to ease the life of a canvas user.
|
|
|
|
*/
|
|
|
|
class PresenterCanvasHelper
|
|
|
|
: ::boost::noncopyable
|
|
|
|
{
|
|
|
|
public:
|
2015-04-14 12:44:47 +02:00
|
|
|
PresenterCanvasHelper();
|
|
|
|
~PresenterCanvasHelper();
|
2008-05-13 13:28:21 +00:00
|
|
|
|
|
|
|
void Paint (
|
|
|
|
const SharedBitmapDescriptor& rpBitmap,
|
|
|
|
const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
|
|
|
|
const css::awt::Rectangle& rRepaintBox,
|
|
|
|
const css::awt::Rectangle& rBackgroundBoundingBox,
|
|
|
|
const css::awt::Rectangle& rContentBoundingBox) const;
|
|
|
|
|
2008-07-11 12:39:48 +00:00
|
|
|
static void PaintRectangle (
|
|
|
|
const SharedBitmapDescriptor& rpBitmap,
|
2008-05-13 13:28:21 +00:00
|
|
|
const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
|
|
|
|
const css::awt::Rectangle& rRepaintBox,
|
2008-07-11 12:39:48 +00:00
|
|
|
const css::awt::Rectangle& rBackgroundBoundingBox,
|
|
|
|
const css::awt::Rectangle& rContentBoundingBox,
|
|
|
|
const css::rendering::ViewState& rDefaultViewState,
|
|
|
|
const css::rendering::RenderState& rDefaultRenderState);
|
2008-05-13 13:28:21 +00:00
|
|
|
|
|
|
|
static void SetDeviceColor(
|
|
|
|
css::rendering::RenderState& rRenderState,
|
|
|
|
const css::util::Color aColor);
|
|
|
|
|
2009-09-18 15:39:21 +00:00
|
|
|
static css::geometry::RealRectangle2D GetTextBoundingBox (
|
|
|
|
const css::uno::Reference<css::rendering::XCanvasFont>& rxFont,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& rsText,
|
2009-09-18 15:39:21 +00:00
|
|
|
const sal_Int8 = css::rendering::TextDirection::WEAK_LEFT_TO_RIGHT);
|
|
|
|
|
2008-05-13 13:28:21 +00:00
|
|
|
static css::geometry::RealSize2D GetTextSize (
|
|
|
|
const css::uno::Reference<css::rendering::XCanvasFont>& rxFont,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& rsText,
|
2009-09-18 15:39:21 +00:00
|
|
|
const sal_Int8 = css::rendering::TextDirection::WEAK_LEFT_TO_RIGHT);
|
2008-05-13 13:28:21 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
const css::rendering::ViewState maDefaultViewState;
|
|
|
|
const css::rendering::RenderState maDefaultRenderState;
|
2008-07-11 12:39:48 +00:00
|
|
|
|
|
|
|
static void PaintTiledBitmap (
|
|
|
|
const css::uno::Reference<css::rendering::XBitmap>& rxTexture,
|
|
|
|
const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
|
|
|
|
const css::awt::Rectangle& rRepaintBox,
|
|
|
|
const css::uno::Reference<css::rendering::XPolyPolygon2D>& rxPolygon,
|
|
|
|
const css::awt::Rectangle& rHole,
|
|
|
|
const css::rendering::ViewState& rDefaultViewState,
|
|
|
|
const css::rendering::RenderState& rDefaultRenderState);
|
|
|
|
|
|
|
|
static void PaintBitmap (
|
|
|
|
const css::uno::Reference<css::rendering::XBitmap>& rxBitmap,
|
|
|
|
const css::awt::Point& rLocation,
|
|
|
|
const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
|
|
|
|
const css::awt::Rectangle& rRepaintBox,
|
|
|
|
const css::uno::Reference<css::rendering::XPolyPolygon2D>& rxPolygon,
|
|
|
|
const css::rendering::ViewState& rDefaultViewState,
|
|
|
|
const css::rendering::RenderState& rDefaultRenderState);
|
|
|
|
|
|
|
|
static void PaintColor (
|
|
|
|
const css::util::Color nColor,
|
|
|
|
const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
|
|
|
|
const css::awt::Rectangle& rRepaintBox,
|
|
|
|
const css::uno::Reference<css::rendering::XPolyPolygon2D>& rxPolygon,
|
|
|
|
const css::rendering::ViewState& rDefaultViewState,
|
|
|
|
const css::rendering::RenderState& rDefaultRenderState);
|
2008-05-13 13:28:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} }
|
|
|
|
|
|
|
|
#endif
|
2010-10-27 12:45:53 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|