1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_rendering_XBufferController_idl__
24#define __com_sun_star_rendering_XBufferController_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
30#include <com/sun/star/lang/IllegalArgumentException.idl>
31#endif
32
33module com { module sun { module star { module rendering {
34
35/** Interface providing access to double/multi-buffer facilities of
36    screen devices.<p>
37
38    This interface provides methods to enable and control
39    double/multi-buffering facilities on screen devices.<p>
40
41    @since OpenOffice 2.0
42 */
43published interface XBufferController : ::com::sun::star::uno::XInterface
44{
45    /** Create the given number of background buffers.<p>
46
47        There's one buffer implicitly available, which is the canvas
48        surface itself. Thus, calling <code>createBuffers(1)</code>
49        creates a double-buffered object.<p>
50
51        @param nBuffers
52        The number of background&lt;buffers requested. Must be greater
53        than 0.
54
55        @return the number of actually generated buffers, which might
56        be between 0 (no double-buffering available) and nBuffers.
57
58        @throws <type>com::sun::star::lang::IllegalArgumentException</type>
59        if nBuffers is smaller than one.
60     */
61    long    createBuffers( [in] long nBuffers )
62        raises (com::sun::star::lang::IllegalArgumentException);
63
64    //-------------------------------------------------------------------------
65
66    /** Destroy all buffers generated via this object.
67     */
68    void    destroyBuffers();
69
70    //-------------------------------------------------------------------------
71
72    /** Switch the display to show the specified buffer.<p>
73
74        The method returns, when the switch is performed and the
75        selected buffer is shown on screen, or immediately when an
76        error occurs. If the switch was successful, subsequent render
77        operations will be directed to the new backbuffer.<p>
78
79        Use this method if you need your screen display to be in sync
80        with other things, e.g. sound playback.<p>
81
82        @param bUpdateAll
83        When <TRUE/>, update the whole screen. When <FALSE/>,
84        implementation is permitted to restrict update to areas the
85        canvas itself changed (e.g. because of render operations, or
86        changes on the sprites). The former is useful for updates
87        after window expose events, the latter for animation display.
88
89        @return whether the switch was performed successfully.
90
91        @throws <type>com::sun::star::lang::IllegalArgumentException</type>
92        if nBuffer is outside the permissible range.
93     */
94    boolean	showBuffer( [in] boolean bUpdateAll );
95
96    //-------------------------------------------------------------------------
97
98    /** Schedule the display of the specified buffer.<p>
99
100        The method returns, when the switching of the buffer is
101        successfully scheduled, or immediately when an error
102        occurs. If the switch was successful, subsequent render
103        operations will be directed to the new backbuffer. Note that,
104        if the buffer switching is exceedingly slow, or the frequency
105        of switchBuffer() is exceedingly high, the buffer scheduled
106        for display here might become the current render target
107        <em>before</em> it is fully displayed on screen. In this case,
108        any rendering operation to this buffer will block, until it is
109        safe to perform the operation without visible cluttering.<p>
110
111        Use this method if you favor maximal render speed, but don't
112        necessarily require your screen display to be in sync with
113        other things, e.g. sound playback.<p>
114
115        @param bUpdateAll
116        When <TRUE/>, update the whole screen. When <FALSE/>,
117        implementation is permitted to restrict update to areas the
118        canvas itself changed (e.g. because of render operations, or
119        changes on the sprites). The former is useful for updates
120        after window expose events, the latter for animation display.
121
122        @return whether the switch was performed successfully.
123     */
124    boolean	switchBuffer( [in] boolean bUpdateAll );
125
126};
127
128}; }; }; };
129
130#endif
131