fbs/fontandbitmapserver/sfbs/FBSBMP.CPP
branchRCL_3
changeset 186 1bc91eb0b8ae
parent 177 183e23d95fab
child 209 5c40347c6f16
equal deleted inserted replaced
177:183e23d95fab 186:1bc91eb0b8ae
   535 */	
   535 */	
   536 EXPORT_C TInt CFbsBitmap::Load(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded)
   536 EXPORT_C TInt CFbsBitmap::Load(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded)
   537 	{
   537 	{
   538     FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD_ENTRY, "> this=0x%08x; file=%S, id=0x%08x; share=%d", (TUint)this, aFileName, aId, aShareIfLoaded);)
   538     FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD_ENTRY, "> this=0x%08x; file=%S, id=0x%08x; share=%d", (TUint)this, aFileName, aId, aShareIfLoaded);)
   539 	TInt err = Load(aFileName,aId,aShareIfLoaded,0);
   539 	TInt err = Load(aFileName,aId,aShareIfLoaded,0);
   540     FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD_EXIT, "< this=0x%08x; err=%d", (TUint)this, err);)
   540     FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, err, iHandle, iServerHandle);)
   541 	return err; 
   541 	return err; 
   542 	}
   542 	}
   543 
   543 
   544 /**  Loads a specific bitmap from a multi-bitmap file.
   544 /**  Loads a specific bitmap from a multi-bitmap file.
   545 The bitmap may be shared by other font and bitmap server clients.
   545 The bitmap may be shared by other font and bitmap server clients.
   590                     }
   590                     }
   591                 file.Close();
   591                 file.Close();
   592                 }
   592                 }
   593             }
   593             }
   594 	    }
   594 	    }
   595     FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD2_EXIT, "< this=0x%08x; err=%d", (TUint)this, err);)
   595     FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD2_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, err, iHandle, iServerHandle);)
   596 	return err;
   596 	return err;
   597 	}
   597 	}
   598 
   598 
   599 /** Loads and compresses a specific bitmap from a multi-bitmap file.
   599 /** Loads and compresses a specific bitmap from a multi-bitmap file.
   600 The bitmap may be shared by other font and bitmap server clients.
   600 The bitmap may be shared by other font and bitmap server clients.
   610 */	
   610 */	
   611 EXPORT_C TInt CFbsBitmap::LoadAndCompress(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded)
   611 EXPORT_C TInt CFbsBitmap::LoadAndCompress(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded)
   612     {	
   612     {	
   613     FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS_ENTRY, "> this=0x%08x; file=%S; id=0x%08x; share=%d", (TUint)this, aFileName, aId, aShareIfLoaded);)
   613     FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS_ENTRY, "> this=0x%08x; file=%S; id=0x%08x; share=%d", (TUint)this, aFileName, aId, aShareIfLoaded);)
   614     TInt ret = LoadAndCompress(aFileName, aId, aShareIfLoaded, 0);
   614     TInt ret = LoadAndCompress(aFileName, aId, aShareIfLoaded, 0);
   615     FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS_EXIT, "< this=0x%08x; err=%d", (TUint)this, ret);)
   615     FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, ret, iHandle, iServerHandle);)
   616     return ret;
   616     return ret;
   617 	}
   617 	}
   618 
   618 
   619 /** Loads and compresses a specific bitmap from a multi-bitmap file.
   619 /** Loads and compresses a specific bitmap from a multi-bitmap file.
   620 The bitmap may be shared by other font and bitmap server clients. If the 
   620 The bitmap may be shared by other font and bitmap server clients. If the 
   636 	if (err == KErrNone)
   636 	if (err == KErrNone)
   637 		{
   637 		{
   638 		err = !(iFlags & EIsRomBitmap) ? Compress() : KErrAccessDenied;
   638 		err = !(iFlags & EIsRomBitmap) ? Compress() : KErrAccessDenied;
   639 		FBS_OST_IF(err!=KErrNone, OstTraceExt3( TRACE_ERROR, CFBSBITMAP_LOADANDCOMPRESS2_ERROR, "! this=0x%08x; iFlags=0x%08x; err=%d", (TUint)this, (TUint)iFlags, err);)
   639 		FBS_OST_IF(err!=KErrNone, OstTraceExt3( TRACE_ERROR, CFBSBITMAP_LOADANDCOMPRESS2_ERROR, "! this=0x%08x; iFlags=0x%08x; err=%d", (TUint)this, (TUint)iFlags, err);)
   640 		}
   640 		}
   641 	FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS2_EXIT, "< this=0x%08x; err=%d", (TUint)this, err);)
   641 	FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS2_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, err, iHandle, iServerHandle);)
   642 	return err;
   642 	return err;
   643 	}
   643 	}
   644 
   644 
   645 /** Saves the bitmap as a direct file store.
   645 /** Saves the bitmap as a direct file store.
   646 The file store overwrites any existing file with the same name.
   646 The file store overwrites any existing file with the same name.
  1830 	{
  1830 	{
  1831     FBS_OST(TFullName fileName;)
  1831     FBS_OST(TFullName fileName;)
  1832     FBS_OST(aFile.FullName(fileName);)
  1832     FBS_OST(aFile.FullName(fileName);)
  1833     FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD3_ENTRY, "> this=0x%08x; file=%S; id=0x%08x; share=%d", (TUint)this, fileName, aId, aShareIfLoaded);)
  1833     FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD3_ENTRY, "> this=0x%08x; file=%S; id=0x%08x; share=%d", (TUint)this, fileName, aId, aShareIfLoaded);)
  1834 	TInt ret = Load(aFile,aId,aShareIfLoaded,0);
  1834 	TInt ret = Load(aFile,aId,aShareIfLoaded,0);
  1835     FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD3_EXIT, "< this=0x%08x, ret=%d", (TUint)this, ret);) 
  1835     FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD3_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, ret, iHandle, iServerHandle);) 
  1836 	return ret;
  1836 	return ret;
  1837 	}
  1837 	}
  1838 
  1838 
  1839 /** Loads a specific bitmap from an opened multi-bitmap file handle.
  1839 /** Loads a specific bitmap from an opened multi-bitmap file handle.
  1840 The bitmap may be shared by other font and bitmap server clients.
  1840 The bitmap may be shared by other font and bitmap server clients.
  1869             {
  1869             {
  1870             err = DoLoad(aFile,aId,aShareIfLoaded,aFileOffset);
  1870             err = DoLoad(aFile,aId,aShareIfLoaded,aFileOffset);
  1871             FBS_OST_IF(err!=KErrNone, OstTraceExt2( TRACE_ERROR, CFBSBITMAP_LOAD4_ERROR2, "! this=0x%08x; DoLoad() returned %d", (TUint)this, err);)
  1871             FBS_OST_IF(err!=KErrNone, OstTraceExt2( TRACE_ERROR, CFBSBITMAP_LOAD4_ERROR2, "! this=0x%08x; DoLoad() returned %d", (TUint)this, err);)
  1872             }
  1872             }
  1873 	    }
  1873 	    }
  1874 	FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD4_EXIT, "< this=0x%08x; err=%d", (TUint)this, err);)
  1874 	FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOAD4_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, err, iHandle, iServerHandle);)
  1875 	return err;
  1875 	return err;
  1876 	}
  1876 	}
  1877 
  1877 
  1878 /** Loads and compresses a specific bitmap from an opened multi-bitmap file handle.
  1878 /** Loads and compresses a specific bitmap from an opened multi-bitmap file handle.
  1879 The bitmap may be shared by other font and bitmap server clients.
  1879 The bitmap may be shared by other font and bitmap server clients.
  1891 	{
  1891 	{
  1892     FBS_OST(TFullName fileName;)
  1892     FBS_OST(TFullName fileName;)
  1893     FBS_OST(aFile.FullName(fileName);)
  1893     FBS_OST(aFile.FullName(fileName);)
  1894     FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS3_ENTRY, "> this=0x%08x; file=%S; id=0x%08x; share=%d", (TUint)this, fileName, aId, aShareIfLoaded);)      
  1894     FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS3_ENTRY, "> this=0x%08x; file=%S; id=0x%08x; share=%d", (TUint)this, fileName, aId, aShareIfLoaded);)      
  1895 	TInt ret = LoadAndCompress(aFile,aId,aShareIfLoaded,0);
  1895 	TInt ret = LoadAndCompress(aFile,aId,aShareIfLoaded,0);
  1896     FBS_OST(OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS3_EXIT, "< this=0x%08x; ret=%d", (TUint)this, ret);)
  1896     FBS_OST(OstTraceExt4( GRAPHICS_RESOURCE_MANAGEMENT_FUNCTIONS, CFBSBITMAP_LOADANDCOMPRESS3_EXIT, "< this=0x%08x; err=%d; iH=0x%08x; iSH=0x%08x", (TUint)this, ret, iHandle, iServerHandle);)
  1897     return ret;
  1897     return ret;
  1898 	}
  1898 	}
  1899 
  1899 
  1900 /** Loads and compresses a specific bitmap from an opened multi-bitmap file handle.
  1900 /** Loads and compresses a specific bitmap from an opened multi-bitmap file handle.
  1901 The bitmap may be shared by other font and bitmap server clients. If the 
  1901 The bitmap may be shared by other font and bitmap server clients. If the