svgtopt/gfx2d/inc/Gfx2dGcInterface.h
changeset 0 d46562c3d99d
child 26 796196dd6e68
equal deleted inserted replaced
-1:000000000000 0:d46562c3d99d
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Graphics Extension Library header file
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef GFX2DGCINT_H
       
    20 #define GFX2DGCINT_H
       
    21 
       
    22 
       
    23 #include <w32std.h>
       
    24 #include <e32std.h>
       
    25 #include <bitstd.h>
       
    26 #include <badesca.h>
       
    27 #include <fbs.h>
       
    28 #include <gdi.h>
       
    29 
       
    30 #include "GfxRenderingHints.h"
       
    31 #include "GfxStroke.h"
       
    32 #include "GfxColor.h"
       
    33 
       
    34 #include "SvgBitmapFontProvider.h"
       
    35 class MGfxShape;
       
    36 class MGfxPaint;
       
    37 
       
    38 typedef enum
       
    39 {
       
    40     SVG_CAP_BUTT                    = 0,
       
    41     SVG_CAP_ROUND                   = 1,
       
    42     SVG_CAP_SQUARE                  = 2,
       
    43     SVG_INVALID_LINE_CAP            = -1
       
    44 } SVGLineCap;
       
    45 
       
    46 typedef enum
       
    47 {
       
    48     SVG_JOIN_MITER                  = 0,
       
    49     SVG_JOIN_ROUND                  = 1,
       
    50     SVG_JOIN_BEVEL                  = 2,
       
    51     SVG_INVALID_LINE_JOIN           = -1
       
    52 } SVGLineJoin;
       
    53 
       
    54 /**
       
    55  * This class provides the interface create a graphics context.
       
    56  *
       
    57  *  @lib Gfx2D.lib
       
    58  *  @since 1.0
       
    59  */
       
    60 class CGfx2dGc : public CBase
       
    61     {
       
    62     public:
       
    63 
       
    64         /**
       
    65          * Draw the given shape.
       
    66          *
       
    67          * @since 1.0
       
    68          * @param aShape : shape to draw.
       
    69          * @return
       
    70          */
       
    71         virtual void                   DrawL( MGfxShape* aShape )=0;
       
    72 
       
    73         /**
       
    74          * Draw the given string starting at the given context coordinate,
       
    75          * and stylized by the given parameters.
       
    76          *
       
    77          * @since 1.0
       
    78          * @param aDesc : string to draw
       
    79          * @param aX : x coordinate
       
    80          * @param aTextAnchor : text anchor
       
    81          * @param aTextDecoration : text decoration
       
    82          * @param aFamilies : font family names
       
    83          * @param aWordSpacing : spacing description for each word
       
    84          * @param aLetterSpacing : spacing description for each letter
       
    85          * @param aArrayRotate : angle of rotation
       
    86          * @param aArrayX : array of x coordinates
       
    87          * @param aArrayY : array of x coordinates
       
    88          * @return
       
    89          */
       
    90         virtual void                   DrawStringL( const TDesC& aDesc,
       
    91                                                      TFloatFixPt aX,
       
    92                                                      TFloatFixPt aY,
       
    93                                                      TInt8 aTextAnchor,
       
    94                                                      TInt8 aTextDecoration,
       
    95                                                      CDesCArrayFlat* aFamilies,
       
    96                                                      TReal aWordSpacing,
       
    97                                                      TReal aLetterSpacing,
       
    98                                                      CArrayFix<TReal32>* aArrayRotate,
       
    99                                                      CArrayFix<TFloatFixPt>* aArrayX,
       
   100                                                      CArrayFix<TFloatFixPt>* aArrayY,
       
   101                                                      TSize& aBoundingBoxResult,
       
   102 						     CFont*& aFont,
       
   103 						     TFontSpec& aFontSpec )=0;
       
   104 
       
   105         /**
       
   106          * Draw the given bitmap at the given top-left coordinates.
       
   107          *
       
   108          * @since 1.0
       
   109          * @param aDesc : bitmap image to draw
       
   110          * @param aX : x coordinate
       
   111          * @param aY : y coordinate
       
   112          * @return
       
   113          */
       
   114         virtual void                   DrawImage( CFbsBitmap* aImage,
       
   115                                                   const TGfxRectangle2D& aImageRect,
       
   116                                                   TBool aHasAlpha = EFalse )=0;
       
   117 
       
   118         /**
       
   119          * Clear the whole graphics context.
       
   120          *
       
   121          * @since 1.0
       
   122          * @param
       
   123          * @return
       
   124          */
       
   125         virtual void                   Clear(TUint32 aRGBA8888Color)=0;
       
   126 
       
   127         /**
       
   128          * Get the foreground color setting.
       
   129          *
       
   130          * @since 1.0
       
   131          * @param
       
   132          * @return foreground color.
       
   133          */
       
   134         virtual TGfxColor              ForegroundColor()=0;
       
   135 
       
   136         /**
       
   137          * Get the paint setting.
       
   138          *
       
   139          * @since 1.0
       
   140          * @param
       
   141          * @return paint.
       
   142          */
       
   143         virtual MGfxPaint*             Paint()=0;
       
   144 
       
   145         /**
       
   146          * Get the rendering hints setting.
       
   147          *
       
   148          * @since 1.0
       
   149          * @param
       
   150          * @return rendering hints.
       
   151          */
       
   152         virtual TGfxRenderingHints*    RenderingHints()=0;
       
   153 
       
   154         /**
       
   155          * Get the stroke setting.
       
   156          *
       
   157          * @since 1.0
       
   158          * @param
       
   159          * @return stroke.
       
   160          */
       
   161         virtual TGfxStroke             Stroke()=0;
       
   162 
       
   163         /**
       
   164          * Get the boundary setting.
       
   165          *
       
   166          * @since 1.0
       
   167          * @param
       
   168          * @return boundary.
       
   169          */
       
   170         virtual TSize                  DeviceBounds()=0;
       
   171         /**
       
   172          * Get the font setting.
       
   173          *
       
   174          * @since 1.0
       
   175          * @param
       
   176          * @return font.
       
   177          */
       
   178 
       
   179         virtual CFont*                 Font()=0;
       
   180 
       
   181 
       
   182         /**
       
   183          * Set the foreground color.
       
   184          *
       
   185          * @since 1.0
       
   186          * @param aColor : foreground color
       
   187          * @return
       
   188          */
       
   189         virtual void                   SetForegroundColor( const TGfxColor& aColor )=0;
       
   190 
       
   191 
       
   192         /**
       
   193          * Set the background color.
       
   194          *
       
   195          * @since 1.0
       
   196          * @param aColor : background color
       
   197          * @return
       
   198          */
       
   199         virtual void                   SetBackgroundColor( const TGfxColor& aColor )=0;
       
   200 
       
   201 		
       
   202         /**
       
   203          * Set the stroke-width.
       
   204          *
       
   205          * @since 3.2
       
   206          * @param aWidth : stroke-width
       
   207          * @return none.
       
   208          */
       
   209 		virtual void SetStrokeWidth( const TFloatFixPt& aWidth )=0;
       
   210         
       
   211         
       
   212         /**
       
   213          * Set the paint info.
       
   214          *
       
   215          * @since 1.0
       
   216          * @param aPaint : paint info
       
   217          * @return
       
   218          */
       
   219         virtual void                   SetPaint( MGfxPaint* aPaint )=0;
       
   220 
       
   221         /**
       
   222          * Set the stroke info.
       
   223          *
       
   224          * @since 1.0
       
   225          * @param aStroke : stroke info
       
   226          * @return
       
   227          */
       
   228         virtual void                   SetStroke( TGfxStroke aStroke )=0;
       
   229 
       
   230         /**
       
   231          * Set the rendering hints.
       
   232          *
       
   233          * @since 1.0
       
   234          * @param aRenderingHints : rendering hints
       
   235          * @return
       
   236          */
       
   237         virtual void                   SetRenderingHints( const TGfxRenderingHints& aRenderingHints )=0;
       
   238 
       
   239         /**
       
   240          * Set the transform info.
       
   241          *
       
   242          * @since 1.0
       
   243          * @param aTransform : transform info
       
   244          * @return
       
   245          */
       
   246         virtual void                   SetTransform( const TGfxAffineTransform& aTransform )=0;
       
   247 
       
   248         /**
       
   249          * Set the clipping info.
       
   250          *
       
   251          * @since 1.0
       
   252          * @param aClip : clipping rectangle
       
   253          * @return
       
   254          */
       
   255         virtual void                   SetClip( const TGfxRectangle2D& aClip )=0;
       
   256 
       
   257         /**
       
   258          * Set the dash array info.
       
   259          *
       
   260          * @since 1.0
       
   261          * @param aArray : array of points
       
   262          * @param aOffset : offset point
       
   263          * @return
       
   264          */
       
   265         virtual void                   SetDashArrayL( CArrayFix<TFloatFixPt>* aArray)=0;
       
   266 		virtual void					SetDashOffset( TFloatFixPt aDashOffset ) =0;
       
   267         /**
       
   268          * Set the font size.
       
   269          *
       
   270          * @since 1.0
       
   271          * @param aFontSize : font size
       
   272          * @return
       
   273          */
       
   274         virtual void                   SetFontSize( const TFloatFixPt aFontSize )=0;
       
   275 
       
   276         /**
       
   277          * Set the winding rule.
       
   278          *
       
   279          * @since 1.0
       
   280          * @param aRule : winding rule
       
   281          * @return
       
   282          */
       
   283         virtual void                   SetWindingRule( TGfxWindingRule aRule )=0;
       
   284 
       
   285         /**
       
   286          * Set the font weight.
       
   287          *
       
   288          * @since 1.0
       
   289          * @param aFontWeight : font weight value
       
   290          * @return
       
   291          */
       
   292         virtual void                   SetFontWeight( const TInt32 aFontWeight )=0;
       
   293 
       
   294         /**
       
   295          * Set the font style.
       
   296          *
       
   297          * @since 1.0
       
   298          * @param aFontStyle : font style
       
   299          * @return
       
   300          */
       
   301         virtual void                   SetFontStyle( const TInt32 aFontStyle )=0;
       
   302 
       
   303         /**
       
   304          * Set the font family.
       
   305          *
       
   306          * @since 1.0
       
   307          * @param aFamilies : font family names
       
   308          * @return
       
   309          */
       
   310         virtual void                   SetFontFamily( CDesCArrayFlat* aFamilies )=0;
       
   311 
       
   312         /**
       
   313          * Set the text anchor
       
   314          *
       
   315          * @since 1.0
       
   316          * @param aTextAnchor : text anchor value
       
   317          * @return
       
   318          */
       
   319         virtual void                   SetTextanchor( const TInt32 aTextAnchor )=0;
       
   320 
       
   321         /**
       
   322          * Set the text decoration
       
   323          *
       
   324          * @since 1.0
       
   325          * @param aTextDecoration : text decoration value
       
   326          * @return
       
   327          */
       
   328         virtual void                   SetTextDecoration( const TInt32 aTextDecoration )=0;
       
   329 
       
   330         /**
       
   331          * Set the anti-alias mode
       
   332          *
       
   333          * @since 1.0
       
   334          * @param aTextDecoration : anti-alias mode value
       
   335          * @return
       
   336          */
       
   337         virtual void                   SetAntialiasingMode( const TInt32 aAntialiasingEnable )=0;
       
   338 
       
   339         /**
       
   340          * This method copies the internal RGBA8888 framebuffer to CfbsBitmap that
       
   341          * is specified in constructor. The CfbsBitmap could be 4k color (RGB0444),
       
   342          * 64k color (RGB565), or 16M color (RGB888).
       
   343          *
       
   344          * @since
       
   345          * @param
       
   346          * @return
       
   347          */
       
   348         virtual void UpdateFramebufferL( CFbsBitmap* aFrameBuffer, CFbsBitmap* aMask ) = 0;
       
   349         virtual void UpdateFramebufferL( CFbsBitmap* aFrameBuffer, CFbsBitmap* aMask,TSize aFrameBufferSize,TDisplayMode aFrameBufferMode,TDisplayMode aMaskDspMode ) =0;
       
   350         /**
       
   351          * Blend aFrameBuffer with background buffer using the opacity value
       
   352          *
       
   353          * @since 1.0
       
   354          * @param aFrameBuffer: Buffer to be blended with background
       
   355          *        aOpacity: opacity value (0<=aOpacity<=1.0)
       
   356          * @return
       
   357          */
       
   358          virtual void BlendWithBackground(TUint32* aFrameBuffer, TReal32 aOpacity)=0;
       
   359 
       
   360          /**
       
   361           * Generate mask
       
   362           *
       
   363           * @since
       
   364           * @param aMask: pointer to the mask
       
   365           * @return
       
   366           */
       
   367 		virtual void GenerateMask(CFbsBitmap* aMask)=0;
       
   368 
       
   369 		  /**
       
   370          * Set the fill opacity value
       
   371         *
       
   372          * @since 1.0
       
   373          * @param aFillOpacity : opacity value (0<=aFillOpacity<=1.0)
       
   374          * @return
       
   375          */
       
   376         virtual void                   SetFillOpacity(TFloatFixPt aFillOpacity)=0;
       
   377 
       
   378         /**
       
   379          * Set the stroke opacity value
       
   380          *
       
   381          * @since 1.0
       
   382          * @param aStrokeOpacity : opacity value (0<=aStrokeOpacity<=1.0)
       
   383          * @return
       
   384          */
       
   385         virtual void                   SetStrokeOpacity(TFloatFixPt aStrokeOpacity)=0;
       
   386 
       
   387         /**
       
   388          * Set the flag to do or ignore dithering.
       
   389          *
       
   390          * @since 1.0
       
   391          * @param aDoDithering : TRUE or False
       
   392          * @return
       
   393          */
       
   394         virtual void                   SetDoDithering( TBool aDoDithering )=0;
       
   395 
       
   396         /**
       
   397          * Request to change the buffer size.
       
   398          *
       
   399          * @since 1.0
       
   400          * @param aSize : size of new buffer
       
   401          * @return
       
   402          */
       
   403         virtual void                   ChangeBufferSizeL( const TSize aSize ) = 0;
       
   404 
       
   405         // Rasterizer methods for group-opacity
       
   406         virtual TUint32* ColorBuffer() { return NULL; };
       
   407         virtual void UpdateColorBuffer() {};
       
   408 
       
   409         // OpenVG methods for group-opacity
       
   410         virtual void BindToImageL() {};
       
   411         virtual void UnbindFromImageL( TReal32 /*aOpacity*/ ) {};
       
   412 
       
   413         virtual void GetFontScaled( TFloatFixPt aHeight,
       
   414 			     const TDesC& aTypefaceName,
       
   415                              CFont*& aFont,
       
   416                              TFontSpec& aFontSpec ) = 0;
       
   417 
       
   418         // This is for work-around for OpenVG to simulate multiple contexts
       
   419         // VGR does not need to do anything.
       
   420         virtual void SetupContextL() {};
       
   421         virtual void Flush() {};
       
   422         virtual void DestroyContext()=0;
       
   423         /**
       
   424           * Get the NVG-TLV Encoded data.
       
   425           *
       
   426           * @since 1.0
       
   427           * @return : pointer to the NVG-TLV data
       
   428         */
       
   429         virtual const TPtrC8 TLVEncodedData() const=0;
       
   430 
       
   431 		protected:
       
   432 		
       
   433 		//Stores Font Type information as passed by CSvgEngineInterfaceImpl
       
   434         CSvgBitmapFontProvider *iSvgBitmapFontProvider;
       
   435     };
       
   436 
       
   437 /**
       
   438  * DUMMY placeholder to prevent BC break in SVGEngine - deprecated and not used.
       
   439  * 
       
   440  *  @since 1.0
       
   441  */
       
   442 class CGfx2dGcVGR : public CGfx2dGc
       
   443     {
       
   444 
       
   445     /**
       
   446      * Two-phase constructor.
       
   447      *
       
   448      * @since 1.0
       
   449      * @param
       
   450      * @return
       
   451      */
       
   452      static CGfx2dGcVGR*       NewL( const TSize aBufferSize, TFontSpec& aFontSpec, CSvgBitmapFontProvider *aSvgBitmapFontProvider );
       
   453 
       
   454     /**
       
   455      * Destructor
       
   456      */
       
   457      virtual                ~CGfx2dGcVGR();
       
   458 
       
   459     //old  CFont*               GetFontScaled( TFixPt aHeight, const TDesC& aTypefaceName );
       
   460      void       GetFontScaled( TFloatFixPt aHeight, 
       
   461                          const TDesC& aTypefaceName,
       
   462                          CFont*& aFont,
       
   463                          TFontSpec& aFontSpec );
       
   464 
       
   465     /**
       
   466      * Adjust the shape complexity.
       
   467      *
       
   468      * @since 1.0
       
   469      * @param aVertexSize : size of vertices to render.
       
   470      * @return
       
   471      */
       
   472      void                   AdjustShapeComplexityL( TInt32 aVertexSize );
       
   473 
       
   474     /**
       
   475      * Draw the given shape.
       
   476      *
       
   477      * @since 1.0
       
   478      * @param aShape : shape to draw.
       
   479      * @return
       
   480      */
       
   481      void                   DrawL( MGfxShape* aShape );
       
   482 
       
   483     /**
       
   484      * Determine if given string should be drawn right to left
       
   485      *
       
   486      * @since 1.0
       
   487      * @param aDesc : string to check if right to left
       
   488      * @return true if right to left false otherwise
       
   489      */
       
   490     TBool                   IsRightToLeft(const TDesC& aDesc );
       
   491 
       
   492     /**
       
   493      * Draw the given string starting at the given context coordinate,
       
   494      * and stylized by the given parameters.
       
   495      *
       
   496      * @since 1.0
       
   497      * @param aDesc : string to draw
       
   498      * @param aX : x coordinate
       
   499      * @param aTextAnchor : text anchor
       
   500      * @param aTextDecoration : text decoration
       
   501      * @param aFamilies : font family names
       
   502      * @param aWordSpacing : spacing description for each word
       
   503      * @param aLetterSpacing : spacing description for each letter
       
   504      * @param aArrayRotate : angle of rotation
       
   505      * @param aArrayX : array of x coordinates
       
   506      * @param aArrayY : array of x coordinates
       
   507      * @return
       
   508      */
       
   509      void                   DrawStringL( const TDesC& aDesc,
       
   510                                                  TFloatFixPt aX,
       
   511                                                  TFloatFixPt aY,
       
   512                                                  TInt8 aTextAnchor,
       
   513                                                  TInt8 aTextDecoration,
       
   514                                                  CDesCArrayFlat* aFamilies,
       
   515                                                  TReal aWordSpacing,
       
   516                                                  TReal aLetterSpacing,
       
   517                                                  CArrayFix<TReal32>* aArrayRotate,
       
   518                                                  CArrayFix<TFloatFixPt>* aArrayX,
       
   519                                                  CArrayFix<TFloatFixPt>* aArrayY,
       
   520                                                  TSize& aBboxSizeResult, 
       
   521                          CFont*& aFont, 
       
   522                          TFontSpec& aFontSpec);
       
   523 
       
   524     /**
       
   525      * Draw the given bitmap at the given top-left coordinates.
       
   526      *
       
   527      * @since 1.0
       
   528      * @param aDesc : bitmap image to draw
       
   529      * @param aX : x coordinate
       
   530      * @param aY : y coordinate
       
   531      * @return
       
   532      */
       
   533      void                   DrawImage( CFbsBitmap* aImage,
       
   534                                                const TGfxRectangle2D& aImageRect,
       
   535                                                TBool aHasAlpha = EFalse );
       
   536 
       
   537     /**
       
   538      * Clear the whole graphics context.
       
   539      *
       
   540      * @since 1.0
       
   541      * @param
       
   542      * @return
       
   543      */
       
   544      void                   Clear(TUint32 aRGBA8888Color);
       
   545 
       
   546     /**
       
   547      * Get the composite setting.
       
   548      *
       
   549      * @since 1.0
       
   550      * @param
       
   551      * @return composite value.
       
   552      */
       
   553      TUint8                 Composite();
       
   554 
       
   555     /**
       
   556      * Get the foreground color setting.
       
   557      *
       
   558      * @since 1.0
       
   559      * @param
       
   560      * @return foreground color.
       
   561      */
       
   562      TGfxColor              ForegroundColor() ;
       
   563 
       
   564     /**
       
   565      * Get the background color setting.
       
   566      *
       
   567      * @since 1.0
       
   568      * @param
       
   569      * @return background color.
       
   570      */
       
   571      TGfxColor              BackgroundColor();
       
   572 
       
   573     /**
       
   574      * Get the paint setting.
       
   575      *
       
   576      * @since 1.0
       
   577      * @param
       
   578      * @return paint.
       
   579      */
       
   580      MGfxPaint*             Paint();
       
   581 
       
   582     /**
       
   583      * Get the rendering hints setting.
       
   584      *
       
   585      * @since 1.0
       
   586      * @param
       
   587      * @return rendering hints.
       
   588      */
       
   589      TGfxRenderingHints*    RenderingHints();
       
   590 
       
   591     /**
       
   592      * Get the stroke setting.
       
   593      *
       
   594      * @since 1.0
       
   595      * @param
       
   596      * @return stroke.
       
   597      */
       
   598      TGfxStroke             Stroke();
       
   599 
       
   600     /**
       
   601      * Get the transform setting.
       
   602      *
       
   603      * @since 1.0
       
   604      * @param
       
   605      * @return transform.
       
   606      */
       
   607      TGfxAffineTransform    Transform();
       
   608 
       
   609     /**
       
   610      * Get the clipping area setting.
       
   611      *
       
   612      * @since 1.0
       
   613      * @param
       
   614      * @return clipping area.
       
   615      */
       
   616      MGfxShape*             Clip();
       
   617 
       
   618     /**
       
   619      * Get the boundary setting.
       
   620      *
       
   621      * @since 1.0
       
   622      * @param
       
   623      * @return boundary.
       
   624      */
       
   625      TSize                  DeviceBounds();
       
   626     /**
       
   627      * Get the font setting.
       
   628      *
       
   629      * @since 1.0
       
   630      * @param
       
   631      * @return font.
       
   632      */
       
   633 
       
   634      CFont*                 Font();
       
   635 
       
   636     /**
       
   637      * Get the stroke setting.
       
   638      *
       
   639      * @since 1.0
       
   640      * @param aArray : array of points to store dash array info
       
   641      * @param aOffset : offset point dash array offset info
       
   642      * @return
       
   643      */
       
   644      void                   GetDashArray( CArrayFix<TFloatFixPt>*& aArray,
       
   645                                                   TFloatFixPt& aOffset );
       
   646 
       
   647     /**
       
   648      * Set the composite info.
       
   649      *
       
   650      * @since 1.0
       
   651      * @param aComposite : composite info
       
   652      * @return
       
   653      */
       
   654      void                   SetComposite( const TUint8 aComposite );
       
   655 
       
   656     /**
       
   657      * Set the foreground color.
       
   658      *
       
   659      * @since 1.0
       
   660      * @param aColor : foreground color
       
   661      * @return
       
   662      */
       
   663      void                   SetForegroundColor( const TGfxColor& aColor );
       
   664 
       
   665     /**
       
   666      * Set the background color.
       
   667      *
       
   668      * @since 1.0
       
   669      * @param aColor : background color
       
   670      * @return
       
   671      */
       
   672      void                   SetBackgroundColor( const TGfxColor& aColor );
       
   673 
       
   674     /**
       
   675      * Set the paint info.
       
   676      *
       
   677      * @since 1.0
       
   678      * @param aPaint : paint info
       
   679      * @return
       
   680      */
       
   681      void                   SetPaint( MGfxPaint* aPaint );
       
   682 
       
   683     /**
       
   684      * Set the stroke info.
       
   685      *
       
   686      * @since 1.0
       
   687      * @param aStroke : stroke info
       
   688      * @return
       
   689      */
       
   690      void                   SetStroke( TGfxStroke aStroke );
       
   691 
       
   692     /**
       
   693      * Set the rendering hints.
       
   694      *
       
   695      * @since 1.0
       
   696      * @param aRenderingHints : rendering hints
       
   697      * @return
       
   698      */
       
   699      void                   SetRenderingHints( const TGfxRenderingHints& aRenderingHints );
       
   700 
       
   701     /**
       
   702      * Set the transform info.
       
   703      *
       
   704      * @since 1.0
       
   705      * @param aTransform : transform info
       
   706      * @return
       
   707      */
       
   708      void                   SetTransform( const TGfxAffineTransform& aTransform );
       
   709 
       
   710     /**
       
   711      * Set the clipping info.
       
   712      *
       
   713      * @since 1.0
       
   714      * @param aClip : clipping rectangle
       
   715      * @return
       
   716      */
       
   717      void                   SetClip( const TGfxRectangle2D& aClip );
       
   718 
       
   719     /**
       
   720      * Set the font.
       
   721      *
       
   722      * @since 1.0
       
   723      * @param aFont : font
       
   724      * @return
       
   725      */
       
   726 
       
   727      void                   SetFont( const CFont* aFont );
       
   728 
       
   729     /**
       
   730      * Set the dash array info.
       
   731      *
       
   732      * @since 1.0
       
   733      * @param aArray : array of points
       
   734      * @param aOffset : offset point
       
   735      * @return
       
   736      */
       
   737      void                   SetDashArrayL( CArrayFix<TFloatFixPt>* aArray);
       
   738      void                   SetDashOffset( TFloatFixPt aDashOffset );
       
   739     /**
       
   740      * Set the font size.
       
   741      *
       
   742      * @since 1.0
       
   743      * @param aFontSize : font size
       
   744      * @return
       
   745      */
       
   746      void                   SetFontSize( const TFloatFixPt aFontSize );
       
   747 
       
   748     /**
       
   749      * Set the winding rule.
       
   750      *
       
   751      * @since 1.0
       
   752      * @param aRule : winding rule
       
   753      * @return
       
   754      */
       
   755      void                   SetWindingRule( TGfxWindingRule aRule );
       
   756 
       
   757     /**
       
   758      * Set the font weight.
       
   759      *
       
   760      * @since 1.0
       
   761      * @param aFontWeight : font weight value
       
   762      * @return
       
   763      */
       
   764      void                   SetFontWeight( const TInt32 aFontWeight );
       
   765 
       
   766     /**
       
   767      * Set the font style.
       
   768      *
       
   769      * @since 1.0
       
   770      * @param aFontStyle : font style
       
   771      * @return
       
   772      */
       
   773      void                   SetFontStyle( const TInt32 aFontStyle );
       
   774 
       
   775     /**
       
   776      * Set the font family.
       
   777      *
       
   778      * @since 1.0
       
   779      * @param aFamilies : font family names
       
   780      * @return
       
   781      */
       
   782      void                   SetFontFamily( CDesCArrayFlat* aFamilies );
       
   783 
       
   784     /**
       
   785      * Set the text anchor
       
   786      *
       
   787      * @since 1.0
       
   788      * @param aTextAnchor : text anchor value
       
   789      * @return
       
   790      */
       
   791      void                   SetTextanchor( const TInt32 aTextAnchor );
       
   792 
       
   793     /**
       
   794      * Set the text decoration
       
   795      *
       
   796      * @since 1.0
       
   797      * @param aTextDecoration : text decoration value
       
   798      * @return
       
   799      */
       
   800      void                   SetTextDecoration( const TInt32 aTextDecoration );
       
   801 
       
   802     /**
       
   803      * Set the anti-alias mode
       
   804      *
       
   805      * @since 1.0
       
   806      * @param aTextDecoration : anti-alias mode value
       
   807      * @return
       
   808      */
       
   809      void                   SetAntialiasingMode( const TInt32 aAntialiasingEnable );
       
   810 
       
   811     /**
       
   812      * This method copies the internal RGBA8888 framebuffer to CfbsBitmap that
       
   813      * is specified in constructor. The CfbsBitmap could be 4k color (RGB0444),
       
   814      * 64k color (RGB565), or 16M color (RGB888).
       
   815      *
       
   816      * @since
       
   817      * @param
       
   818      * @return
       
   819      */
       
   820 
       
   821     void UpdateFramebufferL( CFbsBitmap* aBitmap, CFbsBitmap* aMask );
       
   822     void UpdateFramebufferL( CFbsBitmap* aFrameBuffer, CFbsBitmap* aMask,TSize aFrameBufferSize,TDisplayMode aFrameBufferMode,TDisplayMode aMaskDspMode );
       
   823         
       
   824     /**
       
   825      * Blend aFrameBuffer with background buffer using the opacity value
       
   826      *
       
   827      * @since 1.0
       
   828      * @param aFrameBuffer: Buffer to be blended with background
       
   829      *        aOpacity: opacity value (0<=aOpacity<=1.0)
       
   830      * @return
       
   831      */
       
   832      void BlendWithBackground(TUint32* aFrameBuffer, TReal32 aOpacity);
       
   833 
       
   834     /**
       
   835      * return ibuffer
       
   836      *
       
   837      * @since 1.0
       
   838      * @param
       
   839      *
       
   840      * @return pointer
       
   841      */
       
   842 
       
   843     void GenerateMask(CFbsBitmap* aMask);
       
   844 
       
   845       /**
       
   846      * Set the fill opacity value
       
   847      *
       
   848      * @since 1.0
       
   849      * @param aFillOpacity : opacity value (0<=aFillOpacity<=1.0)
       
   850      * @return
       
   851      */
       
   852     void                   SetFillOpacity(TFloatFixPt aFillOpacity);
       
   853 
       
   854     /**
       
   855      * Set the stroke opacity value
       
   856      *
       
   857      * @since 1.0
       
   858      * @param aStrokeOpacity : opacity value (0<=aStrokeOpacity<=1.0)
       
   859      * @return
       
   860      */
       
   861     void                   SetStrokeOpacity(TFloatFixPt aStrokeOpacity);
       
   862 
       
   863     /**
       
   864      * Set the flag to do or ignore dithering.
       
   865      *
       
   866      * @since 1.0
       
   867      * @param aDoDithering : TRUE or False
       
   868      * @return
       
   869      */
       
   870     void                   SetDoDithering( TBool aDoDithering );
       
   871 
       
   872     /**
       
   873      * Request to change the buffer size.
       
   874      *
       
   875      * @since 1.0
       
   876      * @param aSize : size of new buffer
       
   877      * @return
       
   878      */
       
   879      void                   ChangeBufferSizeL( const TSize aBufferSize );
       
   880 
       
   881     /**
       
   882      * Request to update the context color buffer.
       
   883      *
       
   884      * @since 1.0
       
   885      * @return
       
   886      */
       
   887      void                   UpdateColorBuffer();
       
   888 
       
   889     /**
       
   890      * Get the 32-bit color buffer for this gfx context.
       
   891      *
       
   892      * @since 1.0
       
   893      * @return
       
   894      */
       
   895       TUint32* ColorBuffer();
       
   896 
       
   897 private:
       
   898 
       
   899     /**
       
   900      * Constructor
       
   901      */
       
   902                                     CGfx2dGcVGR();
       
   903 
       
   904     /**
       
   905      * Two-phase constructor
       
   906      */
       
   907     void                            ConstructL( const TSize aBufferSize, TFontSpec& aFontSpec, CSvgBitmapFontProvider *aSvgBitmapFontProvider);
       
   908 
       
   909     /**
       
   910      * Perform the drawing operations of the given shape.
       
   911      *
       
   912      * @since 1.0
       
   913      * @param aShape : shape to draw
       
   914      * @return
       
   915      */
       
   916     void                            DoDrawL( MGfxShape* aShape );
       
   917 
       
   918 
       
   919     /**
       
   920      * Clear context routine in assembly for performance.
       
   921      * @since 1.0
       
   922      * @param pBitmap : pointer to bitmap
       
   923      * @param aColor : color to clear background
       
   924      * @param aSize : number of pixels to clear
       
   925      * @return
       
   926      */
       
   927     void                            ClearAsm( TInt* pBitmap,
       
   928                                               TInt aColor,
       
   929                                               TInt aSize );
       
   930 
       
   931     /**
       
   932      * Activate this context with the given graphics device.
       
   933      *
       
   934      * @since 1.0
       
   935      * @param : aDevice -- graphics device.
       
   936      * @return
       
   937      */
       
   938     void                   ActivateL();
       
   939 
       
   940 
       
   941     void ColorConvertTo64K( TUint32* aDestAddress, const TSize& aSize );
       
   942 
       
   943     void PostDraw();
       
   944     };
       
   945 #endif      // GFX2DGCINT_H