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