1d1766043SAndrew Rist/************************************************************** 2d1766043SAndrew Rist * 3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5d1766043SAndrew Rist * distributed with this work for additional information 6d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10d1766043SAndrew Rist * 11d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12d1766043SAndrew Rist * 13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14d1766043SAndrew Rist * software distributed under the License is distributed on an 15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17d1766043SAndrew Rist * specific language governing permissions and limitations 18d1766043SAndrew Rist * under the License. 19d1766043SAndrew Rist * 20d1766043SAndrew Rist *************************************************************/ 21d1766043SAndrew Rist 22d1766043SAndrew Rist 23cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XCanvas_idl__ 24cdf0e10cSrcweir#define __com_sun_star_rendering_XCanvas_idl__ 25cdf0e10cSrcweir 26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__ 27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 28cdf0e10cSrcweir#endif 29cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 30cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 31cdf0e10cSrcweir#endif 32cdf0e10cSrcweir#ifndef __com_sun_star_geometry_RealPoint2D_idl__ 33cdf0e10cSrcweir#include <com/sun/star/geometry/RealPoint2D.idl> 34cdf0e10cSrcweir#endif 35cdf0e10cSrcweir#ifndef __com_sun_star_geometry_RealBezierSegment2D_idl__ 36cdf0e10cSrcweir#include <com/sun/star/geometry/RealBezierSegment2D.idl> 37cdf0e10cSrcweir#endif 38cdf0e10cSrcweir#ifndef __com_sun_star_geometry_RealRectangle2D_idl__ 39cdf0e10cSrcweir#include <com/sun/star/geometry/RealRectangle2D.idl> 40cdf0e10cSrcweir#endif 41cdf0e10cSrcweir#ifndef __com_sun_star_geometry_Matrix2D_idl__ 42cdf0e10cSrcweir#include <com/sun/star/geometry/Matrix2D.idl> 43cdf0e10cSrcweir#endif 44cdf0e10cSrcweir#ifndef __com_sun_star_rendering_ViewState_idl__ 45cdf0e10cSrcweir#include <com/sun/star/rendering/ViewState.idl> 46cdf0e10cSrcweir#endif 47cdf0e10cSrcweir#ifndef __com_sun_star_rendering_RenderState_idl__ 48cdf0e10cSrcweir#include <com/sun/star/rendering/RenderState.idl> 49cdf0e10cSrcweir#endif 50cdf0e10cSrcweir#ifndef __com_sun_star_rendering_FontRequest_idl__ 51cdf0e10cSrcweir#include <com/sun/star/rendering/FontRequest.idl> 52cdf0e10cSrcweir#endif 53cdf0e10cSrcweir#ifndef __com_sun_star_rendering_FontInfo_idl__ 54cdf0e10cSrcweir#include <com/sun/star/rendering/FontInfo.idl> 55cdf0e10cSrcweir#endif 56cdf0e10cSrcweir#ifndef __com_sun_star_rendering_Texture_idl__ 57cdf0e10cSrcweir#include <com/sun/star/rendering/Texture.idl> 58cdf0e10cSrcweir#endif 59cdf0e10cSrcweir#ifndef __com_sun_star_rendering_StringContext_idl__ 60cdf0e10cSrcweir#include <com/sun/star/rendering/StringContext.idl> 61cdf0e10cSrcweir#endif 62cdf0e10cSrcweir#ifndef __com_sun_star_rendering_StrokeAttributes_idl__ 63cdf0e10cSrcweir#include <com/sun/star/rendering/StrokeAttributes.idl> 64cdf0e10cSrcweir#endif 65cdf0e10cSrcweir#ifndef __com_sun_star_rendering_VolatileContentDestroyedException_idl__ 66cdf0e10cSrcweir#include <com/sun/star/rendering/VolatileContentDestroyedException.idl> 67cdf0e10cSrcweir#endif 68cdf0e10cSrcweir 69cdf0e10cSrcweir#ifndef __com_sun_star_beans_PropertyValue_idl__ 70cdf0e10cSrcweir#include <com/sun/star/beans/PropertyValue.idl> 71cdf0e10cSrcweir#endif 72cdf0e10cSrcweir 73cdf0e10cSrcweir 74cdf0e10cSrcweirmodule com { module sun { module star { module geometry { 75cdf0e10cSrcweir published interface XMapping2D; 76cdf0e10cSrcweir}; }; }; }; 77cdf0e10cSrcweir 78cdf0e10cSrcweirmodule com { module sun { module star { module rendering { 79cdf0e10cSrcweir 80cdf0e10cSrcweirpublished interface XCanvasFont; 81cdf0e10cSrcweirpublished interface XPolyPolygon2D; 82cdf0e10cSrcweirpublished interface XCachedPrimitive; 83cdf0e10cSrcweirpublished interface XBitmap; 84cdf0e10cSrcweirpublished interface XGraphicDevice; 85cdf0e10cSrcweirpublished interface XTextLayout; 86cdf0e10cSrcweir 87cdf0e10cSrcweir/** Central interface for rendering.<p> 88cdf0e10cSrcweir 89cdf0e10cSrcweir This is the central interface for graphical output production, and 90cdf0e10cSrcweir the place where all draw methods are located.<p> 91cdf0e10cSrcweir 92cdf0e10cSrcweir Some notes are in order to explain the concepts used here. The 93cdf0e10cSrcweir <type>XCanvas</type> interface is free of client-modifiable state, 94cdf0e10cSrcweir i.e. it can be used safely and without external synchronization in 95cdf0e10cSrcweir a multi-threaded environment. On the other hand, this implies that 96cdf0e10cSrcweir for nearly every canvas operation, external state is 97cdf0e10cSrcweir required. This is provided by <type>ViewState</type> and 98cdf0e10cSrcweir <type>RenderState</type> in a unified fashion, supplemented by a 99cdf0e10cSrcweir few extra state parameters for some methods (e.g. textured 100cdf0e10cSrcweir polygons or text rendering).<p> 101cdf0e10cSrcweir 102cdf0e10cSrcweir When used careless, this scheme can be inefficient to some extend, 103cdf0e10cSrcweir because internally, view, render and other states have to be 104cdf0e10cSrcweir combined before rendering. This is especially expensive for 105cdf0e10cSrcweir complex clip polygons, i.e. when both <type>ViewState</type> and 106cdf0e10cSrcweir <type>RenderState</type> have a complex clip polygon set, which 107cdf0e10cSrcweir have to be intersected before rendering. It is therefore 108cdf0e10cSrcweir recommended to combine <type>ViewState</type> and 109cdf0e10cSrcweir <type>RenderState</type> already at the client side, when objects 110cdf0e10cSrcweir are organized in a hierarchical way: the classic example are 111cdf0e10cSrcweir grouped draw shapes, whose parent group object imposes a 112cdf0e10cSrcweir common clipping and a common transformation on its siblings. The 113cdf0e10cSrcweir group object would therefore merge the <type>ViewState</type> and 114cdf0e10cSrcweir the <type>RenderState</type> it is called with into a new 115cdf0e10cSrcweir <type>ViewState</type>, and call its siblings with a 116cdf0e10cSrcweir <type>RenderState</type> containing only the local offset (and no 117cdf0e10cSrcweir extra clipping).<p> 118cdf0e10cSrcweir 119cdf0e10cSrcweir Furtheron, this stateless nature provides easy ways for 120cdf0e10cSrcweir caching. Every non-trivial operation on <type>XCanvas</type> can 121cdf0e10cSrcweir return a cache object, which, when called to redraw, renders the 122cdf0e10cSrcweir primitive usually much more quickly than the original method. Note 123cdf0e10cSrcweir that such caching is a lot more complicated, should the actual 124cdf0e10cSrcweir rendering a method yields depend on internal state (which is the 125cdf0e10cSrcweir case e.g. for the 126cdf0e10cSrcweir <type 127cdf0e10cSrcweir scope="::com::sun::star::drawing">::com::sun::star::drawing::XGraphics</type> 128cdf0e10cSrcweir interface). Please note, though, that deciding whether to return 129cdf0e10cSrcweir an <type>XCachedPrimitive</type> is completely up to the 130cdf0e10cSrcweir implementation - don't rely on the methods returning something 131cdf0e10cSrcweir (this is because there might be cases when returning such a cache 132cdf0e10cSrcweir object will actually be a pessimization, since it involves memory 133cdf0e10cSrcweir allocation and comparisons).<p> 134cdf0e10cSrcweir 135cdf0e10cSrcweir Things that need more than a small, fixed amount of data are 136cdf0e10cSrcweir encapsulated in own interfaces, e.g. polygons and bitmaps. You 137cdf0e10cSrcweir can, in principle, roll your own implementations of these 138cdf0e10cSrcweir interfaces, wrap it around your internal representation of 139cdf0e10cSrcweir polygons and bitmaps, and render them. It might just not be overly 140cdf0e10cSrcweir fast, because the <type>XCanvas</type> would need to convert for 141cdf0e10cSrcweir each render call. It is therefore recommended to create such 142cdf0e10cSrcweir objects via the <type>XGraphicDevice</type> factory (to be 143cdf0e10cSrcweir retrieved from every canvas object via the 144cdf0e10cSrcweir <member>getDevice()</member> call) - they will then internally 145cdf0e10cSrcweir optimize to the underlying graphics subsystem.<p> 146cdf0e10cSrcweir 147*d695a2a0SJürgen Schmidt @since OpenOffice 2.0 148cdf0e10cSrcweir */ 149cdf0e10cSrcweirpublished interface XCanvas : ::com::sun::star::uno::XInterface 150cdf0e10cSrcweir{ 151cdf0e10cSrcweir /** Clear the whole canvas area.<p> 152cdf0e10cSrcweir 153cdf0e10cSrcweir This method clears the whole canvas area to the device default 154cdf0e10cSrcweir color (e.g. white for a printer, transparent for an 155cdf0e10cSrcweir <type>XCustomSprite</type>). 156cdf0e10cSrcweir */ 157cdf0e10cSrcweir void clear(); 158cdf0e10cSrcweir 159cdf0e10cSrcweir /** Draw a point in device resolution on the device. 160cdf0e10cSrcweir 161cdf0e10cSrcweir @param aPoint 162cdf0e10cSrcweir The point to draw. 163cdf0e10cSrcweir 164cdf0e10cSrcweir @param aViewState 165cdf0e10cSrcweir The viewstate to be used when drawing this point. 166cdf0e10cSrcweir 167cdf0e10cSrcweir @param aRenderState 168cdf0e10cSrcweir The renderstate to be used when drawing this point. 169cdf0e10cSrcweir 170cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 171cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 172cdf0e10cSrcweir specified range. 173cdf0e10cSrcweir */ 174cdf0e10cSrcweir void drawPoint( [in] ::com::sun::star::geometry::RealPoint2D aPoint, [in] ViewState aViewState, [in] RenderState aRenderState ) 175cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 176cdf0e10cSrcweir 177cdf0e10cSrcweir //------------------------------------------------------------------------- 178cdf0e10cSrcweir 179cdf0e10cSrcweir /** Draw a line in device resolution width (i.e. one device pixel 180cdf0e10cSrcweir wide). 181cdf0e10cSrcweir 182cdf0e10cSrcweir @param aStartPoint 183cdf0e10cSrcweir The start point of the line to draw. 184cdf0e10cSrcweir 185cdf0e10cSrcweir @param aEndPoint 186cdf0e10cSrcweir The end point of the line to draw. 187cdf0e10cSrcweir 188cdf0e10cSrcweir @param aViewState 189cdf0e10cSrcweir The viewstate to be used when drawing this line. 190cdf0e10cSrcweir 191cdf0e10cSrcweir @param aRenderState 192cdf0e10cSrcweir The renderstate to be used when drawing this line. 193cdf0e10cSrcweir 194cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 195cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 196cdf0e10cSrcweir specified range. 197cdf0e10cSrcweir */ 198cdf0e10cSrcweir void drawLine( [in] ::com::sun::star::geometry::RealPoint2D aStartPoint, [in] ::com::sun::star::geometry::RealPoint2D aEndPoint, [in] ViewState aViewState, [in] RenderState aRenderState ) 199cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 200cdf0e10cSrcweir 201cdf0e10cSrcweir //------------------------------------------------------------------------- 202cdf0e10cSrcweir 203cdf0e10cSrcweir /** Draw a cubic bezier curve in device resolution width (i.e. one 204cdf0e10cSrcweir device pixel wide). 205cdf0e10cSrcweir 206cdf0e10cSrcweir @param aBezierSegment 207cdf0e10cSrcweir The start and the two control points of the bezier curve. 208cdf0e10cSrcweir 209cdf0e10cSrcweir @param aEndPoint 210cdf0e10cSrcweir The end point of the bezier curve. 211cdf0e10cSrcweir 212cdf0e10cSrcweir @param aViewState 213cdf0e10cSrcweir The viewstate to be used when drawing this curve. 214cdf0e10cSrcweir 215cdf0e10cSrcweir @param aRenderState 216cdf0e10cSrcweir The renderstate to be used when drawing this curve. 217cdf0e10cSrcweir 218cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 219cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 220cdf0e10cSrcweir specified range. 221cdf0e10cSrcweir */ 222cdf0e10cSrcweir void drawBezier( [in] ::com::sun::star::geometry::RealBezierSegment2D aBezierSegment, [in] ::com::sun::star::geometry::RealPoint2D aEndPoint, [in] ViewState aViewState, [in] RenderState aRenderState ) 223cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 224cdf0e10cSrcweir 225cdf0e10cSrcweir //------------------------------------------------------------------------- 226cdf0e10cSrcweir 227cdf0e10cSrcweir /** Draw a poly-polygon in device resolution line width (i.e. the 228cdf0e10cSrcweir lines are one device pixel wide). 229cdf0e10cSrcweir 230cdf0e10cSrcweir @param xPolyPolygon 231cdf0e10cSrcweir The poly-polygon to draw. 232cdf0e10cSrcweir 233cdf0e10cSrcweir @param aViewState 234cdf0e10cSrcweir The viewstate to be used when drawing this polygon. 235cdf0e10cSrcweir 236cdf0e10cSrcweir @param aRenderState 237cdf0e10cSrcweir The renderstate to be used when drawing this polygon. 238cdf0e10cSrcweir 239cdf0e10cSrcweir @return a handle to the cached rendering output. 240cdf0e10cSrcweir 241cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 242cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 243cdf0e10cSrcweir specified range. 244cdf0e10cSrcweir */ 245cdf0e10cSrcweir XCachedPrimitive drawPolyPolygon( [in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState ) 246cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 247cdf0e10cSrcweir 248cdf0e10cSrcweir //------------------------------------------------------------------------- 249cdf0e10cSrcweir 250cdf0e10cSrcweir /** Stroke each polygon of the provided poly-polygon with the 251cdf0e10cSrcweir specified stroke attributes.<p> 252cdf0e10cSrcweir 253cdf0e10cSrcweir This method considers the stroking of all polygons as an 254cdf0e10cSrcweir atomic operation in relation to the <type>RenderState</type>'s 255cdf0e10cSrcweir <type>CompositeOperationy</type> operation. That means, 256cdf0e10cSrcweir overlapping strokes from distinct polygons will look exactly 257cdf0e10cSrcweir as overlapping segments of the same polygon, even with 258cdf0e10cSrcweir transparency.<p> 259cdf0e10cSrcweir 260cdf0e10cSrcweir @param xPolyPolygon 261cdf0e10cSrcweir The poly-polygon to render. 262cdf0e10cSrcweir 263cdf0e10cSrcweir @param aViewState 264cdf0e10cSrcweir The viewstate to be used when stroking this polygon. 265cdf0e10cSrcweir 266cdf0e10cSrcweir @param aRenderState 267cdf0e10cSrcweir The renderstate to be used when stroking this polygon. 268cdf0e10cSrcweir 269cdf0e10cSrcweir @param aStrokeAttributes 270cdf0e10cSrcweir Further attributes used to parameterize the stroking. 271cdf0e10cSrcweir 272cdf0e10cSrcweir @return a handle to the cached rendering output. 273cdf0e10cSrcweir 274cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 275cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 276cdf0e10cSrcweir specified range. 277cdf0e10cSrcweir */ 278cdf0e10cSrcweir XCachedPrimitive strokePolyPolygon( [in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState, [in] StrokeAttributes aStrokeAttributes ) 279cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 280cdf0e10cSrcweir 281cdf0e10cSrcweir //------------------------------------------------------------------------- 282cdf0e10cSrcweir 283cdf0e10cSrcweir /** Stroke each polygon of the provided poly-polygon with the 284cdf0e10cSrcweir specified stroke attributes, fill the stroked outline 285cdf0e10cSrcweir with the specified texture graphics.<p> 286cdf0e10cSrcweir 287cdf0e10cSrcweir This method considers the stroking of all polygons as an 288cdf0e10cSrcweir atomic operation in relation to the <type>RenderState</type>'s 289cdf0e10cSrcweir <type>CompositeOp</type> operation. That means, overlapping 290cdf0e10cSrcweir strokes from distinct polygons will look exactly as 291cdf0e10cSrcweir overlapping segments of the same polygon, even with 292cdf0e10cSrcweir transparency.<p> 293cdf0e10cSrcweir 294cdf0e10cSrcweir @param xPolyPolygon 295cdf0e10cSrcweir The poly-polygon to render. 296cdf0e10cSrcweir 297cdf0e10cSrcweir @param aViewState 298cdf0e10cSrcweir The viewstate to be used when strokes this polygon. 299cdf0e10cSrcweir 300cdf0e10cSrcweir @param aRenderState 301cdf0e10cSrcweir The renderstate to be used when stroking this polygon. 302cdf0e10cSrcweir 303cdf0e10cSrcweir @param aTextures 304cdf0e10cSrcweir A sequence of texture definitions, with which to fill the 305cdf0e10cSrcweir stroked area. 306cdf0e10cSrcweir 307cdf0e10cSrcweir @param aStrokeAttributes 308cdf0e10cSrcweir Further attributes used to parameterize the stroking. 309cdf0e10cSrcweir 310cdf0e10cSrcweir @return a handle to the cached rendering output. 311cdf0e10cSrcweir 312cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 313cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 314cdf0e10cSrcweir specified range. 315cdf0e10cSrcweir 316cdf0e10cSrcweir @throws <type>VolatileContentDestroyedException</type> 317cdf0e10cSrcweir if a texture bitmap was volatile, and the content was 318cdf0e10cSrcweir destroyed before the rendering could take place. 319cdf0e10cSrcweir */ 320cdf0e10cSrcweir XCachedPrimitive strokeTexturedPolyPolygon( [in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState, [in] sequence<Texture> aTextures, [in] StrokeAttributes aStrokeAttributes ) 321cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException, 322cdf0e10cSrcweir VolatileContentDestroyedException); 323cdf0e10cSrcweir 324cdf0e10cSrcweir //------------------------------------------------------------------------- 325cdf0e10cSrcweir 326cdf0e10cSrcweir /** Stroke each polygon of the provided poly-polygon with the 327cdf0e10cSrcweir specified stroke attributes, fill the stroked outline 328cdf0e10cSrcweir with the specified texture graphics, map the texture to the 329cdf0e10cSrcweir outline via the specified texture mapping.<p> 330cdf0e10cSrcweir 331cdf0e10cSrcweir This method considers the stroking of all polygons as an 332cdf0e10cSrcweir atomic operation in relation to the <type>RenderState</type>'s 333cdf0e10cSrcweir <type>CompositeOp</type> operation. That means, overlapping 334cdf0e10cSrcweir strokes from distinct polygons will look exactly as 335cdf0e10cSrcweir overlapping segments of the same polygon, even with 336cdf0e10cSrcweir transparency. 337cdf0e10cSrcweir 338cdf0e10cSrcweir @param xPolyPolygon 339cdf0e10cSrcweir The poly-polygon to render. 340cdf0e10cSrcweir 341cdf0e10cSrcweir @param aViewState 342cdf0e10cSrcweir The viewstate to be used when stroking this polygon. 343cdf0e10cSrcweir 344cdf0e10cSrcweir @param aRenderState 345cdf0e10cSrcweir The renderstate to be used when stroking this polygon. 346cdf0e10cSrcweir 347cdf0e10cSrcweir @param aTextures 348cdf0e10cSrcweir A sequence of texture definitions, with which to fill the 349cdf0e10cSrcweir stroked area. 350cdf0e10cSrcweir 351cdf0e10cSrcweir @param xMapping 352cdf0e10cSrcweir A bilinear mapping function which defines the warping of the 353cdf0e10cSrcweir textures on the output area. 354cdf0e10cSrcweir 355cdf0e10cSrcweir @param aStrokeAttributes 356cdf0e10cSrcweir Further attributes used to parameterize the stroking. 357cdf0e10cSrcweir 358cdf0e10cSrcweir @return a handle to the cached rendering output. 359cdf0e10cSrcweir 360cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 361cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 362cdf0e10cSrcweir specified range. 363cdf0e10cSrcweir 364cdf0e10cSrcweir @throws <type>VolatileContentDestroyedException</type> 365cdf0e10cSrcweir if a texture bitmap was volatile, and the content was 366cdf0e10cSrcweir destroyed before the rendering could take place. 367cdf0e10cSrcweir */ 368cdf0e10cSrcweir XCachedPrimitive strokeTextureMappedPolyPolygon( [in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState, [in] sequence<Texture> aTextures, [in] ::com::sun::star::geometry::XMapping2D xMapping, [in] StrokeAttributes aStrokeAttributes ) 369cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException, 370cdf0e10cSrcweir VolatileContentDestroyedException); 371cdf0e10cSrcweir 372cdf0e10cSrcweir //------------------------------------------------------------------------- 373cdf0e10cSrcweir 374cdf0e10cSrcweir // [TODO: Method misplaced at this interface?] 375cdf0e10cSrcweir 376cdf0e10cSrcweir /** Query the polygonal representation of the stroke outlines, as 377cdf0e10cSrcweir it would be generated by the strokePolyPolygon methods.<p> 378cdf0e10cSrcweir 379cdf0e10cSrcweir This method can be used to e.g. set a clipping which covers the same 380cdf0e10cSrcweir area as a stroke.<p> 381cdf0e10cSrcweir 382cdf0e10cSrcweir @param xPolyPolygon 383cdf0e10cSrcweir The poly-polygon to render. 384cdf0e10cSrcweir 385cdf0e10cSrcweir @param aViewState 386cdf0e10cSrcweir The viewstate to be used when generating the outline. 387cdf0e10cSrcweir 388cdf0e10cSrcweir @param aRenderState 389cdf0e10cSrcweir The renderstate to be used when generating the outline. 390cdf0e10cSrcweir 391cdf0e10cSrcweir @param aStrokeAttributes 392cdf0e10cSrcweir Further attributes used to parameterize the stroking. 393cdf0e10cSrcweir 394cdf0e10cSrcweir @return a poly-polygon describing the outline of the stroked 395cdf0e10cSrcweir area. 396cdf0e10cSrcweir 397cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 398cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 399cdf0e10cSrcweir specified range. 400cdf0e10cSrcweir */ 401cdf0e10cSrcweir XPolyPolygon2D queryStrokeShapes( [in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState, [in] StrokeAttributes aStrokeAttributes ) 402cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 403cdf0e10cSrcweir 404cdf0e10cSrcweir //------------------------------------------------------------------------- 405cdf0e10cSrcweir 406cdf0e10cSrcweir /** Fill the given poly-polygon.<p> 407cdf0e10cSrcweir 408cdf0e10cSrcweir This method fills the given poly-polygon according to the 409cdf0e10cSrcweir <type>RenderState</type>'s color and the poly-polygon's fill 410cdf0e10cSrcweir rule.<p> 411cdf0e10cSrcweir 412cdf0e10cSrcweir @param xPolyPolygon 413cdf0e10cSrcweir The poly-polygon to render. 414cdf0e10cSrcweir 415cdf0e10cSrcweir @param aViewState 416cdf0e10cSrcweir The viewstate to be used when filling this polygon. 417cdf0e10cSrcweir 418cdf0e10cSrcweir @param aRenderState 419cdf0e10cSrcweir The renderstate to be used when filling this polygon. 420cdf0e10cSrcweir 421cdf0e10cSrcweir @return a handle to the cached rendering output. 422cdf0e10cSrcweir 423cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 424cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 425cdf0e10cSrcweir specified range. 426cdf0e10cSrcweir */ 427cdf0e10cSrcweir XCachedPrimitive fillPolyPolygon( [in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState ) 428cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 429cdf0e10cSrcweir 430cdf0e10cSrcweir //------------------------------------------------------------------------- 431cdf0e10cSrcweir 432cdf0e10cSrcweir /** Fill the given poly-polygon with a texture.<p> 433cdf0e10cSrcweir 434cdf0e10cSrcweir This method fills the given poly-polygon according to the 435cdf0e10cSrcweir <type>RenderState</type>'s color, the given textures and 436cdf0e10cSrcweir poly-polygon's fill rule.<p> 437cdf0e10cSrcweir 438cdf0e10cSrcweir @param xPolyPolygon 439cdf0e10cSrcweir The poly-polygon to render. 440cdf0e10cSrcweir 441cdf0e10cSrcweir @param aViewState 442cdf0e10cSrcweir The viewstate to be used when filling this polygon. 443cdf0e10cSrcweir 444cdf0e10cSrcweir @param aRenderState 445cdf0e10cSrcweir The renderstate to be used when filling this polygon. 446cdf0e10cSrcweir 447cdf0e10cSrcweir @param aTextures 448cdf0e10cSrcweir A sequence of texture definitions, with which to fill the 449cdf0e10cSrcweir polygonal area. 450cdf0e10cSrcweir 451cdf0e10cSrcweir @return a handle to the cached rendering output. 452cdf0e10cSrcweir 453cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 454cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 455cdf0e10cSrcweir specified range. 456cdf0e10cSrcweir 457cdf0e10cSrcweir @throws <type>VolatileContentDestroyedException</type> 458cdf0e10cSrcweir if a texture bitmap was volatile, and the content was 459cdf0e10cSrcweir destroyed before the rendering could take place. 460cdf0e10cSrcweir */ 461cdf0e10cSrcweir XCachedPrimitive fillTexturedPolyPolygon( [in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState, [in] sequence<Texture> xTextures ) 462cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException, 463cdf0e10cSrcweir VolatileContentDestroyedException); 464cdf0e10cSrcweir 465cdf0e10cSrcweir //------------------------------------------------------------------------- 466cdf0e10cSrcweir 467cdf0e10cSrcweir /** Fill the given poly-polygon with a mapped texture.<p> 468cdf0e10cSrcweir 469cdf0e10cSrcweir This method fills the given poly-polygon according to the 470cdf0e10cSrcweir <type>RenderState</type>'s color, the given textures and 471cdf0e10cSrcweir poly-polygon's fill rule. The texture is mapped to the 472cdf0e10cSrcweir poly-polygon's interior via the given texture mapping.<p> 473cdf0e10cSrcweir 474cdf0e10cSrcweir @param xPolyPolygon 475cdf0e10cSrcweir The poly-polygon to render. 476cdf0e10cSrcweir 477cdf0e10cSrcweir @param aViewState 478cdf0e10cSrcweir The viewstate to be used when filling this polygon. 479cdf0e10cSrcweir 480cdf0e10cSrcweir @param aRenderState 481cdf0e10cSrcweir The renderstate to be used when filling this polygon. 482cdf0e10cSrcweir 483cdf0e10cSrcweir @param aTextures 484cdf0e10cSrcweir A sequence of texture definitions, with which to fill the 485cdf0e10cSrcweir polygonal area. 486cdf0e10cSrcweir 487cdf0e10cSrcweir @param xMapping 488cdf0e10cSrcweir A bilinear mapping function which defines the warping of the 489cdf0e10cSrcweir textures on the output area. 490cdf0e10cSrcweir 491cdf0e10cSrcweir @return a handle to the cached rendering output. 492cdf0e10cSrcweir 493cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 494cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 495cdf0e10cSrcweir specified range. 496cdf0e10cSrcweir 497cdf0e10cSrcweir @throws <type>VolatileContentDestroyedException</type> 498cdf0e10cSrcweir if a texture bitmap was volatile, and the content was 499cdf0e10cSrcweir destroyed before the rendering could take place. 500cdf0e10cSrcweir */ 501cdf0e10cSrcweir XCachedPrimitive fillTextureMappedPolyPolygon( [in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState, [in] sequence<Texture> xTextures, [in] ::com::sun::star::geometry::XMapping2D xMapping ) 502cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException, 503cdf0e10cSrcweir VolatileContentDestroyedException); 504cdf0e10cSrcweir 505cdf0e10cSrcweir //------------------------------------------------------------------------- 506cdf0e10cSrcweir 507cdf0e10cSrcweir /** Create a suitable font for the specified font description. 508cdf0e10cSrcweir 509cdf0e10cSrcweir @param aFontRequest 510cdf0e10cSrcweir 511cdf0e10cSrcweir @param aExtraFontProperties 512cdf0e10cSrcweir Additional font properties to be applied when selecting this 513cdf0e10cSrcweir font. Normally, you should not need this parameter. Currently, 514cdf0e10cSrcweir the following properties are recognized: 515cdf0e10cSrcweir <ul> 516cdf0e10cSrcweir 517cdf0e10cSrcweir <il>Kerning: a <type>double</type> between 0 and 1, where 518cdf0e10cSrcweir 0 completely disables kerning. Whether kerning is on or 519cdf0e10cSrcweir off by default is font-dependent.</il> 520cdf0e10cSrcweir 521cdf0e10cSrcweir <il>IsEmphasisMarks: a <type>boolean</type>, where <TRUE/> 522cdf0e10cSrcweir enables automatic placements of emphasis marks, e.g. for 523cdf0e10cSrcweir Hebrew. The default value, if this property is not 524cdf0e10cSrcweir specified, is <FALSE/>.</il> 525cdf0e10cSrcweir 526cdf0e10cSrcweir <il>ExpandedSpacing: a <type>double</type> value which is added 527cdf0e10cSrcweir between all cell distances for this font. The default value for 528cdf0e10cSrcweir this property is zero. Use negative values for condensed output, 529cdf0e10cSrcweir and positive values for expanded output.</il> 530cdf0e10cSrcweir 531cdf0e10cSrcweir <il>OptionalLayoutFeatures: a sequence of <type 532cdf0e10cSrcweir scope=::com::sun::star::beans>PropertyValue</type> listing 533cdf0e10cSrcweir font-specific optional layout features, like glyph 534cdf0e10cSrcweir variants.</il> 535cdf0e10cSrcweir 536cdf0e10cSrcweir </ul> 537cdf0e10cSrcweir 538cdf0e10cSrcweir @param aFontMatrix 539cdf0e10cSrcweir Font-specific transformation matrix, which affects both the 540cdf0e10cSrcweir glyphs as well as the advancement. 541cdf0e10cSrcweir 542cdf0e10cSrcweir @returns the requested font, or an invalid reference, if the 543cdf0e10cSrcweir request failed. 544cdf0e10cSrcweir 545cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 546cdf0e10cSrcweir if one of the parameters is not within the allowed range. 547cdf0e10cSrcweir */ 548cdf0e10cSrcweir XCanvasFont createFont( [in] FontRequest aFontRequest, [in] sequence< ::com::sun::star::beans::PropertyValue > aExtraFontProperties, [in] ::com::sun::star::geometry::Matrix2D aFontMatrix ) 549cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 550cdf0e10cSrcweir 551cdf0e10cSrcweir //------------------------------------------------------------------------- 552cdf0e10cSrcweir 553cdf0e10cSrcweir /** Query font information, specific to this canvas.<p> 554cdf0e10cSrcweir 555cdf0e10cSrcweir @param aFilter 556cdf0e10cSrcweir Filter parameter to reduce the list of returned fonts. Every 557cdf0e10cSrcweir member of <type>FontInfo</type> that is not the empty string 558cdf0e10cSrcweir or the "don't care" value restricts the list of returned fonts 559cdf0e10cSrcweir to contain only those that have the specified attribute. 560cdf0e10cSrcweir 561cdf0e10cSrcweir @param xFontProperties 562cdf0e10cSrcweir This interface can provide additional font properties to 563cdf0e10cSrcweir filter the list of available fonts against. 564cdf0e10cSrcweir 565cdf0e10cSrcweir @returns the list of fonts matching the filter set. 566cdf0e10cSrcweir 567cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 568cdf0e10cSrcweir if one of the font properties are invalid or not recognized, 569cdf0e10cSrcweir or if one of the <type>FontInfo</type> members is not within 570cdf0e10cSrcweir the permitted range. 571cdf0e10cSrcweir */ 572cdf0e10cSrcweir sequence< FontInfo > queryAvailableFonts( [in] FontInfo aFilter, [in] sequence< ::com::sun::star::beans::PropertyValue > aFontProperties ) 573cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 574cdf0e10cSrcweir 575cdf0e10cSrcweir //------------------------------------------------------------------------- 576cdf0e10cSrcweir 577cdf0e10cSrcweir /** Draw the text given by the substring of the specified string 578cdf0e10cSrcweir with the given font.<p> 579cdf0e10cSrcweir 580cdf0e10cSrcweir The local origin of this output operation is either the left 581cdf0e10cSrcweir end of the text baseline, for textDirection equal 582cdf0e10cSrcweir LEFT_TO_RIGHT, or the right end of the baseline, for 583cdf0e10cSrcweir textDirection equal to RIGHT_TO_LEFT, respectively.<p> 584cdf0e10cSrcweir 585cdf0e10cSrcweir @param aText 586cdf0e10cSrcweir The text to output. 587cdf0e10cSrcweir 588cdf0e10cSrcweir @param xFont 589cdf0e10cSrcweir The font retrieved from this canvas to be used when drawing 590cdf0e10cSrcweir the text. 591cdf0e10cSrcweir 592cdf0e10cSrcweir @param aViewState 593cdf0e10cSrcweir The viewstate to be used when drawing this text. 594cdf0e10cSrcweir 595cdf0e10cSrcweir @param aRenderState 596cdf0e10cSrcweir The renderstate to be used when drawing this text. 597cdf0e10cSrcweir 598cdf0e10cSrcweir @param nTextDirection 599cdf0e10cSrcweir A value from the <type>TextDirection</type> collection, 600cdf0e10cSrcweir denoting the main writing direction for this string. The main 601cdf0e10cSrcweir writing direction determines the origin of the text output, 602cdf0e10cSrcweir i.e. the left edge for left-to-right and the right edge for 603cdf0e10cSrcweir right-to-left text. 604cdf0e10cSrcweir 605cdf0e10cSrcweir @return a handle to the cached rendering output. 606cdf0e10cSrcweir 607cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 608cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 609cdf0e10cSrcweir specified range. 610cdf0e10cSrcweir */ 611cdf0e10cSrcweir XCachedPrimitive drawText( [in] StringContext aText, [in] XCanvasFont xFont, [in] ViewState aViewState, [in] RenderState aRenderState, [in] byte nTextDirection ) 612cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 613cdf0e10cSrcweir 614cdf0e10cSrcweir //------------------------------------------------------------------------- 615cdf0e10cSrcweir 616cdf0e10cSrcweir /** Draw the formatted text given by the text layout.<p> 617cdf0e10cSrcweir 618cdf0e10cSrcweir The glyphs as represented by the text layout are always output 619cdf0e10cSrcweir with the reference position being the leftmost edge of the 620cdf0e10cSrcweir layout object's baseline. If the layout contains more than one 621cdf0e10cSrcweir baseline, the baseline of the first strong character in 622cdf0e10cSrcweir logical order is used here (strong in this context means that 623cdf0e10cSrcweir the character can be unambiguously assigned to a unicode 624cdf0e10cSrcweir script).<p> 625cdf0e10cSrcweir 626cdf0e10cSrcweir @param xLayoutetText 627cdf0e10cSrcweir An interface to the readily layouted text, obtained from a 628cdf0e10cSrcweir <type>XCanvasFont</type> created at this canvas. The text 629cdf0e10cSrcweir layout already carries intrinsic font information. 630cdf0e10cSrcweir 631cdf0e10cSrcweir @param aViewState 632cdf0e10cSrcweir The viewstate to be used when drawing this text. 633cdf0e10cSrcweir 634cdf0e10cSrcweir @param aRenderState 635cdf0e10cSrcweir The renderstate to be used when drawing this text. 636cdf0e10cSrcweir 637cdf0e10cSrcweir @return a handle to the cached rendering output. 638cdf0e10cSrcweir 639cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 640cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 641cdf0e10cSrcweir specified range. 642cdf0e10cSrcweir */ 643cdf0e10cSrcweir XCachedPrimitive drawTextLayout( [in] XTextLayout xLayoutetText, [in] ViewState aViewState, [in] RenderState aRenderState ) 644cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 645cdf0e10cSrcweir 646cdf0e10cSrcweir //------------------------------------------------------------------------- 647cdf0e10cSrcweir 648cdf0e10cSrcweir /** Render the given bitmap.<p> 649cdf0e10cSrcweir 650cdf0e10cSrcweir This method renders the bitmap, at a position and shape as 651cdf0e10cSrcweir specified by the combined view and render transformations. For 652cdf0e10cSrcweir fast render speed, the bitmap should be created by the 653cdf0e10cSrcweir corresponding <type>XGraphicDevice</type>'s 654cdf0e10cSrcweir <member>XGraphicDevice::createCompatibleBitmap()</member> 655cdf0e10cSrcweir method.<p> 656cdf0e10cSrcweir 657cdf0e10cSrcweir @param xBitmap 658cdf0e10cSrcweir The bitmap to render. 659cdf0e10cSrcweir 660cdf0e10cSrcweir @param aViewState 661cdf0e10cSrcweir The viewstate to be used when drawing this text. 662cdf0e10cSrcweir 663cdf0e10cSrcweir @param aRenderState 664cdf0e10cSrcweir The renderstate to be used when drawing this text. 665cdf0e10cSrcweir 666cdf0e10cSrcweir @return a handle to the cached rendering output. 667cdf0e10cSrcweir 668cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 669cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 670cdf0e10cSrcweir specified range. 671cdf0e10cSrcweir 672cdf0e10cSrcweir @throws <type>VolatileContentDestroyedException</type> 673cdf0e10cSrcweir if a texture bitmap was volatile, and the content was 674cdf0e10cSrcweir destroyed before the rendering could take place. 675cdf0e10cSrcweir */ 676cdf0e10cSrcweir XCachedPrimitive drawBitmap( [in] XBitmap xBitmap, [in] ViewState aViewState, [in] RenderState aRenderState ) 677cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException, 678cdf0e10cSrcweir VolatileContentDestroyedException); 679cdf0e10cSrcweir 680cdf0e10cSrcweir /** Render the given bitmap, with a global color modulation.<p> 681cdf0e10cSrcweir 682cdf0e10cSrcweir This method renders the bitmap, at a position and shape as 683cdf0e10cSrcweir specified by the combined view and render transformations. For 684cdf0e10cSrcweir fast render speed, the bitmap should be created by the 685cdf0e10cSrcweir corresponding <type>XGraphicDevice</type>'s 686cdf0e10cSrcweir <member>XGraphicDevice::createCompatibleBitmap()</member> 687cdf0e10cSrcweir method. The bitmap's color channel values are multiplied with 688cdf0e10cSrcweir the device color values as specified in the render state.<p> 689cdf0e10cSrcweir 690cdf0e10cSrcweir @param xBitmap 691cdf0e10cSrcweir The bitmap to render. 692cdf0e10cSrcweir 693cdf0e10cSrcweir @param aViewState 694cdf0e10cSrcweir The viewstate to be used when drawing this text. 695cdf0e10cSrcweir 696cdf0e10cSrcweir @param aRenderState 697cdf0e10cSrcweir The renderstate to be used when drawing this text. The device 698cdf0e10cSrcweir color entry in the renderstate is multiplied with every pixel 699cdf0e10cSrcweir color value, and only the result is rendered into the 700cdf0e10cSrcweir canvas. If, for example, the bitmap should be rendered with 701cdf0e10cSrcweir increased global transparency, set all device color channels 702cdf0e10cSrcweir to 1.0, except for the alpha channel, which should be set to 703cdf0e10cSrcweir the desired transparency. 704cdf0e10cSrcweir 705cdf0e10cSrcweir @return a handle to the cached rendering output. 706cdf0e10cSrcweir 707cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 708cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 709cdf0e10cSrcweir specified range. 710cdf0e10cSrcweir 711cdf0e10cSrcweir @throws <type>VolatileContentDestroyedException</type> 712cdf0e10cSrcweir if a texture bitmap was volatile, and the content was 713cdf0e10cSrcweir destroyed before the rendering could take place. 714cdf0e10cSrcweir */ 715cdf0e10cSrcweir XCachedPrimitive drawBitmapModulated( [in] XBitmap xBitmap, [in] ViewState aViewState, [in] RenderState aRenderState ) 716cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException, 717cdf0e10cSrcweir VolatileContentDestroyedException); 718cdf0e10cSrcweir 719cdf0e10cSrcweir //------------------------------------------------------------------------- 720cdf0e10cSrcweir 721cdf0e10cSrcweir /** Request the associated graphic device for this canvas.<p> 722cdf0e10cSrcweir 723cdf0e10cSrcweir A graphic device provides methods specific to the underlying 724cdf0e10cSrcweir output device capabilities, which are common for all canvases 725cdf0e10cSrcweir rendering to such a device. This includes device resolution, 726cdf0e10cSrcweir color space, or bitmap formats. 727cdf0e10cSrcweir 728cdf0e10cSrcweir @return the associated <type>XGraphicDevice</type>. 729cdf0e10cSrcweir */ 730cdf0e10cSrcweir XGraphicDevice getDevice(); 731cdf0e10cSrcweir}; 732cdf0e10cSrcweir 733cdf0e10cSrcweir//============================================================================= 734cdf0e10cSrcweir 735cdf0e10cSrcweir/// Service providing an <type>XCanvas</type> interface 736cdf0e10cSrcweirservice Canvas: XCanvas; 737cdf0e10cSrcweir 738cdf0e10cSrcweir}; }; }; }; 739cdf0e10cSrcweir 740cdf0e10cSrcweir#endif 741