os/graphics/graphicsdeviceinterface/gdi/inc/GDI.INL
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicsdeviceinterface/gdi/inc/GDI.INL	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,655 @@
     1.4 +// Copyright (c) 1998-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 +// TRgb
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +
    1.22 +inline TRgb::TRgb():
    1.23 +	iValue(0xffffffff)
    1.24 +	/**  Constructs a TRgb initialised to KRgbWhite.*/
    1.25 +	{}
    1.26 +
    1.27 +
    1.28 +inline TRgb::TRgb(TUint32 aValue):
    1.29 +	iValue(((aValue & 0xff0000) >> 16) | (aValue & 0x00ff00) | ((aValue & 0x0000ff) << 16) | (0xff000000 - (aValue & 0xff000000)))
    1.30 +/** Constructs a TRgb directly from a single 32-bit integer.
    1.31 +
    1.32 +The integer is of the form 0xaabbggrr, where bb is the hex number for blue,
    1.33 +gg is the hex number for green, rr is the hex number for red, and aa is the hex number for
    1.34 +"transparency" alpha (0 means opaque, 255 means transparent).
    1.35 +
    1.36 +This constructor is deprecated. The byte order of Red ,Green and Blue
    1.37 +does not match other constructors and methods in this class,
    1.38 +and the meaning of alpha is reversed compared to current convention.
    1.39 +
    1.40 +For example, TRgb(0x00080402) using this constructor
    1.41 +can be replaced with the 3 colour constructor TRgb(2,4,8).
    1.42 +The equivalent explicit alpha constructors are TRgb(0x020408,0xff) and TRgb(2,4,8,255).
    1.43 +The equivalent call to SetInternal is SetInternal(0xff020408).
    1.44 +
    1.45 +This constructor is deprecated. Use other constructors or SetInternal() instead.
    1.46 +
    1.47 +@param aValue Integer representing colour value. Takes form 0x00bbggrr.
    1.48 +@deprecated  */
    1.49 +	{}
    1.50 +
    1.51 +inline TRgb::TRgb(TUint32 aInternalValue, TInt aAlpha) :
    1.52 +	iValue((aInternalValue & 0x00ffffff) | (aAlpha << 24))
    1.53 +/** Constructs a TRgb from a 32-bit integer (which corresponds to a colour) and from an alpha value.
    1.54 +
    1.55 +The first parameter is of the form 0x00rrggbb, where rr is the hex number for red,
    1.56 +gg is the hex number for green, and bb is the hex number for blue.
    1.57 +
    1.58 +The second parameter corresponds to an alpha channel (0 means transparent, 255 means opaque).
    1.59 +
    1.60 +For example, TRgb(2,4,8,255) using the 3 colour+alpha constructor is equal to TRgb(0x00020408, 255) using
    1.61 +this constructor.
    1.62 +
    1.63 +This constructor, which implements alpha in the conventional way,
    1.64 +replaces TRgb( TUint32 aValue ) which is deprecated.
    1.65 +
    1.66 +@param aInternalValue	Integer representing a colour value, which takes the form 0x00rrggbb.
    1.67 +@param aAlpha		Alpha component of the colour (0 - 255).*/
    1.68 +	{
    1.69 +	}
    1.70 +
    1.71 +inline TRgb::TRgb(TInt aRed,TInt aGreen,TInt aBlue):
    1.72 +	iValue(aRed<<16|aGreen<<8|aBlue|0xff000000)
    1.73 +/** Constructs a TRgb from its three component colours.
    1.74 +
    1.75 +Each colour has a value between 0 and 255.
    1.76 +The alpha component is always set to opaque (255)
    1.77 +
    1.78 +@param aRed Red component of the colour (0 - 255).
    1.79 +@param aGreen Green component of the colour (0 -  255).
    1.80 +@param aBlue Blue component of the colour (0 - 255). */
    1.81 +	{}
    1.82 +
    1.83 +/** Constructs a TRgb from its three colour components and alpha component.
    1.84 +
    1.85 +Each component has a value between 0 and 255.
    1.86 +The fourth parameter corresponds to an alpha channel (0 means transparent, 255 means opaque).
    1.87 +
    1.88 +This constructor, which implements alpha in the conventional way,
    1.89 +replaces TRgb( TUint32 aValue ) which is deprecated.
    1.90 +
    1.91 +@param aRed Red component of the colour (0 - 255). 
    1.92 +@param aGreen Green component of the colour (0 -  255). 
    1.93 +@param aBlue Blue component of the colour (0 - 255).
    1.94 +@param aAlpha Alpha component of the colour (0 - 255).*/
    1.95 +inline TRgb::TRgb(TInt aRed,TInt aGreen,TInt aBlue, TInt aAlpha):
    1.96 +	iValue(aRed<<16|aGreen<<8|aBlue|aAlpha<<24)
    1.97 +	{}
    1.98 +
    1.99 +
   1.100 +inline TInt TRgb::Red() const
   1.101 +/** Gets the red component.
   1.102 +
   1.103 +@return The red component (0 - 255). */
   1.104 +	{return((iValue&0xff0000)>>16);}
   1.105 +
   1.106 +
   1.107 +inline TInt TRgb::Green() const
   1.108 +/** Gets the green component.
   1.109 +
   1.110 +@return The green component (0 - 255). */
   1.111 +	{return((iValue&0xff00)>>8);}
   1.112 +
   1.113 +
   1.114 +inline TInt TRgb::Blue() const
   1.115 +/** Gets the blue component.
   1.116 +
   1.117 +@return The blue component (0 - 255). */
   1.118 +	{return(iValue&0xff);}
   1.119 +
   1.120 + 
   1.121 +inline TBool TRgb::operator==(const TRgb& aColor) const
   1.122 +/** Compares this colour with the specified colour for equality.
   1.123 +
   1.124 +For two colours to be equal, their red, green and blue components must all 
   1.125 +be equal.
   1.126 +
   1.127 +@param aColor Colour to be compared. 
   1.128 +@return ETrue. if the colours are equal; EFalse, otherwise. */
   1.129 + 
   1.130 +	{return(iValue==aColor.iValue);}
   1.131 +
   1.132 + 
   1.133 +inline TBool TRgb::operator!=(const TRgb& aColor) const
   1.134 +/** Compares this colour with the specified colour for inequality.
   1.135 +
   1.136 +Two colours are unequal if one at least one of their red, green and blue components 
   1.137 +are unequal.
   1.138 +
   1.139 +@param aColor Colour to be compared. 
   1.140 +@return ETrue, if the colours are not equal; EFalse, otherwise.
   1.141 + */
   1.142 +	{return(!(*this==aColor));}
   1.143 + 
   1.144 +inline TRgb& TRgb::operator&=(const TRgb& aColor)
   1.145 +/** Logical AND assignment operator.
   1.146 +
   1.147 +The operator ANDs the first operand with the second and then assigns the result 
   1.148 +back to the first operand.
   1.149 +
   1.150 +Note:
   1.151 +
   1.152 +This operates in the TRgb domain. Graphics defines logical operations for 
   1.153 +drawing primitives which operate in the device colour domain.
   1.154 +
   1.155 +@param aColor Colour to be compared. 
   1.156 +@return First operand-contains result of logical AND. */
   1.157 +	{iValue&=aColor.iValue;return(*this);}
   1.158 +
   1.159 +inline TRgb& TRgb::operator|=(const TRgb& aColor)
   1.160 +/** Logical OR assignment operator.
   1.161 +
   1.162 +The operator ORs the first operand with the second and then assigns the result 
   1.163 +back to the first operand.
   1.164 +
   1.165 +Note:
   1.166 +
   1.167 +This operates in the TRgb domain. Graphics defines logical operations for 
   1.168 +drawing primitives which operate in the device colour domain.
   1.169 +
   1.170 +@param aColor Colour to be compared. 
   1.171 +@return First operand- contains result of logical OR. */
   1.172 +	{iValue|=aColor.iValue;return(*this);}
   1.173 +
   1.174 + 
   1.175 +inline TRgb& TRgb::operator^=(const TRgb& aColor)
   1.176 +/** Logical EXCLUSIVE OR assignment operator.
   1.177 +
   1.178 +The operator Exclusive ORs the first operand with the second and then assigns 
   1.179 +the result back to the first operand.
   1.180 +
   1.181 +Note:
   1.182 +
   1.183 +This operates in the TRgb domain. Graphics defines logical operations for 
   1.184 +drawing primitives which operate in the device colour domain.
   1.185 +
   1.186 +@param aColor Colour to be compared. 
   1.187 +@return First operand  contains result of logical Exclusive OR. */
   1.188 +	{iValue^=aColor.iValue;iValue^=0xff000000; return(*this);}
   1.189 +
   1.190 +
   1.191 +inline TUint32 TRgb::Value() const
   1.192 +/** Gets the 32-bit value of the TRgb as an integer.
   1.193 +This function is deprecated. Use Internal() instead.
   1.194 +Note: the order of Red, Green and Blue components returned by this method
   1.195 +is reversed compared to all other methods. The alpha value is also reversed in meaning
   1.196 +compared to current convention, such that 0 represents opaque and 0xff represents transparent.
   1.197 +
   1.198 +@return The 32 bit value of the TRgb. Has the form 0xaabbggrr, where bb is the hex number for blue,
   1.199 +gg is the hex number for green, rr is the hex number for red, and aa is the hex number for
   1.200 +"transparency" alpha (0 means opaque, 255 means transparent).
   1.201 +@deprecated */
   1.202 +		//					rr							gg						bb								aa
   1.203 +		{return (((iValue & 0xff0000) >> 16) | (iValue & 0x00ff00) | ((iValue & 0x0000ff) << 16) | (0xff000000 - (iValue & 0xff000000)));}
   1.204 +
   1.205 +inline TUint32 TRgb::Internal() const
   1.206 +/** Gets the 32-bit value of the TRgb as an integer.
   1.207 +
   1.208 +@return The 32 bit value of the TRgb. Has the form 0xaarrggbb. */
   1.209 +		{return (iValue);}
   1.210 +
   1.211 +inline void TRgb::SetInternal(TUint32 aInternal)
   1.212 +/** Sets the 32-bit value of the TRgb as a 32-bit integer.
   1.213 +@param aInternal Colour internal representation. Has the form 0xaarrggbb.
   1.214 +*/
   1.215 +		{iValue = aInternal;}
   1.216 +
   1.217 +inline TRgb TRgb::operator~() const
   1.218 +/** Bitwise logical inversion operator.
   1.219 +
   1.220 +@return Contains results of logical inversion. */
   1.221 +	{TRgb rgb; rgb.SetInternal(iValue^0x00ffffff); return rgb;}
   1.222 +
   1.223 + 
   1.224 +inline TRgb TRgb::operator&(const TRgb& aColor)
   1.225 +/** Bitwise logical AND operator.
   1.226 +
   1.227 +@param aColor Colour to be compared. 
   1.228 +@return Contains results of logical AND. */
   1.229 +	{TRgb rgb; rgb.SetInternal(iValue&aColor.iValue); return rgb;}
   1.230 +
   1.231 + 
   1.232 +inline TRgb TRgb::operator|(const TRgb& aColor)
   1.233 +/** Bitwise logical OR operator.
   1.234 +
   1.235 +@param aColor Colour to be compared. 
   1.236 +@return Contains results of logical OR. */
   1.237 +	{TRgb rgb; rgb.SetInternal(iValue|aColor.iValue); return rgb;}
   1.238 +
   1.239 + 
   1.240 +inline TRgb TRgb::operator^(const TRgb& aColor)
   1.241 +/** Bitwise EXCLUSIVE OR operator
   1.242 +
   1.243 +@param aColor Colour to be compared. 
   1.244 +@return Contains results of logical EXCLUSIVE OR. */
   1.245 +	{TRgb rgb; rgb.SetInternal(iValue^aColor.iValue); return rgb;}
   1.246 +
   1.247 +
   1.248 +/** Gets TRgb from 2 level grayscale. 
   1.249 +
   1.250 +The function takes a grayscale argument and return a TRgb whose red, green 
   1.251 +and blue values are set to an appropriate level. 
   1.252 +
   1.253 +@param aGray2 Grayscale value to be converted. 
   1.254 +@return Equivalent 24 bit colour. Gray2 has only 2 levels (black and white), 
   1.255 +the function returns r=g=b=0 or r=g=b=255. */
   1.256 +inline TRgb TRgb::_Gray2(TInt aGray2)
   1.257 +	{
   1.258 +	if(aGray2) return(TRgb(0xffffff, 0xff));
   1.259 +	return(TRgb(0, 0xff));
   1.260 +	}
   1.261 + 
   1.262 +/** Gets TRgb from 4 level grayscale. 
   1.263 +
   1.264 +The function takes a grayscale argument and return a TRgb whose red, green 
   1.265 +and blue values are set to an appropriate level.
   1.266 +
   1.267 +@param aGray4 Grayscale value to be converted. 
   1.268 +@return Equivalent 24 bit colour. Gray4 has 4 levels-  the function returns 
   1.269 +r=g=b=85*c, where c=0,1,2, or 3. */
   1.270 +inline TRgb TRgb::_Gray4(TInt aGray4)
   1.271 +	{
   1.272 +	aGray4&=3;
   1.273 +	aGray4|=aGray4<<2;
   1.274 +	aGray4|=aGray4<<4;
   1.275 +	return(TRgb(aGray4,aGray4,aGray4));
   1.276 +	}
   1.277 + 
   1.278 +/** Gets TRgb from 16 level grayscale. 
   1.279 +
   1.280 +The function takes a grayscale argument and return a TRgb whose red, green 
   1.281 +and blue values are set to an appropriate level.
   1.282 +
   1.283 +@param aGray16 Grayscale value to be converted. 
   1.284 +@return Equivalent 24 bit colour. Gray16 has 16 levels - the function returns 
   1.285 +r=g=b=17*c, where c=0, 1, ... 15. */
   1.286 +inline TRgb TRgb::_Gray16(TInt aGray16)
   1.287 +	{
   1.288 +	aGray16&=0xf;
   1.289 +	aGray16|=aGray16<<4;
   1.290 +	return(TRgb(aGray16,aGray16,aGray16));
   1.291 +	}
   1.292 +
   1.293 +/** Gets TRgb from 256 level grayscale. 
   1.294 +
   1.295 +The function takes a grayscale argument and return a TRgb whose red, green 
   1.296 +and blue values are set to an appropriate level.
   1.297 +
   1.298 +@param aGray256 Grayscale value to be converted. 
   1.299 +@return Equivalent 24 bit colour. Gray256 has 256 levels- the function 
   1.300 +returns r=g=b=c, where c=0, 1, ... 255. */
   1.301 +inline TRgb TRgb::_Gray256(TInt aGray256)
   1.302 +	{
   1.303 +	aGray256&=0xff;
   1.304 +	return(TRgb(aGray256,aGray256,aGray256));
   1.305 +	}
   1.306 +
   1.307 +/** Gets TRgb from 4K colour index.
   1.308 +
   1.309 +The function takes a 12 bit index into a colour palette and returns a TRgb 
   1.310 +whose red, green and blue values are set to an appropriate level.
   1.311 +
   1.312 +@param aColor4K 12 bit index into a colour palette 
   1.313 +@return Equivalent 24 bit colour. */
   1.314 +inline TRgb TRgb::_Color4K(TInt aColor4K)
   1.315 +	{
   1.316 +	TUint32 value = (aColor4K & 0xf00) << 8;
   1.317 +	value |= (aColor4K & 0x0f0) << 4;
   1.318 +	value |= (aColor4K & 0x00f);
   1.319 +	return TRgb(value | (value << 4), 0xff);
   1.320 +	}
   1.321 +
   1.322 +/** Gets TRgb from 64K colour index.
   1.323 +
   1.324 +The function takes a 16 bit index into a colour palette and returns a TRgb 
   1.325 +whose red, green and blue values are set to an appropriate level.
   1.326 +
   1.327 +@param aColor64K 16 bit index into a colour palette 
   1.328 +@return Equivalent 24 bit colour. */
   1.329 +inline TRgb TRgb::_Color64K(TInt aColor64K)
   1.330 +	{
   1.331 +	TInt red = (aColor64K&0xF800)>>8;
   1.332 +	red += red>>5;
   1.333 +	TInt green = (aColor64K&0x07E0)>>3;
   1.334 +	green += green>>6;
   1.335 +	TInt blue = (aColor64K&0x001F)<<3;
   1.336 +	blue += blue>>5;
   1.337 +	return TRgb(red,green,blue);
   1.338 +	}
   1.339 +
   1.340 +/** Gets TRgb from 16M colour index.
   1.341 +
   1.342 +The function takes a 24 bit index into a colour palette and returns the TRgb 
   1.343 +whose red, green and blue values represent it exactly.
   1.344 +
   1.345 +@param a0RGB 24 bit index into a colour palette 
   1.346 +@return The TRgb which represents the index exactly. */
   1.347 +inline TRgb TRgb::_Color16M(TInt a0RGB)
   1.348 +	{
   1.349 +	return TRgb(a0RGB, 0xff);
   1.350 +	}
   1.351 +
   1.352 +/** Gets TRgb from 16MU colour index.
   1.353 +The function takes a 24 bit colour value with eight bits for each
   1.354 +component, blue in the low byte, and returns the TRgb
   1.355 +whose red, green and blue values represent it exactly.
   1.356 +@param     a0RGB The color - 0, R, G, B bytes. / BGR0 - little endian format /
   1.357 +@return    The TRgb which represents the index exactly. */
   1.358 +inline TRgb TRgb::_Color16MU(TInt a0RGB)
   1.359 +	{
   1.360 +	return TRgb(a0RGB, 0xff);
   1.361 +	}
   1.362 +
   1.363 +/** Gets the index of the closest TRgb value to this,
   1.364 +based on the matching display mode.
   1.365 +
   1.366 +@return    The index (0 - 1) representing the nearest TRgb. */	
   1.367 +inline TInt TRgb::_Gray2() const
   1.368 +	{
   1.369 +	return(Gray256()>>7);
   1.370 +	}
   1.371 +
   1.372 +/**Gets the index of the closest TRgb value to this,
   1.373 +based on the matching display mode.
   1.374 +
   1.375 +@return     The index (0 - 3) representing the nearest TRgb. */	
   1.376 +inline TInt TRgb::_Gray4() const
   1.377 +	{
   1.378 +	return(Gray256()>>6);
   1.379 +	}
   1.380 +
   1.381 +/** Gets the index of the closest TRgb value to this,
   1.382 +based on the matching display mode.
   1.383 +
   1.384 +@return     The index (0 - 15) representing the nearest TRgb.*/	
   1.385 +inline TInt TRgb::_Gray16() const
   1.386 +	{
   1.387 +	return(Gray256()>>4);
   1.388 +	}
   1.389 +
   1.390 +/** Gets the index of the closest TRgb value to this,
   1.391 +based on the matching display mode.
   1.392 +
   1.393 +@return     The index (0 - 255) representing the nearest TRgb.*/	
   1.394 +inline TInt TRgb::_Gray256() const
   1.395 +	{
   1.396 +	return(((Red()<<1)+Green()+(Green()<<2)+Blue())>>3);
   1.397 +	}
   1.398 +
   1.399 +/** Gets the index of the closest TRgb value to this,
   1.400 +based on the matching display mode.
   1.401 +
   1.402 +@return The index (0 - 4095) representing the nearest TRgb. */	
   1.403 +inline TInt TRgb::_Color4K() const
   1.404 +	{
   1.405 +	TInt color4K = (iValue & 0x0000f0) >> 4;
   1.406 +	color4K |= (iValue & 0x00f000) >> 8;
   1.407 +	color4K |= (iValue & 0xf00000) >> 12;
   1.408 +	return color4K;
   1.409 +	} //0RGB
   1.410 +
   1.411 +/**  Gets the index of the closest TRgb value to this,
   1.412 +based on the matching display mode.
   1.413 +
   1.414 +@return The index (0 - 65535) representing the nearest TRgb.*/	
   1.415 +inline TInt TRgb::_Color64K() const
   1.416 +	{
   1.417 +	TInt color64K = (iValue & 0x0000f8) >> 3;
   1.418 +	color64K |= (iValue & 0x00fc00) >> 5;
   1.419 +	color64K |= (iValue & 0xf80000) >> 8;
   1.420 +	return color64K;
   1.421 +	}
   1.422 +
   1.423 +/** Gets the index of the closest TRgb value to this,
   1.424 +based on the matching display mode.
   1.425 +
   1.426 +@return The index (0 - 16777215) representing the nearest TRgb.*/	
   1.427 +inline TInt TRgb::_Color16M() const
   1.428 +	{
   1.429 +	return (iValue & 0xffffff);
   1.430 +	// 0RGB
   1.431 +	}
   1.432 +
   1.433 +/** Gets the index of the closest TRgb value to this, based on the matching display mode.
   1.434 +@return   The index (0 - 16777215) representing the nearest TRgb. */
   1.435 +inline TInt TRgb::_Color16MU() const
   1.436 +	{
   1.437 +	return (iValue & 0xffffff);
   1.438 +	// 0RGB
   1.439 +	}
   1.440 +
   1.441 +
   1.442 +/** Gets the alpha component.
   1.443 +@return The alpha component (0 - 255). */
   1.444 +inline TInt TRgb::Alpha() const
   1.445 +	{return (iValue >> 24);}
   1.446 +
   1.447 +
   1.448 +/** Gets TRgb from 16MA colour index.
   1.449 +The function takes a 32 bit colour value with eight bits for each
   1.450 +component, blue in the low byte, and returns the TRgb
   1.451 +whose red, green, blue and alpha values represent it exactly.
   1.452 +@param     aARGB The color - A, R, G, B bytes. / BGR0 - little endian format /
   1.453 +@return    The TRgb which represents the index exactly. */
   1.454 +inline TRgb TRgb::_Color16MA(TUint aARGB)
   1.455 +	{
   1.456 +	TRgb col; col.SetInternal(aARGB); 
   1.457 +	return col;
   1.458 +	}
   1.459 +
   1.460 +/** Gets the index of the closest TRgb value to this, based on the matching display mode.
   1.461 +@return   The index (0 - 16777215) representing the nearest TRgb. */
   1.462 +inline TUint TRgb::_Color16MA() const
   1.463 +	{
   1.464 +	return (iValue);
   1.465 +	// ARGB
   1.466 +	}
   1.467 +//
   1.468 +// CPalette
   1.469 +//
   1.470 +
   1.471 + 
   1.472 +inline TInt CPalette::Entries() const
   1.473 +/** Gets the number of entries in the palette
   1.474 +
   1.475 +@return The number of entries in the palette. */
   1.476 +	{return(iNumEntries);}
   1.477 +
   1.478 +//
   1.479 +// TColor256Utils
   1.480 +//
   1.481 +
   1.482 + 
   1.483 +inline TRgb TColor256Util::Color256(TInt aColor256) const
   1.484 +/** Gets the TRgb value of the entry at the specified index in the colour lookup 
   1.485 +table.
   1.486 +
   1.487 +@param aColor256 The index into the colour lookup table.
   1.488 +@return The TRgb value of the entry at the specified index. */
   1.489 +	{ return TRgb(iColorTable[aColor256]); }
   1.490 +
   1.491 +//
   1.492 +// TFontStyle
   1.493 +//
   1.494 +inline TGlyphBitmapType TFontStyle::BitmapType() const
   1.495 +/** Gets the anti-aliasing setting for the font, as set by SetBitmapType().
   1.496 +
   1.497 +@return Indicates whether or not this font should be drawn using anti-aliasing. */
   1.498 +	{
   1.499 +	return (TGlyphBitmapType)(iFlags >> 16);
   1.500 +	}
   1.501 +
   1.502 + 
   1.503 +inline void TFontStyle::SetBitmapType(TGlyphBitmapType aBitmapType)
   1.504 +/** Sets whether the font should be drawn using anti-aliasing. If set, this value 
   1.505 +overrides the default setting (set by CFbsTypefaceStore::SetDefaultBitmapType()) 
   1.506 +for this font.
   1.507 +
   1.508 +Anti-aliasing can only be used for scalable fonts. There is currently no anti-aliasing 
   1.509 +support for bitmapped fonts.
   1.510 +
   1.511 +@param aBitmapType Indicates whether or not this font should be drawn using 
   1.512 +anti-aliasing. */
   1.513 +	{
   1.514 +	iFlags &= 0xFFFF;
   1.515 +	iFlags |= (aBitmapType << 16);
   1.516 +	}
   1.517 +
   1.518 +//
   1.519 +// CBitmapDevice
   1.520 +//
   1.521 +
   1.522 + 
   1.523 +inline TInt CBitmapDevice::CreateBitmapContext(CBitmapContext*& aGC)
   1.524 +/** Creates a bitmap context for this bitmap device.
   1.525 +
   1.526 +@param aGC On return, holds a pointer to the created bitmap context. 
   1.527 +@return KErrNone, if successful; otherwise, another of the system-wide error 
   1.528 +codes. */
   1.529 +	{return(CreateContext((CGraphicsContext*&)aGC));} // relies on CBitmapContext deriving _only_ from CGraphicsContext
   1.530 +
   1.531 +//
   1.532 +// TPictureCapability
   1.533 +//
   1.534 +
   1.535 +inline TPictureCapability::TPictureCapability(TScalingType aScalingType,TBool aCroppable):
   1.536 +	iScalingType(aScalingType),iIsCroppable(aCroppable)
   1.537 +/** Constructs the object setting the scaling-type and croppability properties.
   1.538 +
   1.539 +@param aScalingType Whether or not the picture is scalable. 
   1.540 +@param aCroppable Whether or not the picture is croppable. */
   1.541 +	{}
   1.542 +
   1.543 +//
   1.544 +// TZoomFactor
   1.545 +//
   1.546 +
   1.547 + 
   1.548 +inline TZoomFactor::TZoomFactor(const MGraphicsDeviceMap* aDevice):
   1.549 +	iZoomFactor(TZoomFactor::EZoomOneToOne),
   1.550 +	iDevice(aDevice)
   1.551 +/** Constructs a zoom factor object for a specific graphics device map.
   1.552 +
   1.553 +The graphics map is either directly associated with a particular graphics 
   1.554 +device itself, or is associated with a hierarchy of device maps whose root 
   1.555 +map is associated with a particular graphics device.
   1.556 +
   1.557 +@param aDevice The graphics device map with which the zoom factor is associated. */
   1.558 +	{}
   1.559 +
   1.560 +inline TZoomFactor::TZoomFactor(const TZoomFactor* aDevice):
   1.561 +	iDevice(aDevice)
   1.562 +	{ 
   1.563 +	iZoomFactor=aDevice->iZoomFactor; 
   1.564 +	}
   1.565 +
   1.566 + 
   1.567 +inline void TZoomFactor::SetGraphicsDeviceMap(const MGraphicsDeviceMap* aDevice)
   1.568 +/** Sets the graphics device map for this zoom factor object.
   1.569 +
   1.570 +@param aDevice The graphics device map for this TZoomFactor. */
   1.571 +	{iDevice=aDevice;}
   1.572 +
   1.573 + 
   1.574 +inline const MGraphicsDeviceMap* TZoomFactor::GraphicsDeviceMap() const
   1.575 +/** Gets the graphics device map of this zoom factor object.
   1.576 +
   1.577 +@return The graphics device map of the TZoomFactor. */
   1.578 +	{return(iDevice);}
   1.579 +
   1.580 +
   1.581 +
   1.582 +/** Gets the ascent of an ANSI capital letter in the font whether or not
   1.583 +there are any ANSI capitals in the font.
   1.584 +@return The positive distance from the font baseline to the top of a
   1.585 +standard ANSI capital letter
   1.586 +@publishedAll
   1.587 +@released
   1.588 +*/
   1.589 +inline TInt CFont::FontCapitalAscent() const
   1.590 +	{
   1.591 +	return ExtendedFunction(KFontCapitalAscent);
   1.592 +	}
   1.593 +
   1.594 +/** Gets the max ascent of any pre-composed glyph in the font. This will
   1.595 +include accents or diacritics that form part of pre-composed glyphs. It is
   1.596 +not guaranteed to cover the max ascent of composite glyphs that have to be
   1.597 +created by a layout engine. This is also the recommended distance between
   1.598 +the top of a text box and the baseline of the first line of text. 
   1.599 +@return The positive distance from the font baseline to the top of the
   1.600 +highest pre-composed glyph (including accents) above the baseline
   1.601 +@publishedAll
   1.602 +@released
   1.603 +*/
   1.604 +inline TInt CFont::FontMaxAscent() const
   1.605 +	{
   1.606 +	return ExtendedFunction(KFontMaxAscent);
   1.607 +	}
   1.608 +
   1.609 +/** Gets the descent of an ANSI descending character in the font.
   1.610 +Whether or not there are any ANSI descenders in the font.
   1.611 +@return The positive distance from the font baseline to the bottom of the
   1.612 +lowest ANSI descender
   1.613 +@publishedAll
   1.614 +@released
   1.615 +*/
   1.616 +inline TInt CFont::FontStandardDescent() const
   1.617 +	{
   1.618 +	return ExtendedFunction(KFontStandardDescent);
   1.619 +	}
   1.620 +
   1.621 +/** Gets the max descent of any pre-composed glyph in the font. This will
   1.622 +include accents or diacritics that form part of pre-composed glyphs. It is
   1.623 +not guaranteed to cover the max descent of composite glyphs that have to be
   1.624 +created by a layout engine.
   1.625 +@return The positive distance from the font baseline to the bottom of the
   1.626 +lowest pre-composed glyph (including accents) below the baseline
   1.627 +@publishedAll
   1.628 +@released
   1.629 +*/
   1.630 +inline TInt CFont::FontMaxDescent() const
   1.631 +	{
   1.632 +	return ExtendedFunction(KFontMaxDescent);
   1.633 +	}
   1.634 +
   1.635 +/** Gets the suggested line gap for the font. This is the recommended
   1.636 +baseline to baseline distance between successive lines of text in the font.
   1.637 +@return The positive recommended gap between successive lines
   1.638 +@publishedAll
   1.639 +@released
   1.640 +*/
   1.641 +inline TInt CFont::FontLineGap() const
   1.642 +	{
   1.643 +	return ExtendedFunction(KFontLineGap);
   1.644 +	}
   1.645 +
   1.646 +/**
   1.647 +Gets the (positive) maximum height in pixels of the font.
   1.648 +This may differ from the design height.
   1.649 +
   1.650 +@return The maximum height of the font.
   1.651 +@publishedAll
   1.652 +@released
   1.653 +*/
   1.654 +inline TInt CFont::FontMaxHeight() const
   1.655 +	{
   1.656 +	return FontMaxAscent() + FontMaxDescent();
   1.657 +	}
   1.658 +