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