Kaydet (Commit) f858fa26 authored tarafından Ariel Constenla-Haile's avatar Ariel Constenla-Haile Kaydeden (comit) Caolán McNamara

Related: #i121442# - Extend css::awt::XGraphic to draw images

A StatusbarController that draws its status bar item may need to draw a
graphic representing the feature state. css::awt::XGraphics API should
be extended to include VCL's OuptDevice::DrawImage

(cherry picked from commit 3ca8e86d)

Conflicts:
	offapi/com/sun/star/awt/XGraphics.idl
	offapi/com/sun/star/awt/makefile.mk
	offapi/type_reference/types.rdb
	toolkit/inc/toolkit/awt/vclxgraphics.hxx
	toolkit/source/awt/vclxgraphics.cxx

Change-Id: If2c37022e60e8a3c9fce51dac84f4a2af001b5c5
üst 5dd32f76
...@@ -1723,6 +1723,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt,\ ...@@ -1723,6 +1723,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt,\
FontWidth \ FontWidth \
Gradient \ Gradient \
GradientStyle \ GradientStyle \
ImageDrawMode \
ImageAlign \ ImageAlign \
ImagePosition \ ImagePosition \
ImageScaleMode \ ImageScaleMode \
......
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef __com_sun_star_awt_ImageDrawMode_idl__
#define __com_sun_star_awt_ImageDrawMode_idl__
module com { module sun { module star { module awt {
/** defines modes how an image is drawn onto a device
@see <member scope="com::sun::star::awt">XGraphics2::drawImage</member>
@since LibreOffice 4.1
*/
constants ImageDrawMode
{
/** the image is drawn as is, without any color transformation.
*/
const short NONE = 0x0000;
/** the image is drawn as if it represented a feature whose state is disabled.
*/
const short DISABLE = 0x0001;
/** the image is drawn as being highlighted.
See <member scope="com::sun::star::awt">XStyleSettings::HighlightColor</member>.
*/
const short HIGHLIGHT = 0x0002;
/** the image is drawn as being deactivated.
See <member scope="com::sun::star::awt">XStyleSettings::DeactiveColor</member>.
*/
const short DEACTIVE = 0x0004;
/** the image is drawn semi-transparent.
*/
const short SEMITRANSPARENT = 0x0010;
};
}; }; }; };
#endif
...@@ -20,98 +20,86 @@ ...@@ -20,98 +20,86 @@
#define __com_sun_star_awt_XGraphics_idl__ #define __com_sun_star_awt_XGraphics_idl__
#include <com/sun/star/uno/XInterface.idl> #include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/util/Color.idl> #include <com/sun/star/util/Color.idl>
#include <com/sun/star/awt/SimpleFontMetric.idl> #include <com/sun/star/awt/SimpleFontMetric.idl>
#include <com/sun/star/awt/FontDescriptor.idl> #include <com/sun/star/awt/FontDescriptor.idl>
#include <com/sun/star/awt/RasterOperation.idl> #include <com/sun/star/awt/RasterOperation.idl>
#include <com/sun/star/awt/Gradient.idl> #include <com/sun/star/awt/Gradient.idl>
#include <com/sun/star/awt/Rectangle.idl>
#include <com/sun/star/graphic/XGraphic.idl>
module com { module sun { module star { module awt {
module com { module sun { module star { module awt { published interface XRegion;
published interface XDisplayBitmap;
published interface XRegion; published interface XFont;
published interface XDisplayBitmap; published interface XDevice;
published interface XFont;
published interface XDevice;
/** provides the basic output operation of a device. /** provides the basic output operation of a device.
*/ */
published interface XGraphics: com::sun::star::uno::XInterface published interface XGraphics: com::sun::star::uno::XInterface
{ {
/** the device of this graphics
/** returns the device of this graphics.
*/ */
XDevice getDevice(); [attribute, readonly] XDevice Device;
/** the text color used by text operations.
/** returns the font metric of the current font.
*/ */
SimpleFontMetric getFontMetric(); [attribute] com::sun::star::util::Color TextColor;
/** sets the font used by text operations. /** the fill color used by text operations.
*/ */
void setFont( [in] XFont xNewFont ); [attribute] com::sun::star::util::Color TextFillColor;
/** creates a new font and sets the font. /** the line color.
*/ */
void selectFont( [in] FontDescriptor aDescription ); [attribute] com::sun::star::util::Color LineColor;
/** sets the text color used by text operations. /** the fill color.
*/ */
void setTextColor( [in] com::sun::star::util::Color nColor ); [attribute] com::sun::star::util::Color FillColor;
/** the raster operation.
/** sets the fill color used by text operations. <p>If the device does not support raster operations,
this attribute is ignored.</p>
*/ */
void setTextFillColor( [in] com::sun::star::util::Color nColor ); [attribute] RasterOperation RasterOp;
/** the font used by text operations.
/** sets the line color.
*/ */
void setLineColor( [in] com::sun::star::util::Color nColor ); [attribute] XFont Font;
/** sets the fill color. /** the font metric of the current font.
*/ */
void setFillColor( [in] com::sun::star::util::Color nColor ); [attribute, readonly] SimpleFontMetric FontMetric;
/** sets the raster operation.
<p>If the device does not support raster operations /** creates a new font and sets the font.
then this call is ignored.</p>
*/ */
void setRasterOp( [in] RasterOperation ROP ); void selectFont( [in] FontDescriptor aDescription );
/** sets the clip region to specified clipping. /** sets the clip region to specified clipping.
*/ */
void setClipRegion( [in] XRegion Clipping ); void setClipRegion( [in] XRegion Clipping );
/** builds the intersection with the current region. /** builds the intersection with the current region.
*/ */
void intersectClipRegion( [in] XRegion xClipping ); void intersectClipRegion( [in] XRegion xClipping );
/** saves all current settings (Font, TextColor, TextFillColor, /** saves all current settings (Font, TextColor, TextFillColor,
LineColor, FillColor, RasterOp, ClipRegion). LineColor, FillColor, RasterOp, ClipRegion).
*/ */
void push(); void push();
/** restores all previous saved settings. /** restores all previous saved settings.
*/ */
void pop(); void pop();
/** clears the given rectangle on the device
@since LibreOffice 4.1
*/
void clear( [in] Rectangle aRect );
/** copies a rectangle of pixels from another device into this one. /** copies a rectangle of pixels from another device into this one.
*/ */
...@@ -125,7 +113,6 @@ published interface XGraphics: com::sun::star::uno::XInterface ...@@ -125,7 +113,6 @@ published interface XGraphics: com::sun::star::uno::XInterface
[in] long nDestWidth, [in] long nDestWidth,
[in] long nDestHeight ); [in] long nDestHeight );
/** draws a part of the specified bitmap to the output device. /** draws a part of the specified bitmap to the output device.
*/ */
void draw( [in] XDisplayBitmap xBitmapHandle, void draw( [in] XDisplayBitmap xBitmapHandle,
...@@ -138,13 +125,11 @@ published interface XGraphics: com::sun::star::uno::XInterface ...@@ -138,13 +125,11 @@ published interface XGraphics: com::sun::star::uno::XInterface
[in] long DestWidth, [in] long DestWidth,
[in] long DestHeight ); [in] long DestHeight );
/** sets a single pixel in the output device. /** sets a single pixel in the output device.
*/ */
void drawPixel( [in] long X, void drawPixel( [in] long X,
[in] long Y ); [in] long Y );
/** draws a line in the output device. /** draws a line in the output device.
*/ */
void drawLine( [in] long X1, void drawLine( [in] long X1,
...@@ -152,7 +137,6 @@ published interface XGraphics: com::sun::star::uno::XInterface ...@@ -152,7 +137,6 @@ published interface XGraphics: com::sun::star::uno::XInterface
[in] long X2, [in] long X2,
[in] long Y2 ); [in] long Y2 );
/** draws a rectangle in the output device. /** draws a rectangle in the output device.
*/ */
void drawRect( [in] long X, void drawRect( [in] long X,
...@@ -160,7 +144,6 @@ published interface XGraphics: com::sun::star::uno::XInterface ...@@ -160,7 +144,6 @@ published interface XGraphics: com::sun::star::uno::XInterface
[in] long Width, [in] long Width,
[in] long Height ); [in] long Height );
/** draws a rectangle with rounded corners in the output device. /** draws a rectangle with rounded corners in the output device.
*/ */
void drawRoundedRect( [in] long X, void drawRoundedRect( [in] long X,
...@@ -170,25 +153,21 @@ published interface XGraphics: com::sun::star::uno::XInterface ...@@ -170,25 +153,21 @@ published interface XGraphics: com::sun::star::uno::XInterface
[in] long nHorzRound, [in] long nHorzRound,
[in] long nVertRound ); [in] long nVertRound );
/** draws multiple lines in the output device at once. /** draws multiple lines in the output device at once.
*/ */
void drawPolyLine( [in] sequence<long> DataX, void drawPolyLine( [in] sequence<long> DataX,
[in] sequence<long> DataY ); [in] sequence<long> DataY );
/** draws a polygon line in the output device. /** draws a polygon line in the output device.
*/ */
void drawPolygon( [in] sequence<long> DataX, void drawPolygon( [in] sequence<long> DataX,
[in] sequence<long> DataY ); [in] sequence<long> DataY );
/** draws multiple polygons in the output device at once. /** draws multiple polygons in the output device at once.
*/ */
void drawPolyPolygon( [in] sequence< sequence<long> > DataX, void drawPolyPolygon( [in] sequence< sequence<long> > DataX,
[in] sequence< sequence<long> > DataY ); [in] sequence< sequence<long> > DataY );
/** draws an ellipse in the output device. /** draws an ellipse in the output device.
*/ */
void drawEllipse( [in] long X, void drawEllipse( [in] long X,
...@@ -196,7 +175,6 @@ published interface XGraphics: com::sun::star::uno::XInterface ...@@ -196,7 +175,6 @@ published interface XGraphics: com::sun::star::uno::XInterface
[in] long Width, [in] long Width,
[in] long Height ); [in] long Height );
/** draws an arc (part of a circle) in the output device. /** draws an arc (part of a circle) in the output device.
*/ */
void drawArc( [in] long X, void drawArc( [in] long X,
...@@ -208,7 +186,6 @@ published interface XGraphics: com::sun::star::uno::XInterface ...@@ -208,7 +186,6 @@ published interface XGraphics: com::sun::star::uno::XInterface
[in] long X2, [in] long X2,
[in] long Y2 ); [in] long Y2 );
/** draws a circular area in the output device. /** draws a circular area in the output device.
*/ */
void drawPie( [in] long X, void drawPie( [in] long X,
...@@ -220,7 +197,6 @@ published interface XGraphics: com::sun::star::uno::XInterface ...@@ -220,7 +197,6 @@ published interface XGraphics: com::sun::star::uno::XInterface
[in] long X2, [in] long X2,
[in] long Y2 ); [in] long Y2 );
/** draws a chord of a circular area in the output device. /** draws a chord of a circular area in the output device.
<p>A chord is a segment of a circle. You get two chords from a <p>A chord is a segment of a circle. You get two chords from a
...@@ -236,7 +212,6 @@ published interface XGraphics: com::sun::star::uno::XInterface ...@@ -236,7 +212,6 @@ published interface XGraphics: com::sun::star::uno::XInterface
[in] long nX2, [in] long nX2,
[in] long nY2 ); [in] long nY2 );
/** draws a color dispersion in the output device. /** draws a color dispersion in the output device.
*/ */
void drawGradient( [in] long nX, void drawGradient( [in] long nX,
...@@ -245,14 +220,12 @@ published interface XGraphics: com::sun::star::uno::XInterface ...@@ -245,14 +220,12 @@ published interface XGraphics: com::sun::star::uno::XInterface
[in] long Height, [in] long Height,
[in] Gradient aGradient ); [in] Gradient aGradient );
/** draws text in the output device. /** draws text in the output device.
*/ */
void drawText( [in] long X, void drawText( [in] long X,
[in] long Y, [in] long Y,
[in] string Text ); [in] string Text );
/** draws texts in the output device using an explicit kerning table. /** draws texts in the output device using an explicit kerning table.
*/ */
void drawTextArray( [in] long X, void drawTextArray( [in] long X,
...@@ -260,8 +233,41 @@ published interface XGraphics: com::sun::star::uno::XInterface ...@@ -260,8 +233,41 @@ published interface XGraphics: com::sun::star::uno::XInterface
[in] string Text, [in] string Text,
[in] sequence<long> Longs ); [in] sequence<long> Longs );
}; /** draws a <type scope="com::sun::star::graphic">XGraphic</type>
in the output device.
<p>Note that some devices may not support this operation.</p>
@since LibreOffice 4.1
@param nX
the X coordinate on the device where the graphic will be drawn
@param nY
the Y coordinate on the device where the graphic will be drawn
@param nWidth
the width of the region on the device
@param nHeight
the height of the region on the device
@param nStyle
the style used to draw the image.
See <type scope="com::sun::star::awt">ImageDrawMode</type>.
@param aGraphic
the <type scope="com::sun::star::graphic">XGraphic</type>
to be drawn onto the device
*/
void drawImage( [in] long nX,
[in] long nY,
[in] long nWidth,
[in] long nHeight,
[in] short nStyle,
[in] ::com::sun::star::graphic::XGraphic aGraphic );
};
}; }; }; }; }; }; }; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment