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_XBufferController_idl__
28*cdf0e10cSrcweir#define __com_sun_star_rendering_XBufferController_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
34*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
35*cdf0e10cSrcweir#endif
36*cdf0e10cSrcweir
37*cdf0e10cSrcweirmodule com { module sun { module star { module rendering {
38*cdf0e10cSrcweir
39*cdf0e10cSrcweir/** Interface providing access to double/multi-buffer facilities of
40*cdf0e10cSrcweir    screen devices.<p>
41*cdf0e10cSrcweir
42*cdf0e10cSrcweir    This interface provides methods to enable and control
43*cdf0e10cSrcweir    double/multi-buffering facilities on screen devices.<p>
44*cdf0e10cSrcweir
45*cdf0e10cSrcweir    @since OOo 2.0
46*cdf0e10cSrcweir */
47*cdf0e10cSrcweirpublished interface XBufferController : ::com::sun::star::uno::XInterface
48*cdf0e10cSrcweir{
49*cdf0e10cSrcweir    /** Create the given number of background buffers.<p>
50*cdf0e10cSrcweir
51*cdf0e10cSrcweir        There's one buffer implicitely available, which is the canvas
52*cdf0e10cSrcweir        surface itself. Thus, calling <code>createBuffers(1)</code>
53*cdf0e10cSrcweir        creates a double-buffered object.<p>
54*cdf0e10cSrcweir
55*cdf0e10cSrcweir        @param nBuffers
56*cdf0e10cSrcweir        The number of background&lt;buffers requested. Must be greater
57*cdf0e10cSrcweir        than 0.
58*cdf0e10cSrcweir
59*cdf0e10cSrcweir        @return the number of actually generated buffers, which might
60*cdf0e10cSrcweir        be between 0 (no double-buffering available) and nBuffers.
61*cdf0e10cSrcweir
62*cdf0e10cSrcweir        @throws <type>com::sun::star::lang::IllegalArgumentException</type>
63*cdf0e10cSrcweir        if nBuffers is smaller than one.
64*cdf0e10cSrcweir     */
65*cdf0e10cSrcweir    long    createBuffers( [in] long nBuffers )
66*cdf0e10cSrcweir        raises (com::sun::star::lang::IllegalArgumentException);
67*cdf0e10cSrcweir
68*cdf0e10cSrcweir    //-------------------------------------------------------------------------
69*cdf0e10cSrcweir
70*cdf0e10cSrcweir    /** Destroy all buffers generated via this object.
71*cdf0e10cSrcweir     */
72*cdf0e10cSrcweir    void    destroyBuffers();
73*cdf0e10cSrcweir
74*cdf0e10cSrcweir    //-------------------------------------------------------------------------
75*cdf0e10cSrcweir
76*cdf0e10cSrcweir    /** Switch the display to show the specified buffer.<p>
77*cdf0e10cSrcweir
78*cdf0e10cSrcweir        The method returns, when the switch is performed and the
79*cdf0e10cSrcweir        selected buffer is shown on screen, or immediately when an
80*cdf0e10cSrcweir        error occurs. If the switch was successful, subsequent render
81*cdf0e10cSrcweir        operations will be directed to the new backbuffer.<p>
82*cdf0e10cSrcweir
83*cdf0e10cSrcweir        Use this method if you need your screen display to be in sync
84*cdf0e10cSrcweir        with other things, e.g. sound playback.<p>
85*cdf0e10cSrcweir
86*cdf0e10cSrcweir        @param bUpdateAll
87*cdf0e10cSrcweir        When <TRUE/>, update the whole screen. When <FALSE/>,
88*cdf0e10cSrcweir        implementation is permitted to restrict update to areas the
89*cdf0e10cSrcweir        canvas itself changed (e.g. because of render operations, or
90*cdf0e10cSrcweir        changes on the sprites). The former is useful for updates
91*cdf0e10cSrcweir        after window expose events, the latter for animation display.
92*cdf0e10cSrcweir
93*cdf0e10cSrcweir        @return whether the switch was performed successfully.
94*cdf0e10cSrcweir
95*cdf0e10cSrcweir        @throws <type>com::sun::star::lang::IllegalArgumentException</type>
96*cdf0e10cSrcweir        if nBuffer is outside the permissible range.
97*cdf0e10cSrcweir     */
98*cdf0e10cSrcweir    boolean	showBuffer( [in] boolean bUpdateAll );
99*cdf0e10cSrcweir
100*cdf0e10cSrcweir    //-------------------------------------------------------------------------
101*cdf0e10cSrcweir
102*cdf0e10cSrcweir    /** Schedule the display of the specified buffer.<p>
103*cdf0e10cSrcweir
104*cdf0e10cSrcweir        The method returns, when the switching of the buffer is
105*cdf0e10cSrcweir        successfully scheduled, or immediately when an error
106*cdf0e10cSrcweir        occurs. If the switch was successful, subsequent render
107*cdf0e10cSrcweir        operations will be directed to the new backbuffer. Note that,
108*cdf0e10cSrcweir        if the buffer switching is exceedingly slow, or the frequency
109*cdf0e10cSrcweir        of switchBuffer() is exceedingly high, the buffer scheduled
110*cdf0e10cSrcweir        for display here might become the current render target
111*cdf0e10cSrcweir        <em>before</em> it is fully displayed on screen. In this case,
112*cdf0e10cSrcweir        any rendering operation to this buffer will block, until it is
113*cdf0e10cSrcweir        safe to perform the operation without visible cluttering.<p>
114*cdf0e10cSrcweir
115*cdf0e10cSrcweir        Use this method if you favor maximal render speed, but don't
116*cdf0e10cSrcweir        necessarily require your screen display to be in sync with
117*cdf0e10cSrcweir        other things, e.g. sound playback.<p>
118*cdf0e10cSrcweir
119*cdf0e10cSrcweir        @param bUpdateAll
120*cdf0e10cSrcweir        When <TRUE/>, update the whole screen. When <FALSE/>,
121*cdf0e10cSrcweir        implementation is permitted to restrict update to areas the
122*cdf0e10cSrcweir        canvas itself changed (e.g. because of render operations, or
123*cdf0e10cSrcweir        changes on the sprites). The former is useful for updates
124*cdf0e10cSrcweir        after window expose events, the latter for animation display.
125*cdf0e10cSrcweir
126*cdf0e10cSrcweir        @return whether the switch was performed successfully.
127*cdf0e10cSrcweir     */
128*cdf0e10cSrcweir    boolean	switchBuffer( [in] boolean bUpdateAll );
129*cdf0e10cSrcweir
130*cdf0e10cSrcweir};
131*cdf0e10cSrcweir
132*cdf0e10cSrcweir}; }; }; };
133*cdf0e10cSrcweir
134*cdf0e10cSrcweir#endif
135