%l_all_func =(
	'IsKindOf',						'*',
	'Type',							'*',
	'IsEqual',						'*',
	'OutStream',					'*',
	'InStream',						'*',
	'CreatePropertyPage',			'*',
	'IsClosePolygon',				'*',
	'NewObjPolygon',				'*',
	'GetEdgePoint',					'*',
	'GetArcType',					'*',
	'GetArcBgnR',					'*',
	'GetArcEndR',					'*',
	'SetArcType',					'*',
	'SetArcBgnR',					'*',
	'SetArcEndR',					'*',
	'Copy',							'*',
	'ResizeNoChangeFrame',			'*',
	'OnDraw',						'*',
	'GetOuterFrame',				'*',
	'GetResizeFrame',				'*',
	'IsSamePolygonForText',			'*',
	'NewObjPolygonForText',			'*',
	'NewObjPolygonForResize',		'*',
	'ConvertEnvProp',				'*',
	'GetMolipPos',					'*',
	'GetMolipCount',				'*',
	'IsCenterMolip',				'*',
	'CalcExactOuterFrame',			'*',
	'IsResizable',					'*',
	'CanRotate',					'*',
	'IsIntersect',					'*',
	'IsTextIntersect',				'*',
	'IsObjInRect',					'*',
	'NearIntersect',				'*',
	'IsLinkable',					'*',
	'IsPtInOuterFrame',				'*',
	'IsFillPainted',				'*',
	'HitTest',						'*',
	'GetHandleCursor',				'*',
	'CalcOuterFrame',				'*',
	'CalcResizeFrame',				'*',
	'CalcOuterFrameSelf',			'*',
	'CalcResizeFrameSelf',			'*',
	'GetAngle',						'*',
	'GetMembers',					'*',
	'GetMemberArray',				'*',
	'GetMemberSize',				'*',
	'IsMemberOf',					'*',
	'IsMemberKindOf',				'*',
	'GetKindOfMembers',				'*',
	'RegisterObjID',				'*',
	'RegisterObjForceID',			'*',
	'UnregisterObjID',				'*',
	'Terminate',					'*',
	'GetStdPenWeight',				'*',
	'Release',						'*',
	'Duplicate',					'*',
	'CanBeTextObject',				'*',
	'GetRichText',					'*',
	'CreateRichText',				'*',
	'SetRichText',					'*',
	'ExportToTextEditor',			'*',
	'ImportFromTextEditor',			'*',
	'GetObjID',						'*',
	'SetObjID',						'*',
	'GetGroupParent',				'*',
	'SetGroupParent',				'*',
	'MakeBitmap',					'*',
	'MoveMolip',					'*',
	'Move',							'*',
	'Resize',						'*',
	'Rotate',						'*',
	'CalcElementLengthForResize',	'*',
	'GetEditableTextObj',			'*',
	'GetEditableTextObj',			'*',
	'GetDutyLinkSize',				'*',
	'GetDutyLink',					'*',
	'AppendDutyLink',				'*',
	'ClearDutyLink',				'*',
	'GetDutyTextSize',				'*',
	'GetDutyText',					'*',
	'AppendDutyText',				'*',
	'ClearDutyText',				'*',
	'GetTextMarginL',				'*',
	'GetTextMarginT',				'*',
	'GetTextMarginR',				'*',
	'GetTextMarginB',				'*',
	'GetTextAngle',					'*',
	'GetStdPenStyle',				'*',
	'GetStdPenBackSColor',			'*',
	'GetStdBrushForeSColor',		'*',
	'GetStdBrushPattern',			'*',
	'GetStdBrushBackSColor',		'*',
	'GetPenRegister',				'*',
	'GetPenStyle',					'*',
	'GetPenWeight',					'*',
	'GetPenBackSColor',				'*',
	'GetBrushRegister',				'*',
	'GetBrushForeSColor',			'*',
	'GetBrushPattern',				'*',
	'GetBrushBackSColor',			'*',
	'GetShadowSColor',				'*',
	'GetEmfHorzMap',				'*',
	'GetEmfVertMap',				'*',
	'GetEmfImage',					'*',
	'GetArrowFType',				'*',
	'GetArrowFParam0',				'*',
	'GetArrowFParam1',				'*',
	'GetArrowFParam2',				'*',
	'GetArrowBType',				'*',
	'GetArrowBParam0',				'*',
	'GetArrowBParam1',				'*',
	'GetArrowBParam2',				'*',
	'GetPictArrowF',				'*',
	'GetPictArrowB',				'*',
	'SetPenRegister',				'*',
	'SetPenStyle',					'*',
	'SetPenWeight',					'*',
	'SetPenBackSColor',				'*',
	'SetBrushRegister',				'*',
	'SetBrushForeSColor',			'*',
	'SetBrushPattern',				'*',
	'SetBrushBackSColor',			'*',
	'SetShadowSColor',				'*',
	'SetEmfHorzMap',				'*',
	'SetEmfVertMap',				'*',
	'SetEmfImage',					'*',
	'SetArrowFType',				'*',
	'SetArrowFParam0',				'*',
	'SetArrowFParam1',				'*',
	'SetArrowFParam2',				'*',
	'SetArrowBType',				'*',
	'SetArrowBParam0',				'*',
	'SetArrowBParam1',				'*',
	'SetArrowBParam2',				'*',
	'SetPictArrowF',				'*',
	'SetPictArrowB',				'*',
	'NewArrowedObjPolygon',			'*',
	'CalcPolygonForDraw',			'*',
	'DrawShadow',					'*',
	'DrawObject',					'*',
	'DrawObjBrush',					'*',
	'SetTextMarginL',				'*',
	'SetTextMarginT',				'*',
	'SetTextMarginR',				'*',
	'SetTextMarginB',				'*',
	'SetTextAngle',					'*',
	'DrawEmfImage',					'*',
	'GetLabelCtime',				'*',
	'GetLabelMtime',				'*',
	'GetImageType',					'*',
	'SetLabelMtime',				'*',
	'SetImageType',					'*',
	'GetPoints',					'*',
	'GetFromEndX',					'*',
	'GetFromEndY',					'*',
	'GetToEndX',					'*',
	'GetToEndY',					'*',
	'SetFromEndX',					'*',
	'SetFromEndY',					'*',
	'SetToEndX',					'*',
	'SetToEndY',					'*',
	'GetOleClientItem',				'*',
	'SetOleClientItemAndRatio',		'*',
	'SetOleClientItemAndSize',		'*',
	'OpenOleDocument',				'*',
	'OnOpenOleDocument',			'*',
	'OnCloseOleDocument',			'*',
	'GetOleRatioX',					'*',
	'GetOleRatioY',					'*',
	'GetArrowFrame',				'*',
	'GetDuty',						'*',
	'SetArrowFrame',				'*',
	'SetDuty',						'*',
	'GetArrowDutyObject',			'*',
	'GetPreDrawObjects',			'*',
	'GetPostDrawObjects',			'*',
	'GetPoint',						'*',
	'SetPoint',						'*',
	'GetIsVisible',					'*',
	'SetIsVisible',					'*',
	'DeleteJoint',					'*',
	'DeleteJoint',					'*',
	'InsertJoint',					'*',
	'InsertJoint',					'*',
	'SetJoint',						'*',
	'SetJoint',						'*',
	'GetJoints',					'*',
	'GetJoint',						'*',
	'GetJointSize',					'*',
	'CanSetOpenPolyJoint',			'*',
	'GetIsOpenPolyJoint',			'*',
	'SetIsOpenPolyJoint',			'*',
	'GetLinkMoveType',				'*',
	'SetLinkMoveType',				'*',
	'GetBgnLinkMoveStyle',			'*',
	'SetBgnLinkMoveStyle',			'*',
	'GetEndLinkMoveStyle',			'*',
	'SetEndLinkMoveStyle',			'*',
	'GetHAxisX',					'*',
	'GetVAxisX',					'*',
	'GetVAxisY',					'*',
	'GetCenterX',					'*',
	'GetCenterY',					'*',
	'SetHAxisX',					'*',
	'SetVAxisX',					'*',
	'SetVAxisY',					'*',
	'SetAngle',						'*',
	'SetCenterX',					'*',
	'SetCenterY',					'*',
	'GetRoundType',					'*',
	'GetRoundX',					'*',
	'GetRoundY',					'*',
	'SetRoundType',					'*',
	'SetRoundX',					'*',
	'SetRoundY',					'*',
	'GetPolyWidthF',				'*',
	'GetPolyWidthB',				'*',
	'GetWidthSlopeF',				'*',
	'GetWidthSlopeB',				'*',
	'NewObjPolygon',				'*',
	'SetPolyWidthF',				'*',
	'SetPolyWidthB',				'*',
	'SetWidthSlopeF',				'*',
	'SetWidthSlopeB',				'*',
	'CalcOutLine',					'*',
);


$allfile = `dir Obj*.cpp`;
@lines = split /\n/, $allfile;
@lines = grep /^\d/, @lines;

#$/ = "";	# Paragraph mode.

foreach $i (@lines)
{
	$i =~ /^\S+\s+\S+\s+\S+\s+([^\.]+)\.(.+)$/;
	print "Extract $1.$2 ....";
	$fin = "$1.$2";
	$fout = "Doc\\$1.txt";

	open(FDIN, "${fin}") || die "Cannot open ${fin}\n";
	open(FDOUT, ">${fout}") || die "Cannot open ${fout}\n";

	$l_is_com_mode = "";
	while (<FDIN>)
	{
		if ($l_is_com_mode)
		{
			if (/^\s*\*\s*<_xZkqqHx_jHjKjHpA_xHqqkZx_>/ or /^\s*\*\s*<_xZkqqHx_iJpAjAoA_xHqqkZx_>/ or /\*{10,}\//)
			{
				chomp $l_is_com_mode;
				chomp $l_is_com_mode;
				chomp $l_is_com_mode;
				print FDOUT $l_is_com_mode."\n";
				$l_is_com_mode = "";
			}
		} else
		{
			if (/^\s*\*\s*<_xZkqqHx_iKnGjAjE_xHqqkZx_>\s*([^:]+)::(.*)/)
			{
				if ($l_all_func{$2})
				{
					$l_all_func{$2} .= "/$1";
					$l_is_com_mode = "--------------------------------------------------------------------------\n";
				}
			}
		}
		if ($l_is_com_mode)
		{
			s/^\s*\*\s*(<[^>]+>)\s+(.*)/$1  $2/;
			s/^\s*\*$//;
			s/^\s*\*\s*([^\s].+)/        $1/;
			$l_is_com_mode .= $_;
		}
	}
	$l_is_com_mode = "--------------------------------------------------------------------------\n";
	print FDOUT $l_is_com_mode."\n";
	close FDIN;
	close FDOUT;
	print "OK\n";
}
