1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef __com_sun_star_rendering_XGraphicDevice_idl__
28 #define __com_sun_star_rendering_XGraphicDevice_idl__
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #include
<com
/sun
/star
/uno
/XInterface.idl
>
33 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
34 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
36 #ifndef __com_sun_star_geometry_IntegerSize2D_idl__
37 #include
<com
/sun
/star
/geometry
/IntegerSize2D.idl
>
39 #ifndef __com_sun_star_geometry_RealSize2D_idl__
40 #include
<com
/sun
/star
/geometry
/RealSize2D.idl
>
42 #ifndef __com_sun_star_rendering_XLinePolyPolygon2D_idl__
43 #include
<com
/sun
/star
/rendering
/XLinePolyPolygon2D.idl
>
45 #ifndef __com_sun_star_rendering_XBezierPolyPolygon2D_idl__
46 #include
<com
/sun
/star
/rendering
/XBezierPolyPolygon2D.idl
>
48 #ifndef __com_sun_star_rendering_XColorSpace_idl__
49 #include
<com
/sun
/star
/rendering
/XColorSpace.idl
>
51 #ifndef __com_sun_star_lang_XMultiServiceFactory_idl__
52 #include
<com
/sun
/star
/lang
/XMultiServiceFactory.idl
>
55 module com
{ module sun
{ module star
{ module rendering
{
58 interface XVolatileBitmap
;
59 interface XBufferController
;
61 /* TODO: There's obviously a concept called window missing here, where
62 methods such as bufferController, fullscreen mode etc . belong
66 /** This interface provides access to a graphic device, such as a
67 printer, or a screen device. Every canvas (@see XCanvas) has
68 exactly one associated graphic device, into which its output is
71 For a typical windowing system, the graphic device is equivalent
72 to a distinct OS window, with it's own clipped output area,
73 fullscreen and double-buffering attributes. That is, even if one
74 can have multiple canvases per system window, they all share the
75 same graphic device and thus e.g. fullscreen state. If the OS
76 restrictions are in such a way that fullscreen or double-buffering
77 is screen-exclusive, i.e. that per screen, only one object can
78 have this state, it might even be that all windows on the screen
79 share a common graphic device.
81 interface XGraphicDevice
: ::com
::sun
::star
::uno
::XInterface
83 /** Query the controller for multi buffering functionality on this
86 If there is no such functionality available, the NULL
87 reference is returned.
89 XBufferController getBufferController
();
91 //-------------------------------------------------------------------------
93 /** Query the color space interface for this graphic device.
95 This is to be used when interpreting or setting device color
98 XColorSpace getDeviceColorSpace
();
100 //-------------------------------------------------------------------------
102 /** Query the physical resolution of the device in pixel per
105 A special floating point value of +infinity here indicates
106 'unknown', i.e. at the time of rendering undetermined or
107 possibly infinite resolution along the corresponding
110 ::com
::sun
::star
::geometry
::RealSize2D getPhysicalResolution
();
112 //-------------------------------------------------------------------------
114 /** Query the physical dimensions of the device in millimeter.
116 A special floating point value of +infinity here indicates
117 'unknown', i.e. at the time of rendering undetermined or
118 possibly infinite resolution along the corresponding
121 @see XBitmap::getSize()
123 ::com
::sun
::star
::geometry
::RealSize2D getPhysicalSize
();
125 //-------------------------------------------------------------------------
127 /** Create a line poly-polygon which can internally use
128 device-optimized representations already.
131 The points of the poly-polygon, in a separate array for every polygon.
133 XLinePolyPolygon2D createCompatibleLinePolyPolygon
( [in] sequence
< sequence
< ::com
::sun
::star
::geometry
::RealPoint2D
> > points
);
135 //-------------------------------------------------------------------------
137 /** Create a bezier poly-polygon which can internally use
138 device-optimized representations already.
141 The points of the poly-polygon, in a separate array for every polygon.
143 XBezierPolyPolygon2D createCompatibleBezierPolyPolygon
( [in] sequence
< sequence
< ::com
::sun
::star
::geometry
::RealBezierSegment2D
> > points
);
145 //-------------------------------------------------------------------------
147 /** Create a bitmap whose memory layout and sample model is
148 compatible to the graphic device.
151 Size of the requested bitmap in pixel. Both components of the
152 size must be greater than 0
154 XBitmap createCompatibleBitmap
( [in] ::com
::sun
::star
::geometry
::IntegerSize2D size
)
155 raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
157 //-------------------------------------------------------------------------
159 /** Create a volatile bitmap that is usable with this graphic device.
161 A volatile bitmap's difference in comparison to a plain bitmap
162 (e.g. generated via createCompatibleBitmap()) is the fact that
163 its content might vanish at any point in time (making any
164 operation with them produce a
165 <type>VolatileContentDestroyedException</type>). The benefit,
166 on the other hand, is that they might be easy to
167 hardware-accelerate on certain platforms, without the need to
168 keep a safety copy of the content internally.
171 Size of the requested bitmap in pixel. Both components of the
172 size must be greater than 0
174 XVolatileBitmap createVolatileBitmap
( [in] ::com
::sun
::star
::geometry
::IntegerSize2D size
)
175 raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
177 //-------------------------------------------------------------------------
179 /** Create a bitmap with alpha channel whose memory layout and
180 sample model is compatible to the graphic device.
183 Size of the requested bitmap in pixel. Both components of the
184 size must be greater than 0
186 XBitmap createCompatibleAlphaBitmap
( [in] ::com
::sun
::star
::geometry
::IntegerSize2D size
)
187 raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
189 //-------------------------------------------------------------------------
191 /** Create a volatile bitmap with alpha channel that is usable
192 with this graphic device.
194 A volatile bitmap's difference in comparison to a plain bitmap
195 (e.g. generated via createCompatibleBitmap()) is the fact that
196 its content might vanish at any point in time (making any
197 operation with them produce a
198 <type>VolatileContentDestroyedException</type>). The benefit,
199 on the other hand, is that they might be easy to
200 hardware-accelerate on certain platforms, without the need to
201 keep a safety copy of the content internally.
204 Size of the requested bitmap in pixel. Both components of the
205 size must be greater than 0
207 XVolatileBitmap createVolatileAlphaBitmap
( [in] ::com
::sun
::star
::geometry
::IntegerSize2D size
)
208 raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
210 //-------------------------------------------------------------------------
212 /** Get a reference to this device's parametric polygon factory.
214 @return a reference to this device's parametric polygon
215 factory. Although it is possible to use parametric polygons on
216 all canvases, regardless of the associated graphic device,
217 this is not advisable: each canvas implementation is free to
218 internally generate optimized parametric polygons, which can
219 be used more directly for e.g. texturing operations.
222 Available services (all canvas implementations should provide
223 this minimal set, though are free to add more; just check the
224 getAvailableServiceNames() on the returned interface):
226 - Gradients - all gradients need to support two construction
227 parameters, "Colors" being a <type>sequence<Color></type>
228 and "Stops" being a <type>sequence<double></type>. Both must
229 have the same length, and at least two elements. See
230 http://www.w3.org/TR/SVG11/pservers.html#GradientStops for
231 the semantics of gradient stops and colors.
232 Required gradient services:
234 * "LinearGradient" - the gradient varies linearly between
235 the given colors. without coordinate system
236 transformation, the color interpolation happens in
237 increasing x direction, and is constant in y
238 direction. Equivalent to svg linear gradient
239 http://www.w3.org/TR/SVG11/pservers.html#LinearGradients
241 * "EllipticalGradient" - this gradient has zeroth color
242 index in the middle, and varies linearly between center
243 and final color. The services takes an additional
244 parameter named "AspectRatio" of <type>double</type>
245 (width divided by height), if this aspect ratio is 1, the
246 gradient is circular. If it's not 1, the gradient is
247 elliptical, with the special twist that the aspect ratio
248 is maintained also for the center color: the gradient will
249 not collapse into a single point, but become a line of
250 center color. If "AspectRatio" is missing, or equal to 1,
251 this gradient yields similar results as the svg radial
253 http://www.w3.org/TR/SVG11/pservers.html#RadialGradients
255 * "RectangularGradient" - this gradient has zeroth color
256 index in the middle, and varies linearly between center
257 and final color via rectangular boxes
258 around the center point. The services takes an additional
259 parameter named "AspectRatio" of <type>double</type>
260 (width divided by height), if this aspect ratio is 1, the
261 gradient is quadratic. If it's not 1, the gradient is
262 rectangular, with the special twist that the aspect ratio
263 is maintained also for the center color: the gradient will
264 not collapse into a single point, but become a line of
267 - Hatch patterns - Required hatch services:
269 * "VerticalLineHatch" - this hatching consists of vertical lines
270 * "OrthogonalLinesHatch" - this hatching consists of
271 crossing vertical and horizontal lines
272 * "ThreeCrossingLinesHatch" - this hatching consists of
273 vertical and horizontal lines plus diagonal lines from
274 left, top to bottom, right.
275 * "FourCrossingLinesHatch" - this hatching consists of
276 vertical and horizontal lines plus diagonal lines in both
280 com
::sun
::star
::lang
::XMultiServiceFactory getParametricPolyPolygonFactory
();
282 //-------------------------------------------------------------------------
284 /** Tells whether this graphic device has a full screen mode,
285 i.e. whether a window can cover the whole screen exclusively.
287 boolean hasFullScreenMode
();
289 //-------------------------------------------------------------------------
291 /** Enter or leave the fullscreen mode, if possible. The return
292 value denotes the success of the operation.
294 @attention depending on the underlying operating system,
295 fullscreen mode can be left without a enterFullScreenMode(
298 boolean enterFullScreenMode
( [in] boolean bEnter
);