LibreOffice
LibreOffice 6.4 SDK API Reference
Public Member Functions | List of all members
XSpriteCanvas Interface Reference

Specialization of a XCanvas, where moving, animated objects (called sprites) are supported. More...

import"XSpriteCanvas.idl";

Inheritance diagram for XSpriteCanvas:
XCanvas XInterface

Public Member Functions

XAnimatedSprite createSpriteFromAnimation ([in] XAnimation animation) raises (com::sun::star::lang::IllegalArgumentException)
 Create a sprite object from the specified animation sequence. More...
 
XAnimatedSprite createSpriteFromBitmaps ([in] sequence< XBitmap > animationBitmaps, [in] byte interpolationMode) raises (com::sun::star::lang::IllegalArgumentException, VolatileContentDestroyedException)
 Create a sprite object from the specified animation sequence. More...
 
XCustomSprite createCustomSprite ([in] ::com::sun::star::geometry::RealSize2D spriteSize) raises (com::sun::star::lang::IllegalArgumentException)
 Create a custom, user-handles-it-all sprite object. More...
 
XSprite createClonedSprite ([in] XSprite original) raises (com::sun::star::lang::IllegalArgumentException)
 Create a cloned version of an already existing sprite object. More...
 
boolean updateScreen ([in] boolean bUpdateAll)
 Tells the sprite canvas to now update the screen representation. More...
 
- Public Member Functions inherited from XCanvas
void clear ()
 Clear the whole canvas area. More...
 
void drawPoint ([in] ::com::sun::star::geometry::RealPoint2D aPoint, [in] ViewState aViewState, [in] RenderState aRenderState) raises (com::sun::star::lang::IllegalArgumentException)
 Draw a point in device resolution on the device. More...
 
void drawLine ([in] ::com::sun::star::geometry::RealPoint2D aStartPoint, [in] ::com::sun::star::geometry::RealPoint2D aEndPoint, [in] ViewState aViewState, [in] RenderState aRenderState) raises (com::sun::star::lang::IllegalArgumentException)
 Draw a line in device resolution width (i.e. More...
 
void drawBezier ([in] ::com::sun::star::geometry::RealBezierSegment2D aBezierSegment, [in] ::com::sun::star::geometry::RealPoint2D aEndPoint, [in] ViewState aViewState, [in] RenderState aRenderState) raises (com::sun::star::lang::IllegalArgumentException)
 Draw a cubic Bezier curve in device resolution width (i.e. More...
 
XCachedPrimitive drawPolyPolygon ([in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState) raises (com::sun::star::lang::IllegalArgumentException)
 Draw a poly-polygon in device resolution line width (i.e. More...
 
XCachedPrimitive strokePolyPolygon ([in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState, [in] StrokeAttributes aStrokeAttributes) raises (com::sun::star::lang::IllegalArgumentException)
 Stroke each polygon of the provided poly-polygon with the specified stroke attributes. More...
 
XCachedPrimitive strokeTexturedPolyPolygon ([in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState, [in] sequence< Texture > aTextures, [in] StrokeAttributes aStrokeAttributes) raises (com::sun::star::lang::IllegalArgumentException, VolatileContentDestroyedException)
 Stroke each polygon of the provided poly-polygon with the specified stroke attributes, fill the stroked outline with the specified texture graphics. More...
 
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) raises (com::sun::star::lang::IllegalArgumentException, VolatileContentDestroyedException)
 Stroke each polygon of the provided poly-polygon with the specified stroke attributes, fill the stroked outline with the specified texture graphics, map the texture to the outline via the specified texture mapping. More...
 
XPolyPolygon2D queryStrokeShapes ([in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState, [in] StrokeAttributes aStrokeAttributes) raises (com::sun::star::lang::IllegalArgumentException)
 Query the polygonal representation of the stroke outlines, as it would be generated by the strokePolyPolygon methods. More...
 
XCachedPrimitive fillPolyPolygon ([in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState) raises (com::sun::star::lang::IllegalArgumentException)
 Fill the given poly-polygon. More...
 
XCachedPrimitive fillTexturedPolyPolygon ([in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState, [in] sequence< Texture > xTextures) raises (com::sun::star::lang::IllegalArgumentException, VolatileContentDestroyedException)
 Fill the given poly-polygon with a texture. More...
 
XCachedPrimitive fillTextureMappedPolyPolygon ([in] XPolyPolygon2D xPolyPolygon, [in] ViewState aViewState, [in] RenderState aRenderState, [in] sequence< Texture > xTextures, [in] ::com::sun::star::geometry::XMapping2D xMapping) raises (com::sun::star::lang::IllegalArgumentException, VolatileContentDestroyedException)
 Fill the given poly-polygon with a mapped texture. More...
 
XCanvasFont createFont ([in] FontRequest aFontRequest, [in] sequence< ::com::sun::star::beans::PropertyValue > aExtraFontProperties, [in] ::com::sun::star::geometry::Matrix2D aFontMatrix) raises (com::sun::star::lang::IllegalArgumentException)
 Create a suitable font for the specified font description. More...
 
sequence< FontInfoqueryAvailableFonts ([in] FontInfo aFilter, [in] sequence< ::com::sun::star::beans::PropertyValue > aFontProperties) raises (com::sun::star::lang::IllegalArgumentException)
 Query font information, specific to this canvas. More...
 
XCachedPrimitive drawText ([in] StringContext aText, [in] XCanvasFont xFont, [in] ViewState aViewState, [in] RenderState aRenderState, [in] byte nTextDirection) raises (com::sun::star::lang::IllegalArgumentException)
 Draw the text given by the substring of the specified string with the given font. More...
 
XCachedPrimitive drawTextLayout ([in] XTextLayout xLayoutetText, [in] ViewState aViewState, [in] RenderState aRenderState) raises (com::sun::star::lang::IllegalArgumentException)
 Draw the formatted text given by the text layout. More...
 
XCachedPrimitive drawBitmap ([in] XBitmap xBitmap, [in] ViewState aViewState, [in] RenderState aRenderState) raises (com::sun::star::lang::IllegalArgumentException, VolatileContentDestroyedException)
 Render the given bitmap. More...
 
XCachedPrimitive drawBitmapModulated ([in] XBitmap xBitmap, [in] ViewState aViewState, [in] RenderState aRenderState) raises (com::sun::star::lang::IllegalArgumentException, VolatileContentDestroyedException)
 Render the given bitmap, with a global color modulation. More...
 
XGraphicDevice getDevice ()
 Request the associated graphic device for this canvas. More...
 
- Public Member Functions inherited from XInterface
any queryInterface ([in] type aType)
 queries for a new interface to an existing UNO object. More...
 
void acquire ()
 increases the reference counter by one. More...
 
void release ()
 decreases the reference counter by one. More...
 

Detailed Description

Specialization of a XCanvas, where moving, animated objects (called sprites) are supported.

Attention
The screen output of canvas drawing operations is undefined, unless XSpriteCanvas::updateScreen() is called. This is because a sprite canvas might choose to employ double buffering to reduce animation flicker, and cannot know the instant suitable to display the newly rendered canvas content. When using external double-buffering via XBufferController on a sprite canvas, the implementation takes care of this issue, and in this case is able to render correctly even without explicit updateScreen() calls (because there's a defined moment in time where content display can happen, namely the XBufferController::showBuffer()) call. If you don't need sprite functionality, and don't want the updateScreen hassle, simply use the XCanvas.

Member Function Documentation

◆ createClonedSprite()

XSprite createClonedSprite ( [in] XSprite  original)
raises (com::sun::star::lang::IllegalArgumentException
)

Create a cloned version of an already existing sprite object.

The cloned sprite always shows the same content as its original, but of course the sprite position, visibility, alpha etc. can be modified independently.

Parameters
originalThe original sprite to copy the content from. This sprite must have been created by the same XSpriteCanvas instance as this method is called on. Other sprite instances will generate an IllegalArgumentException.
Returns
an interface to a sprite object.

◆ createCustomSprite()

Create a custom, user-handles-it-all sprite object.

A sprite is a back-buffered object with its own, independent animation.

Parameters
spriteSizeThe required size of the sprite in device coordinates. Everything that is rendered outside this area might be clipped on output. Both components of the size must be greater than zero.
Returns
an interface to a custom sprite object.

◆ createSpriteFromAnimation()

XAnimatedSprite createSpriteFromAnimation ( [in] XAnimation  animation)
raises (com::sun::star::lang::IllegalArgumentException
)

Create a sprite object from the specified animation sequence.

A sprite is a back-buffered object with its own, independent animation.

◆ createSpriteFromBitmaps()

XAnimatedSprite createSpriteFromBitmaps ( [in] sequence< XBitmap animationBitmaps,
[in] byte  interpolationMode 
)
raises (com::sun::star::lang::IllegalArgumentException,
VolatileContentDestroyedException
)

Create a sprite object from the specified animation sequence.

A sprite is a back-buffered object with its own, independent animation.

Parameters
animationBitmapsSequence of bitmaps. The bitmaps don't need to have the same size, but they are all rendered with their left, top edges aligned.
interpolationModeValue of InterpolationMode, to determine whether and how to interpolate between the provided bitmaps, if animation runs fast enough.
Exceptions
VolatileContentDestroyedExceptionif at least one of the bitmap is volatile, and its content has been destroyed by the system.

◆ updateScreen()

boolean updateScreen ( [in] boolean  bUpdateAll)

Tells the sprite canvas to now update the screen representation.

Required to display rendered changes to the canvas, and updates to stopped animations and XCustomSprites in general. This method will return only after the screen update is done, or earlier if an error happened.

If double buffering is enabled via XBufferController, no explicit call of updateScreen() is necessary, since the XBufferController methods will automatically notify all associated XSpriteCanvas instances.

Parameters
bUpdateAllWhen TRUE, update the whole screen. When FALSE, implementation is permitted to restrict update to areas the canvas itself changed (e.g. because of render operations, or changes on the sprites). The former is useful for updates after window expose events. the latter for animation display.
Returns
TRUE, if the screen update was successfully performed

The documentation for this interface was generated from the following file: