#
# FCResource.pl
#
# resource.h _xZkqqHx_iCpAiMlDiCmJiBeB_xHqqkZx_SDK_xZkqqHx_iDhEiDeIiDiLiDfPiCmJ_xHqqkZx_FCResource.h_xZkqqHx_iDhEiDeAiDeDiDiLiCpAiNoMjAkMiBeC_xHqqkZx_
# _xZkqqHx_iNoMjAkMiClDiCoKiCoJiDhEiDeAiDeDiDiLiCmJiCmNiBeB_xHqqkZx_
# IDS_ERR_XXX_xZkqqHx_iBeB_xHqqkZx_IDS_MSG_XXX _xZkqqHx_iCmMjCoIiLgAiCkKiDfCiDhDiBfLiClDiCoKiCoJiBeC_xHqqkZx_
#

$OutFileName = "FCResource";
$fin = "resource.h";
$fout_h = "../MolipSDK/${OutFileName}.h";
$fout_hold = $fout_h.'.old';
rename($fout_h, $fout_hold);
open(FDOUT_H, ">${fout_h}") || die "Cannot open ${fout_h}\n";

########################################################################
# _xZkqqHx_iCnMiClIiBeB_xHqqkZx_${OutFileName}.h _xZkqqHx_iCmMiDhHiDgCiDfPjFjEjFkKiCpAiPjBiCkLiPgPiClHiBeC_xHqqkZx_
########################################################################

print FDOUT_H << "EndOfText";
//
// This file was generated from ${OutFileName}.pl and resource.h.
// If you wish to change this, edit original files.
//
#ifndef __${OutFileName}_h
#define __${OutFileName}_h

EndOfText

########################################################################
# _xZkqqHx_iOjPiCmJiBeBiKgFiDeOiDiJiDfIiCkJiCoHjFeLjHhGiCmIiDiBiDjDiDgPiCpAjElCiCkLiPgPiClHiBeC_xHqqkZx_
########################################################################

print "Extract from ${fin} ....";
open(FDIN, "${fin}") || die "Cannot open ${fin}\n";

WID:while (<FDIN>)
{
	next WID if (/#define\s+ID_WND_/);
	next WID if (/#define\s+ID_PLUGIN_/);
	next WID if (/#define\s+ID_STC_/);
	next WID if (/#define\s+ID_BTN_/);
	next WID if (/#define\s+ID_CMB_/);
	if (/#define\s+ID_/ or
		/#define\s+IDS_ERR_/ or
		/#define\s+IDS_MSG_/)
	{
		s/\bID/FD_ID/;
		print FDOUT_H;
	}
}

close FDIN;
print "OK\n";

print FDOUT_H << "EndOfText";

#endif//__${OutFileName}_h

EndOfText

close FDOUT_H;

1;
