1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XGraphicDevice.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_rendering_XGraphicDevice_idl__
31 #define __com_sun_star_rendering_XGraphicDevice_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
36 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
37 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
39 #ifndef __com_sun_star_geometry_IntegerSize2D_idl__
40 #include
<com
/sun
/star
/geometry
/IntegerSize2D.idl
>
42 #ifndef __com_sun_star_geometry_RealSize2D_idl__
43 #include
<com
/sun
/star
/geometry
/RealSize2D.idl
>
45 #ifndef __com_sun_star_rendering_XLinePolyPolygon2D_idl__
46 #include
<com
/sun
/star
/rendering
/XLinePolyPolygon2D.idl
>
48 #ifndef __com_sun_star_rendering_XBezierPolyPolygon2D_idl__
49 #include
<com
/sun
/star
/rendering
/XBezierPolyPolygon2D.idl
>
51 #ifndef __com_sun_star_rendering_XParametricPolyPolygon2DFactory_idl__
52 #include
<com
/sun
/star
/rendering
/XParametricPolyPolygon2DFactory.idl
>
54 #ifndef __com_sun_star_rendering_XColorSpace_idl__
55 #include
<com
/sun
/star
/rendering
/XColorSpace.idl
>
58 module com
{ module sun
{ module star
{ module rendering
{
61 interface XVolatileBitmap
;
62 interface XBufferController
;
64 /* TODO: There's obviously a concept called window missing here, where
65 methods such as bufferController, fullscreen mode etc . belong
69 /** This interface provides access to a graphic device, such as a
70 printer, or a screen device. Every canvas (@see XCanvas) has
71 exactly one associated graphic device, into which its output is
74 For a typical windowing system, the graphic device is equivalent
75 to a distinct OS window, with it's own clipped output area,
76 fullscreen and double-buffering attributes. That is, even if one
77 can have multiple canvases per system window, they all share the
78 same graphic device and thus e.g. fullscreen state. If the OS
79 restrictions are in such a way that fullscreen or double-buffering
80 is screen-exclusive, i.e. that per screen, only one object can
81 have this state, it might even be that all windows on the screen
82 share a common graphic device.
84 interface XGraphicDevice
: ::com
::sun
::star
::uno
::XInterface
86 /** Query the controller for multi buffering functionality on this
89 If there is no such functionality available, the NULL
90 reference is returned.
92 XBufferController getBufferController
();
94 //-------------------------------------------------------------------------
96 /** Query the color space interface for this graphic device.
98 This is to be used when interpreting or setting device color
101 XColorSpace getDeviceColorSpace
();
103 //-------------------------------------------------------------------------
105 /** Query the physical resolution of the device in pixel per
108 A special floating point value of +infinity here indicates
109 'unknown', i.e. at the time of rendering undetermined or
110 possibly infinite resolution along the corresponding
113 ::com
::sun
::star
::geometry
::RealSize2D getPhysicalResolution
();
115 //-------------------------------------------------------------------------
117 /** Query the physical dimensions of the device in millimeter.
119 A special floating point value of +infinity here indicates
120 'unknown', i.e. at the time of rendering undetermined or
121 possibly infinite resolution along the corresponding
124 @see XBitmap::getSize()
126 ::com
::sun
::star
::geometry
::RealSize2D getPhysicalSize
();
128 //-------------------------------------------------------------------------
130 /** Create a line poly-polygon which can internally use
131 device-optimized representations already.
134 The points of the poly-polygon, in a separate array for every polygon.
136 XLinePolyPolygon2D createCompatibleLinePolyPolygon
( [in] sequence
< sequence
< ::com
::sun
::star
::geometry
::RealPoint2D
> > points
);
138 //-------------------------------------------------------------------------
140 /** Create a bezier poly-polygon which can internally use
141 device-optimized representations already.
144 The points of the poly-polygon, in a separate array for every polygon.
146 XBezierPolyPolygon2D createCompatibleBezierPolyPolygon
( [in] sequence
< sequence
< ::com
::sun
::star
::geometry
::RealBezierSegment2D
> > points
);
148 //-------------------------------------------------------------------------
150 /** Create a bitmap whose memory layout and sample model is
151 compatible to the graphic device.
154 Size of the requested bitmap in pixel. Both components of the
155 size must be greater than 0
157 XBitmap createCompatibleBitmap
( [in] ::com
::sun
::star
::geometry
::IntegerSize2D size
)
158 raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
160 //-------------------------------------------------------------------------
162 /** Create a volatile bitmap that is usable with this graphic device.
164 A volatile bitmap's difference in comparison to a plain bitmap
165 (e.g. generated via createCompatibleBitmap()) is the fact that
166 its content might vanish at any point in time (making any
167 operation with them produce a
168 <type>VolatileContentDestroyedException</type>). The benefit,
169 on the other hand, is that they might be easy to
170 hardware-accelerate on certain platforms, without the need to
171 keep a safety copy of the content internally.
174 Size of the requested bitmap in pixel. Both components of the
175 size must be greater than 0
177 XVolatileBitmap createVolatileBitmap
( [in] ::com
::sun
::star
::geometry
::IntegerSize2D size
)
178 raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
180 //-------------------------------------------------------------------------
182 /** Create a bitmap with alpha channel whose memory layout and
183 sample model is compatible to the graphic device.
186 Size of the requested bitmap in pixel. Both components of the
187 size must be greater than 0
189 XBitmap createCompatibleAlphaBitmap
( [in] ::com
::sun
::star
::geometry
::IntegerSize2D size
)
190 raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
192 //-------------------------------------------------------------------------
194 /** Create a volatile bitmap with alpha channel that is usable
195 with this graphic device.
197 A volatile bitmap's difference in comparison to a plain bitmap
198 (e.g. generated via createCompatibleBitmap()) is the fact that
199 its content might vanish at any point in time (making any
200 operation with them produce a
201 <type>VolatileContentDestroyedException</type>). The benefit,
202 on the other hand, is that they might be easy to
203 hardware-accelerate on certain platforms, without the need to
204 keep a safety copy of the content internally.
207 Size of the requested bitmap in pixel. Both components of the
208 size must be greater than 0
210 XVolatileBitmap createVolatileAlphaBitmap
( [in] ::com
::sun
::star
::geometry
::IntegerSize2D size
)
211 raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
213 //-------------------------------------------------------------------------
215 /** Get a reference to this device's parametric polygon factory.
217 @return a reference to this device's parametric polygon
218 factory. Although it is possible to use parametric polygons on
219 all canvases, regardless of the associated graphic device,
220 this is not advisable: each canvas implementation is free to
221 internally generate optimized parametric polygons, which can
222 be used more directly for e.g. texturing operations.
224 XParametricPolyPolygon2DFactory getParametricPolyPolygonFactory
();
226 //-------------------------------------------------------------------------
228 /** Tells whether this graphic device has a full screen mode,
229 i.e. whether a window can cover the whole screen exclusively.
231 boolean hasFullScreenMode
();
233 //-------------------------------------------------------------------------
235 /** Enter or leave the fullscreen mode, if possible. The return
236 value denotes the success of the operation.
238 @attention depending on the underlying operating system,
239 fullscreen mode can be left without a enterFullScreenMode(
242 boolean enterFullScreenMode
( [in] boolean bEnter
);