1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsdeviceinterface/directgdiinterface/inc/directgdiengine.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,466 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +
1.20 +#ifndef DIRECTGDIENGINE_H
1.21 +#define DIRECTGDIENGINE_H
1.22 +
1.23 +/**
1.24 +@file
1.25 +@publishedPartner
1.26 +@prototype
1.27 +*/
1.28 +
1.29 +#include <graphics/directgditypes.h>
1.30 +#include <e32std.h>
1.31 +
1.32 +// Forward declarations.
1.33 +//
1.34 +class CFbsBitmap;
1.35 +class RDirectGdiImageSource;
1.36 +class RDirectGdiImageTarget;
1.37 +class RDirectGdiDrawableSource;
1.38 +
1.39 +/**
1.40 +Pure virtual interface for licensee adaptation of GDI platform implementation.
1.41 +
1.42 +@publishedPartner
1.43 +@prototype
1.44 +@deprecated
1.45 +*/
1.46 +class MDirectGdiEngine
1.47 + {
1.48 +public:
1.49 +
1.50 + /**
1.51 + @see CDirectGdiContext::Activate()
1.52 + @see Deactivate()
1.53 + */
1.54 + virtual TInt Activate(RDirectGdiImageTarget& aTarget) = 0;
1.55 +
1.56 + /**
1.57 + Unbinds the current rendering target (if any) from drawing engine. Drawing engine states or settings which
1.58 + are not dependent or non-target-specific remain unchanged.
1.59 +
1.60 + The DirectGDI generic layer will call this method prior to activating the drawing engine for another
1.61 + rendering target.
1.62 +
1.63 + @see Activate()
1.64 +
1.65 + @pre None.
1.66 + @post Drawing engine is no longer associated with any rendering target.
1.67 + */
1.68 + virtual void Deactivate() = 0;
1.69 +
1.70 + /**
1.71 + @see CDirectGdiContext::SetOrigin()
1.72 + */
1.73 + virtual void SetOrigin(const TPoint& aOrigin) = 0;
1.74 +
1.75 + /**
1.76 + @see CDirectGdiContext::ResetClippingRegion()
1.77 + @see SetClippingRegion()
1.78 + */
1.79 + virtual void SetClippingRegion(const TRegion& aRegion) = 0;
1.80 +
1.81 + /**
1.82 + @see CDirectGdiContext::ReetClippingRegion()
1.83 + @see SetClippingRegion()
1.84 + */
1.85 + virtual void ResetClippingRegion() = 0;
1.86 +
1.87 + /**
1.88 + @see CDirectGdiContext::SetDrawMode()
1.89 + */
1.90 + virtual void SetDrawMode(DirectGdi::TDrawMode aMode) = 0;
1.91 +
1.92 + /**
1.93 + @see CDirectGdiContext::SetPenColor()
1.94 + @see DrawLine()
1.95 + @see DrawLineTo()
1.96 + @see DrawLineBy()
1.97 + @see DrawPolyLine()
1.98 + @see DrawPolygon()
1.99 + @see DrawRect()
1.100 + @see DrawRoundRect()
1.101 + */
1.102 + virtual void SetPenColor(const TRgb& aColor) = 0;
1.103 +
1.104 + /**
1.105 + @see CDirectGdiContext::SetPenStyle()
1.106 + @see DrawLine()
1.107 + @see DrawLineTo()
1.108 + @see DrawLineBy()
1.109 + @see DrawPolyLine()
1.110 + @see DrawPolygon()
1.111 + @see DrawRect()
1.112 + @see DrawRoundRect()
1.113 + */
1.114 + virtual void SetPenStyle(DirectGdi::TPenStyle aStyle) = 0;
1.115 +
1.116 + /**
1.117 + @see CDirectGdiContext::SetPenSize()
1.118 + @see DrawLine()
1.119 + @see DrawLineTo()
1.120 + @see DrawLineBy()
1.121 + @see DrawPolyLine()
1.122 + @see DrawPolygon()
1.123 + @see DrawRect()
1.124 + @see DrawRoundRect()
1.125 + @see Plot()
1.126 + */
1.127 + virtual void SetPenSize(const TSize& aSize) = 0;
1.128 +
1.129 + /**
1.130 + @see CDirectGdiContext::SetTextShadowColor()
1.131 + */
1.132 + virtual void SetTextShadowColor(const TRgb& aColor) = 0;
1.133 +
1.134 + /**
1.135 + @see CDirectGdiContext::SetBrushColor()
1.136 + */
1.137 + virtual void SetBrushColor(const TRgb& aColor) = 0;
1.138 +
1.139 + /**
1.140 + @see CDirectGdiContext::SetBrushStyle()
1.141 + @see SetBrushPattern()
1.142 + */
1.143 + virtual void SetBrushStyle(DirectGdi::TBrushStyle aStyle) = 0;
1.144 +
1.145 + /**
1.146 + @see CDirectGdiContext::SetBrushOrigin()
1.147 + @see SetBrushPattern()
1.148 + */
1.149 + virtual void SetBrushOrigin(const TPoint& aOrigin) = 0;
1.150 +
1.151 + /**
1.152 + @see CDirectGdiContext::SetBrushPattern()
1.153 + @see ResetBrushPattern()
1.154 +
1.155 + @return KErrNone if successful, otherwise one of the system-wide error codes.
1.156 + */
1.157 + virtual TInt SetBrushPattern(const CFbsBitmap& aPattern) = 0;
1.158 +
1.159 + /**
1.160 + @see CDirectGdiContext::ResetBrushPattern()
1.161 + @see SetBrushPattern()
1.162 + */
1.163 + virtual void ResetBrushPattern() = 0;
1.164 +
1.165 + /**
1.166 + @see CDirectGdiContext::SetFont()
1.167 +
1.168 + @param aFontId The Font identifier.
1.169 + */
1.170 + virtual void SetFont(TUint32 aFontId) = 0;
1.171 +
1.172 + /**
1.173 + @see CDirectGdiContext::ResetFont()
1.174 + */
1.175 + virtual void ResetFont() = 0;
1.176 +
1.177 + /**
1.178 + Resets the engine state to default values.
1.179 +
1.180 + @see CDirectGdiContext::Reset()
1.181 + */
1.182 + virtual void Reset() = 0;
1.183 +
1.184 + /**
1.185 + @see CDirectGdiContext::Clear(const TRect&)
1.186 + @see Clear()
1.187 + @see SetBrushColor()
1.188 + */
1.189 + virtual void Clear(const TRect& aRect) = 0;
1.190 +
1.191 + /**
1.192 + @see CDirectGdiContext::Clear()
1.193 + @see Clear(const TRect&)
1.194 + @see SetBrushColor()
1.195 + */
1.196 + virtual void Clear() = 0;
1.197 +
1.198 + /**
1.199 + @see CDirectGdiContext::MoveTo()
1.200 + @see MoveBy()
1.201 + */
1.202 + virtual void MoveTo(const TPoint& aPoint) = 0;
1.203 +
1.204 + /**
1.205 + @see CDirectGdiContext::MoveBy()
1.206 + @see MoveTo()
1.207 + */
1.208 + virtual void MoveBy(const TPoint& aVector) = 0;
1.209 +
1.210 + /**
1.211 + @see CDirectGdiContext::Plot()
1.212 + @see SetPenSize()
1.213 + @see SetPenColor()
1.214 + @see SetDrawMode()
1.215 + */
1.216 + virtual void Plot(const TPoint& aPoint) = 0;
1.217 +
1.218 + /**
1.219 + @see CDirectGdiContext::DrawLine()
1.220 + @see DrawLineTo()
1.221 + @see DrawLineBy()
1.222 + @see SetPenSize()
1.223 + @see SetPenStyle()
1.224 + @see SetPenColor()
1.225 + @see SetDrawMode()
1.226 + */
1.227 + virtual void DrawLine(const TPoint& aStart, const TPoint& aEnd) = 0;
1.228 +
1.229 + /**
1.230 + @see CDirectGdiContext::DrawLineTo()
1.231 + @see DrawLine()
1.232 + @see DrawLineBy()
1.233 + @see SetPenSize()
1.234 + @see SetPenStyle()
1.235 + @see SetPenColor()
1.236 + @see SetDrawMode()
1.237 + @see MoveTo()
1.238 + @see MoveBy()
1.239 + */
1.240 + virtual void DrawLineTo(const TPoint& aPoint) = 0;
1.241 +
1.242 + /**
1.243 + @see CDirectGdiContext::DrawLineBy()
1.244 + @see DrawLine()
1.245 + @see DrawLineTo()
1.246 + @see SetPenSize()
1.247 + @see SetPenStyle()
1.248 + @see SetPenColor()
1.249 + @see DrawMode()
1.250 + @see MoveTo()
1.251 + @see MoveBy()
1.252 + */
1.253 + virtual void DrawLineBy(const TPoint& aVector) = 0;
1.254 +
1.255 + /**
1.256 + @see CDirectGdiContext::DrawRect()
1.257 + */
1.258 + virtual void DrawRect(const TRect& aRect) = 0;
1.259 +
1.260 + /**
1.261 + @see CDirectGdiContext::DrawRoundRect()
1.262 + */
1.263 + virtual void DrawRoundRect(const TRect& aRect, const TSize& aCornerSize) = 0;
1.264 +
1.265 + /**
1.266 + @see CDirectGdiContext::DrawPolyLine()
1.267 + @see SetPenColor()
1.268 + @see SetPenSize()
1.269 + @see SetPenStyle()
1.270 + @see SetDrawMode()
1.271 + */
1.272 + virtual void DrawPolyLine(const TArray<TPoint>& aPointList) = 0;
1.273 +
1.274 + /**
1.275 + @see CDirectGdiContext::DrawPolyLineNoEndPoint()
1.276 + @see SetPenColor()
1.277 + @see SetPenSize()
1.278 + @see SetPenStyle()
1.279 + @see SetDrawMode()
1.280 + */
1.281 + virtual void DrawPolyLineNoEndPoint(const TArray<TPoint>& aPointList) = 0;
1.282 +
1.283 + /**
1.284 + @see CDirectGdiContext::DrawPolygon()
1.285 + */
1.286 + virtual void DrawPolygon(const TArray<TPoint>& aPoints, DirectGdi::TFillRule aRule) = 0;
1.287 +
1.288 + /**
1.289 + @see CDirectGdiContext::DrawArc()
1.290 + @see DrawPie()
1.291 + */
1.292 + virtual void DrawArc(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd) = 0;
1.293 +
1.294 + /**
1.295 + @see CDirectGdiContext::DrawPie()
1.296 + */
1.297 + virtual void DrawPie(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd) = 0;
1.298 +
1.299 + /**
1.300 + @see CDirectGdiContext::DrawEllipse()
1.301 + */
1.302 + virtual void DrawEllipse(const TRect& aRect) = 0;
1.303 +
1.304 + /**
1.305 + @see CDirectGdiContext::BitBlt(const TPoint&, const CFbsBitmap&, const TRect&)
1.306 + */
1.307 + virtual void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aBitmap, const TRect& aSourceRect) = 0;
1.308 +
1.309 + /**
1.310 + @see CDirectGdiContext::BitBltMasked(const TPoint&, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TBool)
1.311 + */
1.312 + virtual void BitBltMasked(const TPoint& aDestPos,
1.313 + const CFbsBitmap& aBitmap,
1.314 + const TRect& aSourceRect,
1.315 + const CFbsBitmap& aMask,
1.316 + TBool aInvertMask) = 0;
1.317 +
1.318 + /**
1.319 + @see CDirectGdiContext::BitBltMasked(const TPoint&, const CFbsBitmap&, const TRect&, const CFbsBitmap&, const TPoint&)
1.320 + */
1.321 + virtual void BitBltMasked(const TPoint& aDestPos,
1.322 + const CFbsBitmap& aBitmap,
1.323 + const TRect& aSourceRect,
1.324 + const CFbsBitmap& aMask,
1.325 + const TPoint& aMaskPos) = 0;
1.326 +
1.327 + /**
1.328 + @see CDirectGdiContext::DrawBitmap(const TRect&, const CFbsBitmap&, const TRect&)
1.329 + */
1.330 + virtual void DrawBitmap(const TRect& aDestRect,
1.331 + const CFbsBitmap& aBitmap,
1.332 + const TRect& aSourceRect) = 0;
1.333 +
1.334 + /**
1.335 + @see CDirectGdiContext::DrawBitmapMasked(const TRect&, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TBool)
1.336 + */
1.337 + virtual void DrawBitmapMasked(const TRect& aDestRect,
1.338 + const CFbsBitmap& aBitmap,
1.339 + const TRect& aSourceRect,
1.340 + const CFbsBitmap& aMask,
1.341 + TBool aInvertMask) = 0;
1.342 +
1.343 + /**
1.344 + @see CDirectGdiContext::DrawResource(const TPoint&, const RDirectGdiImageSource&, DirectGdi::TGraphicsRotation)
1.345 + */
1.346 + virtual void DrawResource(const TPoint& aPos,
1.347 + const RDirectGdiDrawableSource& aSource,
1.348 + DirectGdi::TGraphicsRotation aRotation) = 0;
1.349 +
1.350 + /**
1.351 + @see CDirectGdiContext::DrawResource(const TRect&, const RDirectGdiImageSource&, DirectGdi::TGraphicsRotation)
1.352 + */
1.353 + virtual void DrawResource(const TRect& aDestRect,
1.354 + const RDirectGdiDrawableSource& aSource,
1.355 + DirectGdi::TGraphicsRotation aRotation) = 0;
1.356 +
1.357 + /**
1.358 + @see CDirectGdiContext::DrawResource(const TRect&, const RDirectGdiImageSource&, const TRect&, DirectGdi::TGraphicsRotation)
1.359 + */
1.360 + virtual void DrawResource(const TRect& aDestRect,
1.361 + const RDirectGdiDrawableSource& aSource,
1.362 + const TRect& aSourceRect,
1.363 + DirectGdi::TGraphicsRotation aRotation) = 0;
1.364 +
1.365 + /**
1.366 + @see CDirectGdiContext::DrawResource(const TRect&, const RDirectGdiDrawableSource&, const TDesC8&)
1.367 + */
1.368 + virtual void DrawResource(const TRect& aDestRect, const RDirectGdiDrawableSource& aSource, const TDesC8& aParam) = 0;
1.369 +
1.370 + /**
1.371 + Draws a glyph.
1.372 +
1.373 + @param aPos Position to start drawing the glyph after rotation has been applied (if necessary).
1.374 + @param aChar Character being drawn.
1.375 + @param aGlyphImage Pointer to the glyph image data.
1.376 + @param aBitmapType Type of bitmap format.
1.377 + @param aGlyphImageSize Glyph image size.
1.378 + @param aClipRect Clipping rect.
1.379 + @param aRotation Rotation specifying how the glyph will be drawn.
1.380 +
1.381 + @pre The rendering target has been activated.
1.382 + @post Request to draw the glyph has been accepted.
1.383 + */
1.384 + virtual void DrawGlyph(const TPoint& aPos,
1.385 + const TChar aChar,
1.386 + const TUint8* aGlyphImage,
1.387 + const TGlyphBitmapType aBitmapType,
1.388 + const TSize& aGlyphImageSize,
1.389 + const TRect& aClipRect,
1.390 + const DirectGdi::TGraphicsRotation aRotation = DirectGdi::EGraphicsRotationNone) = 0;
1.391 +
1.392 + /**
1.393 + Copies the contents of a rectangular area on the target to another location.
1.394 + The source rectangle will be intersected with the full extent of the target.
1.395 +
1.396 + @param aOffset Offset from the top left corner of the rectangle to be copied to the top left corner of the copy.
1.397 + @param aRect Area to be copied.
1.398 +
1.399 + @pre The rendering target has been activated.
1.400 + @post Request to copy an area has been accepted. There is no guarantee that the
1.401 + request has been processed when this method returns.
1.402 + */
1.403 + virtual void CopyRect(const TPoint& aOffset, const TRect& aRect) = 0;
1.404 +
1.405 + /**
1.406 + Writes the drawing engine object state to the passed write stream.
1.407 +
1.408 + @see CDirectGdiContext::ExternalizeL()
1.409 + @see InternalizeL()
1.410 +
1.411 + @param aWriteStream Write stream.
1.412 +
1.413 + @pre None.
1.414 + @post The drawing engine object state has been written to the write stream.
1.415 + */
1.416 + virtual void ExternalizeL(RWriteStream& aWriteStream) = 0;
1.417 +
1.418 + /**
1.419 + Sets the drawing engine object state from the read stream.
1.420 +
1.421 + @see CDirectGdiContext::InternalizeL()
1.422 + @see ExternalizeL()
1.423 +
1.424 + @param aReadStream Read stream.
1.425 +
1.426 + @pre None.
1.427 + @post The drawing engine object state has been updated with the values from the read stream.
1.428 + */
1.429 + virtual void InternalizeL(RReadStream& aReadStream) = 0;
1.430 +
1.431 + /**
1.432 + @see CDirectGdiContext::GetInterface()
1.433 + */
1.434 + virtual TInt GetInterface(TUid aInterfaceId, TAny*& aInterface) = 0;
1.435 +
1.436 + /**
1.437 + Prepares the drawing engine for drawing text as multiple DrawGlyph() commands.
1.438 + This function must always have a corresponding call to EndDrawGlyph() after the multiple
1.439 + DrawGlyph() commands have been made.
1.440 + Other than DrawGlyph(), no other rendering should be issued to the engine until EndDrawGlyph() has been called.
1.441 +
1.442 + @see EndDrawGlyph()
1.443 + @see DrawGlyph()
1.444 +
1.445 + @pre None.
1.446 + @post None.
1.447 + */
1.448 + virtual void BeginDrawGlyph() = 0;
1.449 +
1.450 + /**
1.451 + Notifies the drawing engine that the last call to DrawGlyph() has been made for the
1.452 + text string. This function must always be matched to a corresponding BeginDrawGlyph() call.
1.453 + Other than DrawGlyph(), no other rendering should be issued to the engine until EndDrawGlyph() has
1.454 + been called.
1.455 +
1.456 + @see BeginDrawGlyph()
1.457 + @see DrawGlyph()
1.458 +
1.459 + @pre BeginDrawGlyph() has been called.
1.460 + @post None.
1.461 + */
1.462 + virtual void EndDrawGlyph() = 0;
1.463 +
1.464 + };
1.465 +
1.466 +const TUid KDirectGdiEngineUid = {0x10285A72};
1.467 +
1.468 +
1.469 +#endif