1*cdf0e10cSrcweir/************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XSpriteCanvas_idl__ 28*cdf0e10cSrcweir#define __com_sun_star_rendering_XSpriteCanvas_idl__ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 31*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 32*cdf0e10cSrcweir#endif 33*cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XBitmapCanvas_idl__ 34*cdf0e10cSrcweir#include <com/sun/star/rendering/XBitmapCanvas.idl> 35*cdf0e10cSrcweir#endif 36*cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XAnimation_idl__ 37*cdf0e10cSrcweir#include <com/sun/star/rendering/XAnimation.idl> 38*cdf0e10cSrcweir#endif 39*cdf0e10cSrcweir#ifndef __com_sun_star_rendering_VolatileContentDestroyedException_idl__ 40*cdf0e10cSrcweir#include <com/sun/star/rendering/VolatileContentDestroyedException.idl> 41*cdf0e10cSrcweir#endif 42*cdf0e10cSrcweir 43*cdf0e10cSrcweirmodule com { module sun { module star { module rendering { 44*cdf0e10cSrcweir 45*cdf0e10cSrcweirpublished interface XSprite; 46*cdf0e10cSrcweirpublished interface XAnimatedSprite; 47*cdf0e10cSrcweirpublished interface XCustomSprite; 48*cdf0e10cSrcweir 49*cdf0e10cSrcweir/** Specialization of a XBitmapCanvas, where moving, animated objects 50*cdf0e10cSrcweir (called sprites) are supported.<p> 51*cdf0e10cSrcweir 52*cdf0e10cSrcweir @attention The screen output of canvas drawing operations is 53*cdf0e10cSrcweir undefined, unless XSpriteCanvas::updateScreen() is called. This is 54*cdf0e10cSrcweir because a sprite canvas might choose to employ double buffering to 55*cdf0e10cSrcweir reduce animation flicker, and cannot know the instant suitable to 56*cdf0e10cSrcweir display the newly rendered canvas content. When using external 57*cdf0e10cSrcweir double-buffering via XBufferController on a sprite canvas, the 58*cdf0e10cSrcweir implementation takes care of this issue, and in this case is able 59*cdf0e10cSrcweir to render correctly even without explicit updateScreen() calls 60*cdf0e10cSrcweir (because there's a defined moment in time where content display 61*cdf0e10cSrcweir can happen, namely the XBufferController::showBuffer()) call. If 62*cdf0e10cSrcweir you don't need sprite functionality, and don't want the 63*cdf0e10cSrcweir updateScreen hassle, simply use the XBitmapCanvas. 64*cdf0e10cSrcweir */ 65*cdf0e10cSrcweirpublished interface XSpriteCanvas : XBitmapCanvas 66*cdf0e10cSrcweir{ 67*cdf0e10cSrcweir /** Create a sprite object from the specified animation 68*cdf0e10cSrcweir sequence. A sprite is a back-buffered object with its own, 69*cdf0e10cSrcweir independent animation. 70*cdf0e10cSrcweir */ 71*cdf0e10cSrcweir XAnimatedSprite createSpriteFromAnimation( [in] XAnimation animation ) 72*cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir /** Create a sprite object from the specified animation 75*cdf0e10cSrcweir sequence. 76*cdf0e10cSrcweir 77*cdf0e10cSrcweir A sprite is a back-buffered object with its own, 78*cdf0e10cSrcweir independent animation. 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir @param animationBitmaps 81*cdf0e10cSrcweir Sequence of bitmaps. The bitmaps don't need to have the same 82*cdf0e10cSrcweir size, but they are all rendered with their left, top edges 83*cdf0e10cSrcweir aligned. 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir @param interpolationMode 86*cdf0e10cSrcweir Value of <type>InterpolationMode</type>, to determine whether 87*cdf0e10cSrcweir and how to interpolate between the provided bitmaps, if 88*cdf0e10cSrcweir animation runs fast enough. 89*cdf0e10cSrcweir 90*cdf0e10cSrcweir @throws <type>VolatileContentDestroyedException</type> 91*cdf0e10cSrcweir if at least one of the bitmap is volatile, and its content has been destroyed by the system. 92*cdf0e10cSrcweir */ 93*cdf0e10cSrcweir XAnimatedSprite createSpriteFromBitmaps( [in] sequence<XBitmap> animationBitmaps, [in] byte interpolationMode ) 94*cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException, 95*cdf0e10cSrcweir VolatileContentDestroyedException); 96*cdf0e10cSrcweir 97*cdf0e10cSrcweir /** Create a custom, user-handles-it-all sprite object. 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir A sprite is a back-buffered object with its own, independent 100*cdf0e10cSrcweir animation. 101*cdf0e10cSrcweir 102*cdf0e10cSrcweir @param spriteSize 103*cdf0e10cSrcweir The required size of the sprite in device 104*cdf0e10cSrcweir coordinates. Everything that is rendered outside this area 105*cdf0e10cSrcweir might be clipped on output. Both components of the size must 106*cdf0e10cSrcweir be greater than zero. 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir @return an interface to a custom sprite object. 109*cdf0e10cSrcweir */ 110*cdf0e10cSrcweir XCustomSprite createCustomSprite( [in] ::com::sun::star::geometry::RealSize2D spriteSize ) 111*cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 112*cdf0e10cSrcweir 113*cdf0e10cSrcweir /** Create a cloned version of an already existing sprite 114*cdf0e10cSrcweir object. 115*cdf0e10cSrcweir 116*cdf0e10cSrcweir The cloned sprite always shows the same content as its 117*cdf0e10cSrcweir original. Furthermore, cloned copies of a hidden original are 118*cdf0e10cSrcweir never visible, although cloned copies of a visible original 119*cdf0e10cSrcweir can of course be invisible. 120*cdf0e10cSrcweir 121*cdf0e10cSrcweir @param original 122*cdf0e10cSrcweir The original sprite to copy the content from. This sprite must 123*cdf0e10cSrcweir have been created by the same XSpriteCanvas instance as this 124*cdf0e10cSrcweir method is called on. Other sprite instances will generate an 125*cdf0e10cSrcweir IllegalArgumentException. 126*cdf0e10cSrcweir 127*cdf0e10cSrcweir @return an interface to a sprite object. 128*cdf0e10cSrcweir */ 129*cdf0e10cSrcweir XSprite createClonedSprite( [in] XSprite original ) 130*cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 131*cdf0e10cSrcweir 132*cdf0e10cSrcweir /** Tells the sprite canvas to now update the screen 133*cdf0e10cSrcweir representation. 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir Required to display rendered changes to the canvas, and 136*cdf0e10cSrcweir updates to stopped animations and XCustomSprites in 137*cdf0e10cSrcweir general. This method will return only after the screen update 138*cdf0e10cSrcweir is done, or earlier if an error happened.<p> 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir If double buffering is enabled via XBufferController, no 141*cdf0e10cSrcweir explicit call of updateScreen() is necessary, since the 142*cdf0e10cSrcweir XBufferController methods will automatically notify all 143*cdf0e10cSrcweir associated XSpriteCanvas instances.<p> 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir @param bUpdateAll 146*cdf0e10cSrcweir When <TRUE/>, update the whole screen. When <FALSE/>, 147*cdf0e10cSrcweir implementation is permitted to restrict update to areas the 148*cdf0e10cSrcweir canvas itself changed (e.g. because of render operations, or 149*cdf0e10cSrcweir changes on the sprites). The former is useful for updates 150*cdf0e10cSrcweir after window expose events. the latter for animation display. 151*cdf0e10cSrcweir 152*cdf0e10cSrcweir @return <TRUE/>, if the screen update was successfully 153*cdf0e10cSrcweir performed 154*cdf0e10cSrcweir */ 155*cdf0e10cSrcweir boolean updateScreen( [in] boolean bUpdateAll ); 156*cdf0e10cSrcweir}; 157*cdf0e10cSrcweir 158*cdf0e10cSrcweir}; }; }; }; 159*cdf0e10cSrcweir 160*cdf0e10cSrcweir#endif 161