Beispiel #1
0
uint32 CCopyExt::GetChunkCount( uint32 copy_id )
{
    CCopyData::SData* copy = Find( copy_id );
    if ( copy == NULL )
        return 0;

    return GetChunkCount( copy );
}
Beispiel #2
0
//---------------------------------------------------------------------------
mng_bool __fastcall TMainForm::ShowChunk(
  mng_handle hMNG, mng_handle hChunk, mng_chunkid iChunktype )
{
String  asDataText;

  // Fill asDataText with string data including newline's ...
  // this is added to string list for each chunk
  // and also added to the tail end of "Report"

  // NOTE :
  // Return True to continue processing.
  // If mng_getchunk_xxxx fails just return false to the
  // caller "(bool) myiterchunk" which inturn will then return false
  // to "(mng_retcode) mng_iterate_chunks(...)" which will then
  // give us the correct error code.
  // In other words DON'T check for errors in "(bool) myiterchunk" !

  switch( iChunktype ) {
  case  MNG_UINT_BACK :
    if( !Info_BACK( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_BASI :
    if( !Info_BASI( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_CLIP :
    if( !Info_CLIP( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_CLON :
    if( !Info_CLON( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_DBYK : // untested @ap@
    if( !Info_DBYK( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_DEFI :
    if( !Info_DEFI( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_DHDR :
    if( !Info_DHDR( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_DISC : // untested @ap@
    if( !Info_DISC( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_DROP : // untested @ap@
    if( !Info_DROP( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_ENDL :
    if( !Info_ENDL( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_FRAM :
    if( !Info_FRAM( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_IDAT :
    if( !Info_IDAT( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_IEND :
    if( !Info_IEND( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_IHDR :
    if( !Info_IHDR( hMNG, hChunk, asDataText ) )  return false; break;
#define MNG_UINT_IJNG 0x494a4e47L // Function AWOL @ap@
#define MNG_UINT_IPNG 0x49504e47L // Function AWOL @ap@
  case  MNG_UINT_JDAT :
    if( !Info_JDAT( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_JHDR :
    if( !Info_JHDR( hMNG, hChunk, asDataText ) )  return false; break;
#define MNG_UINT_JSEP 0x4a534550L // Function AWOL @ap@ 
  case  MNG_UINT_LOOP :
    if( !Info_LOOP( hMNG, hChunk, asDataText ) )  return false; break;
#define MNG_UINT_MaGN 0x4d61474eL // which one "mng_getchunk_magn" ? 
  case  MNG_UINT_MEND :
    if( !Info_MEND( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_MHDR :
    if( !Info_MHDR( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_MOVE :
    if( !Info_MOVE( hMNG, hChunk, asDataText ) )  return false; break;
#define MNG_UINT_MaGN 0x4d61474eL // which one "mng_getchunk_magn" ?
  case  MNG_UINT_ORDR :
    if( !Info_ORDR( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_PAST :
    if( !Info_PAST( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_PLTE :
    if( !Info_PLTE( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_PPLT :
    if( !Info_PPLT( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_PROM :
    if( !Info_PROM( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_SAVE :
    if( !Info_SAVE( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_SEEK :
    if( !Info_SEEK( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_SHOW :
    if( !Info_SHOW( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_TERM :
    if( !Info_TERM( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_bKGD :
    if( !Info_bKGD( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_cHRM :
    if( !Info_cHRM( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_eXPI :
    if( !Info_eXPI( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_fPRI :
    if( !Info_fPRI( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_gAMA :
    if( !Info_gAMA( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_hIST :
    if( !Info_hIST( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_iCCP :
    if( !Info_iCCP( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_iTXt : // untested @ap@
    if( !Info_iTXt( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_nEED :
    if( !Info_nEED( hMNG, hChunk, asDataText ) )  return false; break;
#define MNG_UINT_oFFs 0x6f464673L // Function AWOL @ap@
#define MNG_UINT_pCAL 0x7043414cL // Function AWOL @ap@
  case  MNG_UINT_pHYg : // untested @ap@
    if( !Info_pHYg( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_pHYs :
    if( !Info_pHYs( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_sBIT :
    if( !Info_sBIT( hMNG, hChunk, asDataText ) )  return false; break;
#define MNG_UINT_sCAL 0x7343414cL // Function AWOL @ap@
  case  MNG_UINT_sPLT : // untested @ap@
    if( !Info_sPLT( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_sRGB :
    if( !Info_sRGB( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_tEXt :
    if( !Info_tEXt( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_tIME :
    if( !Info_tIME( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_tRNS :
    if( !Info_tRNS( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_zTXt :
    if( !Info_zTXt( hMNG, hChunk, asDataText ) )  return false; break;
  case  MNG_UINT_HUH :
  default :           // this will catch unknown chunks - Huh !
    if( !Info_Unknown( hMNG, hChunk, asDataText ) )  return false; break;
  } // end of switch
  //-------------------------------------------------

  // Add this chunk's string to our string list
  strList->Insert( GetChunkCount(), asDataText );

  // Now's the time to bump chunk count
  IncChunkCount();

  // Add this chunk's string to the Report
  MainForm->RichEditReport->Lines->Add( asDataText );

  return true;
}