openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arie...@apache.org
Subject svn commit: r1417847 - in /openoffice/trunk/main: offapi/com/sun/star/awt/ offapi/type_reference/ toolkit/inc/toolkit/awt/ toolkit/source/awt/
Date Thu, 06 Dec 2012 13:28:13 GMT
Author: arielch
Date: Thu Dec  6 13:28:11 2012
New Revision: 1417847

URL: http://svn.apache.org/viewvc?rev=1417847&view=rev
Log:
#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.

Added:
    openoffice/trunk/main/offapi/com/sun/star/awt/ImageDrawMode.idl
Modified:
    openoffice/trunk/main/offapi/com/sun/star/awt/XGraphics.idl
    openoffice/trunk/main/offapi/com/sun/star/awt/makefile.mk
    openoffice/trunk/main/offapi/type_reference/types.rdb
    openoffice/trunk/main/toolkit/inc/toolkit/awt/vclxgraphics.hxx
    openoffice/trunk/main/toolkit/source/awt/vclxgraphics.cxx

Added: openoffice/trunk/main/offapi/com/sun/star/awt/ImageDrawMode.idl
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/awt/ImageDrawMode.idl?rev=1417847&view=auto
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/awt/ImageDrawMode.idl (added)
+++ openoffice/trunk/main/offapi/com/sun/star/awt/ImageDrawMode.idl Thu Dec  6 13:28:11 2012
@@ -0,0 +1,59 @@
+/**************************************************************
+ *
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#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 Apache OpenOffice 4.0
+ */
+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

Modified: openoffice/trunk/main/offapi/com/sun/star/awt/XGraphics.idl
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/awt/XGraphics.idl?rev=1417847&r1=1417846&r2=1417847&view=diff
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/awt/XGraphics.idl (original)
+++ openoffice/trunk/main/offapi/com/sun/star/awt/XGraphics.idl Thu Dec  6 13:28:11 2012
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * 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
@@ -7,311 +7,271 @@
  * 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
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
+#ifndef __com_sun_star_awt_XGraphics_idl__
+#define __com_sun_star_awt_XGraphics_idl__
 
-#ifndef __com_sun_star_awt_XGraphics_idl__ 
-#define __com_sun_star_awt_XGraphics_idl__ 
- 
-#ifndef __com_sun_star_uno_XInterface_idl__ 
-#include <com/sun/star/uno/XInterface.idl> 
-#endif 
- 
-#ifndef __com_sun_star_util_Color_idl__
+#include <com/sun/star/uno/XInterface.idl>
 #include <com/sun/star/util/Color.idl>
-#endif
+#include <com/sun/star/awt/SimpleFontMetric.idl>
+#include <com/sun/star/awt/FontDescriptor.idl>
+#include <com/sun/star/awt/RasterOperation.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 {
+
+published interface XRegion;
+published interface XDisplayBitmap;
+published interface XFont;
+published interface XDevice;
 
-#ifndef __com_sun_star_awt_SimpleFontMetric_idl__ 
-#include <com/sun/star/awt/SimpleFontMetric.idl> 
-#endif 
- 
-#ifndef __com_sun_star_awt_FontDescriptor_idl__ 
-#include <com/sun/star/awt/FontDescriptor.idl> 
-#endif 
- 
-#ifndef __com_sun_star_awt_RasterOperation_idl__ 
-#include <com/sun/star/awt/RasterOperation.idl> 
-#endif 
- 
-#ifndef __com_sun_star_awt_Gradient_idl__ 
-#include <com/sun/star/awt/Gradient.idl> 
-#endif 
- 
-//============================================================================= 
- 
- module com {  module sun {  module star {  module awt {  
- 
- published interface XRegion; 
- published interface XDisplayBitmap; 
- published interface XFont; 
- published interface XDevice; 
- 
-//============================================================================= 
- 
 /** provides the basic output operation of a device.
  */
 published interface XGraphics: com::sun::star::uno::XInterface
-{ 
-	//------------------------------------------------------------------------- 
-	 
-	/** returns the device of this graphics.
-	 */
-	XDevice getDevice(); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** returns the font metric of the current font.
-	 */
-	SimpleFontMetric getFontMetric(); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** sets the font used by text operations.
-	 */
-	[oneway] void setFont( [in] XFont xNewFont ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** creates a new font and sets the font.
-	 */
-	[oneway] void selectFont( [in] FontDescriptor aDescription ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** sets the text color used by text operations.
-	 */
-	[oneway] void setTextColor( [in] com::sun::star::util::Color nColor ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** sets the fill color used by text operations.
-	 */
-	[oneway] void setTextFillColor( [in] com::sun::star::util::Color nColor ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** sets the line color.
-	 */
-	[oneway] void setLineColor( [in] com::sun::star::util::Color nColor ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** sets the fill color.
-	 */
-	[oneway] void setFillColor( [in] com::sun::star::util::Color nColor ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** sets the raster operation. 
-						
-		<p>If the device does not support raster operations 
-		then this call is ignored.</p>
-	 */
-	[oneway] void setRasterOp( [in] RasterOperation ROP ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** sets the clip region to specified clipping.
-	 */
-	[oneway] void setClipRegion( [in] XRegion Clipping ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** builds the intersection with the current region.
-	 */
-	[oneway] void intersectClipRegion( [in] XRegion xClipping ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** saves all current settings (Font, TextColor, TextFillColor,
-		LineColor, FillColor, RasterOp, ClipRegion).
-	 */
-	[oneway] void push(); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** restores all previous saved settings.
-	 */
-	[oneway] void pop(); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** copies a rectangle of pixels from another device into this one.
-	 */
-	[oneway] void copy( [in] XDevice xSource, 
-			 [in] long nSourceX, 
-			 [in] long nSourceY, 
-			 [in] long nSourceWidth, 
-			 [in] long nSourceHeight, 
-			 [in] long nDestX, 
-			 [in] long nDestY, 
-			 [in] long nDestWidth, 
-			 [in] long nDestHeight ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** draws a part of the specified bitmap to the output device.
-	 */
-	[oneway] void draw( [in] XDisplayBitmap xBitmapHandle, 
-			 [in] long SourceX, 
-			 [in] long SourceY, 
-			 [in] long SourceWidth, 
-			 [in] long SourceHeight, 
-			 [in] long DestX, 
-			 [in] long DestY, 
-			 [in] long DestWidth, 
-			 [in] long DestHeight ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** sets a single pixel in the output device.
-	 */
-	[oneway] void drawPixel( [in] long X, 
-			 [in] long Y ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** draws a line in the output device.
-	 */
-	[oneway] void drawLine( [in] long X1, 
-			 [in] long Y1, 
-			 [in] long X2, 
-			 [in] long Y2 ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** draws a rectangle in the output device.
-	 */
-	[oneway] void drawRect( [in] long X, 
-			 [in] long Y, 
-			 [in] long Width, 
-			 [in] long Height ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** draws a rectangle with rounded corners in the output device.
-	 */
-	[oneway] void drawRoundedRect( [in] long X, 
-			 [in] long Y, 
-			 [in] long Width, 
-			 [in] long Height, 
-			 [in] long nHorzRound, 
-			 [in] long nVertRound ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** draws multiple lines in the output device at once.
-	 */
-	[oneway] void drawPolyLine( [in] sequence<long> DataX, 
-			 [in] sequence<long> DataY ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** draws a polygon line in the output device.
-	 */
-	[oneway] void drawPolygon( [in] sequence<long> DataX, 
-			 [in] sequence<long> DataY ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** draws multiple polygons in the output device at once.
-	 */
-	[oneway] void drawPolyPolygon( [in] sequence< sequence<long> > DataX, 
-			 [in] sequence< sequence<long> > DataY ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** draws an ellipse in the output device.
-	 */
-	[oneway] void drawEllipse( [in] long X, 
-			 [in] long Y, 
-			 [in] long Width, 
-			 [in] long Height ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** draws an arc (part of a circle) in the output device.
-	 */
-	[oneway] void drawArc( [in] long X, 
-			 [in] long Y, 
-			 [in] long Width, 
-			 [in] long Height, 
-			 [in] long X1, 
-			 [in] long Y1, 
-			 [in] long X2, 
-			 [in] long Y2 ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** draws a circular area in the output device.
-	 */
-	[oneway] void drawPie( [in] long X, 
-			 [in] long Y, 
-			 [in] long Width, 
-			 [in] long Height, 
-			 [in] long X1, 
-			 [in] long Y1, 
-			 [in] long X2, 
-			 [in] long Y2 ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** 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 
-		circle if you intersect the circle with a straight line 
-		joining two points on the circle.</p>
-	 */
-	[oneway] void drawChord( [in] long nX, 
-			 [in] long nY, 
-			 [in] long nWidth, 
-			 [in] long nHeight, 
-			 [in] long nX1, 
-			 [in] long nY1, 
-			 [in] long nX2, 
-			 [in] long nY2 ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** draws a color dispersion in the output device.
-	 */
-	[oneway] void drawGradient( [in] long nX, 
-			 [in] long nY, 
-			 [in] long nWidth, 
-			 [in] long Height, 
-			 [in] Gradient aGradient ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** draws text in the output device.
-	 */
-	[oneway] void drawText( [in] long X, 
-			 [in] long Y, 
-			 [in] string Text ); 
- 
-	//------------------------------------------------------------------------- 
-	 
-	/** draws texts in the output device using an explicit kerning table.
-	 */
-	[oneway] void drawTextArray( [in] long X, 
-			 [in] long Y, 
-			 [in] string Text, 
-			 [in] sequence<long> Longs ); 
- 
-}; 
- 
-//============================================================================= 
- 
-}; }; }; };  
- 
-#endif 
+{
+    /** the device of this graphics
+     */
+    [attribute, readonly] XDevice Device;
+
+    /** the text color used by text operations.
+     */
+    [attribute] com::sun::star::util::Color TextColor;
+
+    /** the fill color used by text operations.
+     */
+    [attribute] com::sun::star::util::Color TextFillColor;
+
+    /** the line color.
+     */
+    [attribute] com::sun::star::util::Color LineColor;
+
+    /** the fill color.
+     */
+    [attribute] com::sun::star::util::Color FillColor;
+
+    /** the raster operation.
+
+        <p>If the device does not support raster operations,
+        this attribute is ignored.</p>
+     */
+    [attribute] RasterOperation RasterOp;
+
+    /** the font used by text operations.
+     */
+    [attribute] XFont Font;
+
+    /** the font metric of the current font.
+     */
+    [attribute, readonly] SimpleFontMetric FontMetric;
+
+    /** creates a new font and sets the font.
+     */
+    [oneway] void selectFont( [in] FontDescriptor aDescription );
+
+    /** sets the clip region to specified clipping.
+     */
+    [oneway] void setClipRegion( [in] XRegion Clipping );
+ 
+    /** builds the intersection with the current region.
+     */
+    [oneway] void intersectClipRegion( [in] XRegion xClipping );
+
+    /** saves all current settings (Font, TextColor, TextFillColor,
+        LineColor, FillColor, RasterOp, ClipRegion).
+     */
+    [oneway] void push();
+
+    /** restores all previous saved settings.
+     */
+    [oneway] void pop();
+
+    /** clears the given rectangle on the device
+
+        @since Apache OpenOffice 4.0
+     */
+    [oneway] void clear( [in] Rectangle aRect );
+
+    /** copies a rectangle of pixels from another device into this one.
+     */
+    [oneway] void copy( [in] XDevice xSource,
+             [in] long nSourceX,
+             [in] long nSourceY,
+             [in] long nSourceWidth,
+             [in] long nSourceHeight,
+             [in] long nDestX,
+             [in] long nDestY,
+             [in] long nDestWidth,
+             [in] long nDestHeight );
+
+    /** draws a part of the specified bitmap to the output device.
+     */
+    [oneway] void draw( [in] XDisplayBitmap xBitmapHandle,
+             [in] long SourceX,
+             [in] long SourceY,
+             [in] long SourceWidth,
+             [in] long SourceHeight,
+             [in] long DestX,
+             [in] long DestY,
+             [in] long DestWidth,
+             [in] long DestHeight );
+
+    /** sets a single pixel in the output device.
+     */
+    [oneway] void drawPixel( [in] long X,
+             [in] long Y );
+
+    /** draws a line in the output device.
+     */
+    [oneway] void drawLine( [in] long X1,
+             [in] long Y1,
+             [in] long X2,
+             [in] long Y2 );
+
+    /** draws a rectangle in the output device.
+     */
+    [oneway] void drawRect( [in] long X,
+             [in] long Y,
+             [in] long Width,
+             [in] long Height );
+
+    /** draws a rectangle with rounded corners in the output device.
+     */
+    [oneway] void drawRoundedRect( [in] long X,
+             [in] long Y,
+             [in] long Width,
+             [in] long Height,
+             [in] long nHorzRound,
+             [in] long nVertRound );
+
+    /** draws multiple lines in the output device at once.
+     */
+    [oneway] void drawPolyLine( [in] sequence<long> DataX,
+             [in] sequence<long> DataY );
+
+    /** draws a polygon line in the output device.
+     */
+    [oneway] void drawPolygon( [in] sequence<long> DataX,
+             [in] sequence<long> DataY );
+
+    /** draws multiple polygons in the output device at once.
+     */
+    [oneway] void drawPolyPolygon( [in] sequence< sequence<long> > DataX,
+             [in] sequence< sequence<long> > DataY );
+
+    /** draws an ellipse in the output device.
+     */
+    [oneway] void drawEllipse( [in] long X,
+             [in] long Y,
+             [in] long Width,
+             [in] long Height );
+
+    /** draws an arc (part of a circle) in the output device.
+     */
+    [oneway] void drawArc( [in] long X,
+             [in] long Y,
+             [in] long Width,
+             [in] long Height,
+             [in] long X1,
+             [in] long Y1,
+             [in] long X2,
+             [in] long Y2 );
+
+    /** draws a circular area in the output device.
+     */
+    [oneway] void drawPie( [in] long X,
+             [in] long Y,
+             [in] long Width,
+             [in] long Height,
+             [in] long X1,
+             [in] long Y1,
+             [in] long X2,
+             [in] long Y2 );
+
+    /** 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
+        circle if you intersect the circle with a straight line
+        joining two points on the circle.</p>
+     */
+    [oneway] void drawChord( [in] long nX,
+             [in] long nY,
+             [in] long nWidth,
+             [in] long nHeight,
+             [in] long nX1,
+             [in] long nY1,
+             [in] long nX2,
+             [in] long nY2 );
+
+    /** draws a color dispersion in the output device.
+     */
+    [oneway] void drawGradient( [in] long nX,
+             [in] long nY,
+             [in] long nWidth,
+             [in] long Height,
+             [in] Gradient aGradient );
+
+    /** draws text in the output device.
+     */
+    [oneway] void drawText( [in] long X,
+             [in] long Y,
+             [in] string Text );
+
+    /** draws texts in the output device using an explicit kerning table.
+     */
+    [oneway] void drawTextArray( [in] long X,
+             [in] long Y,
+             [in] string Text,
+             [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 Apache OpenOffice 4.0
+
+        @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
+     */
+    [oneway] void drawImage( [in] long nX,
+                             [in] long nY,
+                             [in] long nWidth,
+                             [in] long nHeight,
+                             [in] short nStyle,
+                             [in] ::com::sun::star::graphic::XGraphic aGraphic );
+
+};
+
+}; }; }; };
+
+#endif

Modified: openoffice/trunk/main/offapi/com/sun/star/awt/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/awt/makefile.mk?rev=1417847&r1=1417846&r2=1417847&view=diff
==============================================================================
--- openoffice/trunk/main/offapi/com/sun/star/awt/makefile.mk (original)
+++ openoffice/trunk/main/offapi/com/sun/star/awt/makefile.mk Thu Dec  6 13:28:11 2012
@@ -100,6 +100,7 @@ IDLFILES=\
 	Gradient.idl\
 	GradientStyle.idl\
     ImageAlign.idl\
+    ImageDrawMode.idl\
     ImagePosition.idl\
     ImageScaleMode.idl\
     ImageStatus.idl\

Modified: openoffice/trunk/main/offapi/type_reference/types.rdb
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/type_reference/types.rdb?rev=1417847&r1=1417846&r2=1417847&view=diff
==============================================================================
Binary files - no diff available.

Modified: openoffice/trunk/main/toolkit/inc/toolkit/awt/vclxgraphics.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/toolkit/inc/toolkit/awt/vclxgraphics.hxx?rev=1417847&r1=1417846&r2=1417847&view=diff
==============================================================================
--- openoffice/trunk/main/toolkit/inc/toolkit/awt/vclxgraphics.hxx (original)
+++ openoffice/trunk/main/toolkit/inc/toolkit/awt/vclxgraphics.hxx Thu Dec  6 13:28:11 2012
@@ -26,6 +26,7 @@
 
 
 #include <com/sun/star/awt/XGraphics.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
 #include <com/sun/star/lang/XTypeProvider.hpp>
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <cppuhelper/weak.hxx>
@@ -50,7 +51,7 @@ class Region;
 //	class VCLXGraphics
 //	----------------------------------------------------
 
-class VCLXGraphics :	public ::com::sun::star::awt::XGraphics, 
+class VCLXGraphics :	public ::com::sun::star::awt::XGraphics,
 						public ::com::sun::star::lang::XTypeProvider,
 						public ::com::sun::star::lang::XUnoTunnel,
 						public ::cppu::OWeakObject
@@ -68,6 +69,8 @@ private:
 	RasterOp		meRasterOp;
 	Region*			mpClipRegion;
 
+    void initAttrs();
+
 protected:
 	vos::IMutex&	GetMutex() { return mrMutex; }
 
@@ -97,36 +100,47 @@ public:	
 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >	SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
 	::com::sun::star::uno::Sequence< sal_Int8 >						SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
 
-	// ::com::sun::star::awt::XGraphics
-    ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice >	SAL_CALL getDevice(  ) throw(::com::sun::star::uno::RuntimeException);
-    ::com::sun::star::awt::SimpleFontMetric								SAL_CALL getFontMetric() throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL setFont( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont >& xNewFont ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL selectFont( const ::com::sun::star::awt::FontDescriptor& aDescription ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL setTextColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL setTextFillColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL setLineColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL setFillColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL setRasterOp( ::com::sun::star::awt::RasterOperation ROP ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL setClipRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& Clipping ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL intersectClipRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& xClipping ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL push(  ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL pop(  ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL copy( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice >& xSource, sal_Int32 nSourceX, sal_Int32 nSourceY, sal_Int32 nSourceWidth, sal_Int32 nSourceHeight, sal_Int32 nDestX, sal_Int32 nDestY, sal_Int32 nDestWidth, sal_Int32 nDestHeight ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL draw( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayBitmap >& xBitmapHandle, sal_Int32 SourceX, sal_Int32 SourceY, sal_Int32 SourceWidth, sal_Int32 SourceHeight, sal_Int32 DestX, sal_Int32 DestY, sal_Int32 DestWidth, sal_Int32 DestHeight ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawPixel( sal_Int32 X, sal_Int32 Y ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawLine( sal_Int32 X1, sal_Int32 Y1, sal_Int32 X2, sal_Int32 Y2 ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawRect( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawRoundedRect( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int32 nHorzRound, sal_Int32 nVertRound ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawPolyLine( const ::com::sun::star::uno::Sequence< sal_Int32 >& DataX, const ::com::sun::star::uno::Sequence< sal_Int32 >& DataY ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawPolygon( const ::com::sun::star::uno::Sequence< sal_Int32 >& DataX, const ::com::sun::star::uno::Sequence< sal_Int32 >& DataY ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawPolyPolygon( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int32 > >& DataX, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int32 > >& DataY ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawEllipse( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawArc( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int32 X1, sal_Int32 Y1, sal_Int32 X2, sal_Int32 Y2 ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawPie( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int32 X1, sal_Int32 Y1, sal_Int32 X2, sal_Int32 Y2 ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawChord( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2 ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawGradient( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 Height, const ::com::sun::star::awt::Gradient& aGradient ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawText( sal_Int32 X, sal_Int32 Y, const ::rtl::OUString& Text ) throw(::com::sun::star::uno::RuntimeException);
-    void		SAL_CALL drawTextArray( sal_Int32 X, sal_Int32 Y, const ::rtl::OUString& Text, const ::com::sun::star::uno::Sequence< sal_Int32 >& Longs ) throw(::com::sun::star::uno::RuntimeException);
+    // ::com::sun::star::awt::XGraphics Attributes
+    virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL getDevice() throw (::com::sun::star::uno::RuntimeException);
+    virtual ::sal_Int32 SAL_CALL getTextColor() throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setTextColor( ::sal_Int32 _textcolor ) throw (::com::sun::star::uno::RuntimeException);
+    virtual ::sal_Int32 SAL_CALL getTextFillColor() throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setTextFillColor( ::sal_Int32 _textfillcolor ) throw (::com::sun::star::uno::RuntimeException);
+    virtual ::sal_Int32 SAL_CALL getLineColor() throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setLineColor( ::sal_Int32 _linecolor ) throw (::com::sun::star::uno::RuntimeException);
+    virtual ::sal_Int32 SAL_CALL getFillColor() throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setFillColor( ::sal_Int32 _fillcolor ) throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::awt::RasterOperation SAL_CALL getRasterOp() throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setRasterOp( ::com::sun::star::awt::RasterOperation _rasterop ) throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont() throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setFont( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont >& _font ) throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::awt::SimpleFontMetric SAL_CALL getFontMetric() throw (::com::sun::star::uno::RuntimeException);
+
+    // ::com::sun::star::awt::XGraphics Methods
+    virtual void SAL_CALL selectFont( const ::com::sun::star::awt::FontDescriptor& aDescription ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL setClipRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& Clipping ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL intersectClipRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& xClipping ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL push(  ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL pop(  ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL clear( const ::com::sun::star::awt::Rectangle& aRect ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL copy( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice >& xSource, ::sal_Int32 nSourceX, ::sal_Int32 nSourceY, ::sal_Int32 nSourceWidth, ::sal_Int32 nSourceHeight, ::sal_Int32 nDestX, ::sal_Int32 nDestY, ::sal_Int32 nDestWidth, ::sal_Int32 nDestHeight ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL draw( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayBitmap >& xBitmapHandle, ::sal_Int32 SourceX, ::sal_Int32 SourceY, ::sal_Int32 SourceWidth, ::sal_Int32 SourceHeight, ::sal_Int32 DestX, ::sal_Int32 DestY, ::sal_Int32 DestWidth, ::sal_Int32 DestHeight ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawPixel( ::sal_Int32 X, ::sal_Int32 Y ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawLine( ::sal_Int32 X1, ::sal_Int32 Y1, ::sal_Int32 X2, ::sal_Int32 Y2 ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawRect( ::sal_Int32 X, ::sal_Int32 Y, ::sal_Int32 Width, ::sal_Int32 Height ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawRoundedRect( ::sal_Int32 X, ::sal_Int32 Y, ::sal_Int32 Width, ::sal_Int32 Height, ::sal_Int32 nHorzRound, ::sal_Int32 nVertRound ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawPolyLine( const ::com::sun::star::uno::Sequence< ::sal_Int32 >& DataX, const ::com::sun::star::uno::Sequence< ::sal_Int32 >& DataY ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawPolygon( const ::com::sun::star::uno::Sequence< ::sal_Int32 >& DataX, const ::com::sun::star::uno::Sequence< ::sal_Int32 >& DataY ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawPolyPolygon( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::sal_Int32 > >& DataX, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::sal_Int32 > >& DataY ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawEllipse( ::sal_Int32 X, ::sal_Int32 Y, ::sal_Int32 Width, ::sal_Int32 Height ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawArc( ::sal_Int32 X, ::sal_Int32 Y, ::sal_Int32 Width, ::sal_Int32 Height, ::sal_Int32 X1, ::sal_Int32 Y1, ::sal_Int32 X2, ::sal_Int32 Y2 ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawPie( ::sal_Int32 X, ::sal_Int32 Y, ::sal_Int32 Width, ::sal_Int32 Height, ::sal_Int32 X1, ::sal_Int32 Y1, ::sal_Int32 X2, ::sal_Int32 Y2 ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawChord( ::sal_Int32 nX, ::sal_Int32 nY, ::sal_Int32 nWidth, ::sal_Int32 nHeight, ::sal_Int32 nX1, ::sal_Int32 nY1, ::sal_Int32 nX2, ::sal_Int32 nY2 ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawGradient( ::sal_Int32 nX, ::sal_Int32 nY, ::sal_Int32 nWidth, ::sal_Int32 Height, const ::com::sun::star::awt::Gradient& aGradient ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawText( ::sal_Int32 X, ::sal_Int32 Y, const ::rtl::OUString& Text ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawTextArray( ::sal_Int32 X, ::sal_Int32 Y, const ::rtl::OUString& Text, const ::com::sun::star::uno::Sequence< ::sal_Int32 >& Longs ) throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL drawImage( ::sal_Int32 nX, ::sal_Int32 nY, ::sal_Int32 nWidth, ::sal_Int32 nHeight, ::sal_Int16 nStyle, const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& aGraphic ) throw (::com::sun::star::uno::RuntimeException);
+
 };
 
 

Modified: openoffice/trunk/main/toolkit/source/awt/vclxgraphics.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/toolkit/source/awt/vclxgraphics.cxx?rev=1417847&r1=1417846&r2=1417847&view=diff
==============================================================================
--- openoffice/trunk/main/toolkit/source/awt/vclxgraphics.cxx (original)
+++ openoffice/trunk/main/toolkit/source/awt/vclxgraphics.cxx Thu Dec  6 13:28:11 2012
@@ -26,6 +26,7 @@
 
 #include <toolkit/awt/vclxgraphics.hxx>
 #include <toolkit/awt/vclxdevice.hxx>
+#include <toolkit/awt/vclxfont.hxx>
 #include <toolkit/helper/macros.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 #include <cppuhelper/typeprovider.hxx>
@@ -34,30 +35,32 @@
 
 #include <vcl/svapp.hxx>
 #include <vcl/outdev.hxx>
+#include <vcl/image.hxx>
 #include <vcl/gradient.hxx>
 #include <tools/debug.hxx>
 
+using namespace com::sun::star;
 
 //	----------------------------------------------------
 //	class VCLXGraphics
 //	----------------------------------------------------
 
-// ::com::sun::star::uno::XInterface
-::com::sun::star::uno::Any VCLXGraphics::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
+// uno::XInterface
+uno::Any VCLXGraphics::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException)
 {
-	::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
-										SAL_STATIC_CAST( ::com::sun::star::awt::XGraphics*, this ),
-										SAL_STATIC_CAST( ::com::sun::star::lang::XTypeProvider*, this ),
-										SAL_STATIC_CAST( ::com::sun::star::lang::XUnoTunnel*, this ) );
+	uno::Any aRet = ::cppu::queryInterface( rType,
+										SAL_STATIC_CAST( awt::XGraphics*, this ),
+										SAL_STATIC_CAST( lang::XTypeProvider*, this ),
+										SAL_STATIC_CAST( lang::XUnoTunnel*, this ) );
 	return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ));
 }
 
-// ::com::sun::star::lang::XUnoTunnel
+// lang::XUnoTunnel
 IMPL_XUNOTUNNEL( VCLXGraphics )
 
-// ::com::sun::star::lang::XTypeProvider
+// lang::XTypeProvider
 IMPL_XTYPEPROVIDER_START( VCLXGraphics )
-	getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics>* ) NULL )
+	getCppuType( ( uno::Reference< awt::XGraphics>* ) NULL )
 IMPL_XTYPEPROVIDER_END
 
 VCLXGraphics::VCLXGraphics() : mrMutex( Application::GetSolarMutex() )
@@ -79,6 +82,7 @@ void VCLXGraphics::SetOutputDevice( Outp
 { 
 	mpOutputDevice = pOutDev; 
 	mxDevice = NULL;
+    initAttrs();
 }
 
 void VCLXGraphics::Init( OutputDevice* pOutDev )
@@ -86,13 +90,8 @@ void VCLXGraphics::Init( OutputDevice* p
 	DBG_ASSERT( !mpOutputDevice, "VCLXGraphics::Init allready has pOutDev !" );
 	mpOutputDevice 	= pOutDev;
 
-	maFont 			= mpOutputDevice->GetFont();
-	maTextColor 	= COL_BLACK;
-	maTextFillColor = COL_TRANSPARENT;
-	maLineColor 	= COL_BLACK;
-	maFillColor 	= COL_WHITE;
-	meRasterOp 		= ROP_OVERPAINT;
-	mpClipRegion 	= NULL;
+    initAttrs();
+    mpClipRegion    = NULL;
 
 	// Register at OutputDevice
 	List* pLst = mpOutputDevice->GetUnoGraphicsList();
@@ -101,6 +100,19 @@ void VCLXGraphics::Init( OutputDevice* p
 	pLst->Insert( this, LIST_APPEND );
 }
 
+void VCLXGraphics::initAttrs()
+{
+    if ( !mpOutputDevice )
+        return;
+
+    maFont          = mpOutputDevice->GetFont();
+    maTextColor     = mpOutputDevice->GetTextColor(); /* COL_BLACK */
+    maTextFillColor = mpOutputDevice->GetTextFillColor(); /* COL_TRANSPARENT */
+    maLineColor     = mpOutputDevice->GetLineColor(); /* COL_BLACK */
+    maFillColor     = mpOutputDevice->GetFillColor(); /* COL_WHITE */
+    meRasterOp      = mpOutputDevice->GetRasterOp(); /* ROP_OVERPAINT */
+}
+
 void VCLXGraphics::InitOutputDevice( sal_uInt16 nFlags )
 {
 	if(mpOutputDevice) 
@@ -135,7 +147,7 @@ void VCLXGraphics::InitOutputDevice( sal
 	}
 }
 
-::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXGraphics::getDevice() throw(::com::sun::star::uno::RuntimeException)
+uno::Reference< awt::XDevice > VCLXGraphics::getDevice() throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -148,11 +160,11 @@ void VCLXGraphics::InitOutputDevice( sal
 	return mxDevice;
 }
 
-::com::sun::star::awt::SimpleFontMetric VCLXGraphics::getFontMetric() throw(::com::sun::star::uno::RuntimeException)
+awt::SimpleFontMetric VCLXGraphics::getFontMetric() throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
-	::com::sun::star::awt::SimpleFontMetric aM;
+	awt::SimpleFontMetric aM;
 	if( mpOutputDevice ) 
 	{
 		mpOutputDevice->SetFont( maFont );
@@ -161,56 +173,104 @@ void VCLXGraphics::InitOutputDevice( sal
 	return aM;
 }
 
-void VCLXGraphics::setFont( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont >& rxFont ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::setFont( const uno::Reference< awt::XFont >& rxFont ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
 	maFont = VCLUnoHelper::CreateFont( rxFont );
 }
 
-void VCLXGraphics::selectFont( const ::com::sun::star::awt::FontDescriptor& rDescription ) throw(::com::sun::star::uno::RuntimeException)
+uno::Reference< awt::XFont > VCLXGraphics::getFont() throw(uno::RuntimeException)
+{
+    uno::Reference< awt::XFont > xFont;
+    uno::Reference< awt::XDevice > xDevice( getDevice() );
+
+    ::vos::OGuard aGuard( GetMutex() );
+
+    if ( xDevice.is() )
+    {
+        VCLXFont *pFont = new VCLXFont;
+        pFont->Init( *xDevice.get(), maFont );
+        xFont.set( static_cast< ::cppu::OWeakObject* >( pFont ), uno::UNO_QUERY );
+    }
+
+    return xFont;
+}
+
+void VCLXGraphics::selectFont( const awt::FontDescriptor& rDescription ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
 	maFont = VCLUnoHelper::CreateFont( rDescription, Font() );
 }
 
-void VCLXGraphics::setTextColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::setTextColor( sal_Int32 nColor ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
 	maTextColor = Color( (sal_uInt32)nColor );
 }
 
-void VCLXGraphics::setTextFillColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException)
+::sal_Int32 VCLXGraphics::getTextColor() throw(uno::RuntimeException)
+{
+    ::vos::OGuard aGuard( GetMutex() );
+    return maTextColor.GetColor();
+}
+
+void VCLXGraphics::setTextFillColor( sal_Int32 nColor ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
 	maTextFillColor = Color( (sal_uInt32)nColor );
 }
 
-void VCLXGraphics::setLineColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException)
+::sal_Int32 VCLXGraphics::getTextFillColor() throw(uno::RuntimeException)
+{
+    ::vos::OGuard aGuard( GetMutex() );
+    return maTextFillColor.GetColor();
+}
+
+void VCLXGraphics::setLineColor( sal_Int32 nColor ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
 	maLineColor = Color( (sal_uInt32)nColor );
 }
 
-void VCLXGraphics::setFillColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException)
+::sal_Int32 VCLXGraphics::getLineColor() throw(uno::RuntimeException)
+{
+    ::vos::OGuard aGuard( GetMutex() );
+    return maLineColor.GetColor();
+}
+
+void VCLXGraphics::setFillColor( sal_Int32 nColor ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
 	maFillColor = Color( (sal_uInt32)nColor );
 }
 
-void VCLXGraphics::setRasterOp( ::com::sun::star::awt::RasterOperation eROP ) throw(::com::sun::star::uno::RuntimeException)
+::sal_Int32 VCLXGraphics::getFillColor() throw(uno::RuntimeException)
+{
+    ::vos::OGuard aGuard( GetMutex() );
+    return maFillColor.GetColor();
+}
+
+void VCLXGraphics::setRasterOp( awt::RasterOperation eROP ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
 	meRasterOp = (RasterOp)eROP;
 }
 
-void VCLXGraphics::setClipRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException)
+awt::RasterOperation VCLXGraphics::getRasterOp()
+throw(uno::RuntimeException)
+{
+    ::vos::OGuard aGuard( GetMutex() );
+    return (awt::RasterOperation) meRasterOp;
+}
+
+void VCLXGraphics::setClipRegion( const uno::Reference< awt::XRegion >& rxRegion ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -221,7 +281,7 @@ void VCLXGraphics::setClipRegion( const 
 		mpClipRegion = NULL;
 }
 
-void VCLXGraphics::intersectClipRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::intersectClipRegion( const uno::Reference< awt::XRegion >& rxRegion ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -235,7 +295,7 @@ void VCLXGraphics::intersectClipRegion( 
 	}
 }
 
-void VCLXGraphics::push(  ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::push(  ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -244,7 +304,7 @@ void VCLXGraphics::push(  ) throw(::com:
 		mpOutputDevice->Push();
 }
 
-void VCLXGraphics::pop(  ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::pop(  ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -253,7 +313,20 @@ void VCLXGraphics::pop(  ) throw(::com::
 		mpOutputDevice->Pop();
 }
 
-void VCLXGraphics::copy( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice >& rxSource, sal_Int32 nSourceX, sal_Int32 nSourceY, sal_Int32 nSourceWidth, sal_Int32 nSourceHeight, sal_Int32 nDestX, sal_Int32 nDestY, sal_Int32 nDestWidth, sal_Int32 nDestHeight ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::clear(
+    const awt::Rectangle& aRect )
+throw(uno::RuntimeException)
+{
+    ::vos::OGuard aGuard( GetMutex() );
+
+    if( mpOutputDevice )
+    {
+        const ::Rectangle aVCLRect = VCLUnoHelper::ConvertToVCLRect( aRect );
+        mpOutputDevice->Erase( aVCLRect );
+    }
+}
+
+void VCLXGraphics::copy( const uno::Reference< awt::XDevice >& rxSource, sal_Int32 nSourceX, sal_Int32 nSourceY, sal_Int32 nSourceWidth, sal_Int32 nSourceHeight, sal_Int32 nDestX, sal_Int32 nDestY, sal_Int32 nDestWidth, sal_Int32 nDestHeight ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -270,14 +343,14 @@ void VCLXGraphics::copy( const ::com::su
 	}
 }
 
-void VCLXGraphics::draw( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayBitmap >& rxBitmapHandle, sal_Int32 nSourceX, sal_Int32 nSourceY, sal_Int32 nSourceWidth, sal_Int32 nSourceHeight, sal_Int32 nDestX, sal_Int32 nDestY, sal_Int32 nDestWidth, sal_Int32 nDestHeight ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::draw( const uno::Reference< awt::XDisplayBitmap >& rxBitmapHandle, sal_Int32 nSourceX, sal_Int32 nSourceY, sal_Int32 nSourceWidth, sal_Int32 nSourceHeight, sal_Int32 nDestX, sal_Int32 nDestY, sal_Int32 nDestWidth, sal_Int32 nDestHeight ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
 	if( mpOutputDevice )
 	{
 		InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP);
-		::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap > xBitmap( rxBitmapHandle, ::com::sun::star::uno::UNO_QUERY );
+		uno::Reference< awt::XBitmap > xBitmap( rxBitmapHandle, uno::UNO_QUERY );
 		BitmapEx aBmpEx = VCLUnoHelper::GetBitmap( xBitmap );
 		
 		Point aPos(nDestX - nSourceX, nDestY - nSourceY);
@@ -302,7 +375,7 @@ void VCLXGraphics::draw( const ::com::su
 	}
 }
 
-void VCLXGraphics::drawPixel( sal_Int32 x, sal_Int32 y ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawPixel( sal_Int32 x, sal_Int32 y ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -313,7 +386,7 @@ void VCLXGraphics::drawPixel( sal_Int32 
 	}
 }
 
-void VCLXGraphics::drawLine( sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawLine( sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -324,7 +397,7 @@ void VCLXGraphics::drawLine( sal_Int32 x
 	}
 }
 
-void VCLXGraphics::drawRect( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawRect( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -335,7 +408,7 @@ void VCLXGraphics::drawRect( sal_Int32 x
 	}
 }
 
-void VCLXGraphics::drawRoundedRect( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, sal_Int32 nHorzRound, sal_Int32 nVertRound ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawRoundedRect( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, sal_Int32 nHorzRound, sal_Int32 nVertRound ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -346,7 +419,7 @@ void VCLXGraphics::drawRoundedRect( sal_
 	}
 }
 
-void VCLXGraphics::drawPolyLine( const ::com::sun::star::uno::Sequence< sal_Int32 >& DataX, const ::com::sun::star::uno::Sequence< sal_Int32 >& DataY ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawPolyLine( const uno::Sequence< sal_Int32 >& DataX, const uno::Sequence< sal_Int32 >& DataY ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -357,7 +430,7 @@ void VCLXGraphics::drawPolyLine( const :
 	}
 }
 
-void VCLXGraphics::drawPolygon( const ::com::sun::star::uno::Sequence< sal_Int32 >& DataX, const ::com::sun::star::uno::Sequence< sal_Int32 >& DataY ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawPolygon( const uno::Sequence< sal_Int32 >& DataX, const uno::Sequence< sal_Int32 >& DataY ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -368,7 +441,7 @@ void VCLXGraphics::drawPolygon( const ::
 	}
 }
 
-void VCLXGraphics::drawPolyPolygon( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int32 > >& DataX, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int32 > >& DataY ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawPolyPolygon( const uno::Sequence< uno::Sequence< sal_Int32 > >& DataX, const uno::Sequence< uno::Sequence< sal_Int32 > >& DataY ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -384,7 +457,7 @@ void VCLXGraphics::drawPolyPolygon( cons
 	}
 }
 
-void VCLXGraphics::drawEllipse( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawEllipse( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -395,7 +468,7 @@ void VCLXGraphics::drawEllipse( sal_Int3
 	}
 }
 
-void VCLXGraphics::drawArc( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawArc( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -406,7 +479,7 @@ void VCLXGraphics::drawArc( sal_Int32 x,
 	}
 }
 
-void VCLXGraphics::drawPie( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawPie( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -417,7 +490,7 @@ void VCLXGraphics::drawPie( sal_Int32 x,
 	}
 }
 
-void VCLXGraphics::drawChord( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawChord( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -428,7 +501,7 @@ void VCLXGraphics::drawChord( sal_Int32 
 	}
 }
 
-void VCLXGraphics::drawGradient( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, const ::com::sun::star::awt::Gradient& rGradient ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawGradient( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, const awt::Gradient& rGradient ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -447,7 +520,7 @@ void VCLXGraphics::drawGradient( sal_Int
 	}
 }
 
-void VCLXGraphics::drawText( sal_Int32 x, sal_Int32 y, const ::rtl::OUString& rText ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawText( sal_Int32 x, sal_Int32 y, const ::rtl::OUString& rText ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -458,7 +531,7 @@ void VCLXGraphics::drawText( sal_Int32 x
 	}
 }
 
-void VCLXGraphics::drawTextArray( sal_Int32 x, sal_Int32 y, const ::rtl::OUString& rText, const ::com::sun::star::uno::Sequence< sal_Int32 >& rLongs ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphics::drawTextArray( sal_Int32 x, sal_Int32 y, const ::rtl::OUString& rText, const uno::Sequence< sal_Int32 >& rLongs ) throw(uno::RuntimeException)
 {
 	::vos::OGuard aGuard( GetMutex() );
 
@@ -470,5 +543,17 @@ void VCLXGraphics::drawTextArray( sal_In
 }
 
 
+void VCLXGraphics::drawImage( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32 height, sal_Int16 nStyle, const uno::Reference< graphic::XGraphic >& xGraphic ) throw(uno::RuntimeException)
+{
+    ::vos::OGuard aGuard( GetMutex() );
 
-
+    if( mpOutputDevice && xGraphic.is() )
+    {
+        Image aImage( xGraphic );
+        if ( !!aImage )
+        {
+            InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+            mpOutputDevice->DrawImage( Point( x, y ), Size( width, height ), aImage, nStyle );
+        }
+    }
+}



Mime
View raw message