graphicsdeviceinterface/bitgdi/sbit/FONTBMP.CPP
changeset 0 5d03bc08d59c
child 116 171fae344dd4
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <bitdev.h>
       
    17 #include "BITPANIC.H"
       
    18 
       
    19 /**
       
    20 Construct calls the constructor for the base class CFbsFont and sets default
       
    21 value of iCopy as EFalse.
       
    22 */
       
    23 EXPORT_C CFbsBitGcFont::CFbsBitGcFont():
       
    24 	CFbsFont(),
       
    25 	iCopy(EFalse)
       
    26 	{}
       
    27 
       
    28 /**
       
    29 Default destructor. 
       
    30 */
       
    31 EXPORT_C CFbsBitGcFont::~CFbsBitGcFont()
       
    32 	{}
       
    33 
       
    34 /**
       
    35 On return contains iAddress pointer for the CBitmapFont.
       
    36 @return CBitmapFont* A pointer to the font
       
    37 @see CFbsFont::Address();
       
    38 */
       
    39 EXPORT_C CBitmapFont* CFbsBitGcFont::Address() const
       
    40 	{
       
    41 	return CFbsFont::Address();
       
    42 	}
       
    43 
       
    44 /**
       
    45 Calls reset on the object (sets iHandle to zero and carries out related 
       
    46 messenger housekeeping and then duplicates it using the base class method.
       
    47 @param TInt aHandle Is the integer handler for the font.
       
    48 @return TInt KErrNone If successful else a system wide error code.
       
    49 @see CFbsFont::Duplicate(TInt)
       
    50 */
       
    51 EXPORT_C TInt CFbsBitGcFont::Duplicate(TInt aHandle)
       
    52 	{
       
    53 	Reset();
       
    54 
       
    55 	return CFbsFont::Duplicate(aHandle);
       
    56 	}
       
    57 
       
    58 /**
       
    59 Resets the graphics context to its default settings.
       
    60 
       
    61 The function provides a concrete implementation of the pure virtual
       
    62 function <code>CGraphicsContext::Reset()</code>. The function
       
    63 behaviour is the same as documented in that class.
       
    64 */
       
    65 EXPORT_C void CFbsBitGcFont::Reset()
       
    66 	{
       
    67 	if (!iCopy)
       
    68 		CFbsFont::Reset();
       
    69 	else
       
    70 		{
       
    71 		iAddressPointer = NULL;
       
    72 		iHandle = 0;
       
    73 		iServerHandle = 0;
       
    74 		iCopy = EFalse;
       
    75 		}
       
    76 	}
       
    77 
       
    78 /**
       
    79 Defines the meaning of the equals operator when acting on a CFbsBitGcFont
       
    80 object. i.e. allows these objects to be set as being equal to one another.
       
    81 @param CFbsBitGcFont& aFont the font to be copied
       
    82 */
       
    83 EXPORT_C void CFbsBitGcFont::operator=(const CFbsBitGcFont& aFont)
       
    84 	{
       
    85 	Reset();
       
    86 	iAddressPointer = aFont.iAddressPointer;
       
    87 	iHandle = aFont.iHandle;
       
    88 	iServerHandle = aFont.iServerHandle;
       
    89 	iCopy = ETrue;
       
    90 	}
       
    91 
       
    92 /**
       
    93 Gets the bitmap address.
       
    94 @return The bitmap address.
       
    95 */
       
    96 EXPORT_C CBitwiseBitmap* CFbsBitGcBitmap::Address() const
       
    97 	{
       
    98 	return CFbsBitmap::CleanAddress();
       
    99 	}
       
   100 
       
   101 /**
       
   102 Locks the global bitmap heap 
       
   103 */
       
   104 EXPORT_C void CFbsBitGcBitmap::LockHeap() const
       
   105 	{
       
   106 	CFbsBitmap::LockHeap();
       
   107 	}
       
   108 
       
   109 /**
       
   110 Unlock the global bitmap heap 
       
   111 */
       
   112 EXPORT_C void CFbsBitGcBitmap::UnlockHeap() const
       
   113 	{
       
   114 	CFbsBitmap::UnlockHeap();
       
   115 	}
       
   116