<?xl version="0.1" encoding="SHIFT_JIS"?>


<vobj type="raw">

<Define> ^HTMLenv (NewEnvironment(CurrentEnvironment)) </Define>

<HTMLenv type="raw">

<DefineDefault Order="Normal"> ^sym
	<DelayAppend>
		(List ([Cast type="string"] (car sym)))
	</DelayAppend>	
	<FormatEval type="DelayAppend"> 
		(CurrentEnvironment) (cdr sym)
	</FormatEval>
</DefineDefault>

<Define> ^__text ()
<Arguments>
	^d
</Arguments>
<Let>
	<DelayAppend>
		(List ([Cast type="string"] d))
	</DelayAppend>	
</Let>
</Define>


<Define Order="Normal"> ^HR ^sym
<Let>
	<DelayAppend>
		(quote(
			"\n"
			<VHSeparator visible="1" alignh="fill" alignv="top" padding="0,0"/>
			"\n"
		))
	</DelayAppend>	
</Let>
</Define>

<Define Order="Normal"> ^A ^sym
<Let>
	<DelayAppend>
		(quote(
			<VxlTextAttr stack="on"/>
			<VxlTextSetTrAttr href="$HREF" color="#ff000000"/>
			($ (cdr sym))
			<VxlTextPop/>
		))
	</DelayAppend>	
</Let>
</Define>


<Define Order="Normal"> ^BR ^sym
<Let>
	<DelayAppend>
		(quote("\n" ))
	</DelayAppend>	
</Let>
</Define>


<Define Order="Normal"> ^IMG ^sym
<Let>
<Sub>
<img-src>(+ "net:" SRC)
</img-src>
</Sub>
	<DelayAppend>
		(quote(
		<Let>
		<Sub>
			<obj>
			<VDraw		padding="0,0"
					descriptor="image"
					image="file:images/img.gif"/>
			</obj>
		</Sub>
			<VxlLoadingVDraw image="file:images/img-err.gif">
				^obj ($ SRC)
			</VxlLoadingVDraw>
			^obj
		</Let>
		 ))
	</DelayAppend>
</Let>
</Define>


<Define Order="Normal"> ^H3 ^sym
<Let>
	<DelayAppend>
		(quote( "\n" <VxlTextAttr stack="on" 
			ws="TitleStyle"
			fsize="100" /> ))
	</DelayAppend>	
	<FormatEval type="DelayAppend"> 
		(CurrentEnvironment) (cdr sym)
	</FormatEval>
	<DelayAppend>
		(quote((VxlTextPop) "\n" ))
	</DelayAppend>	
</Let>
</Define>

<Define Order="Normal"> ^H2 ^sym
<Let>
	<DelayAppend>
		(quote( "\n"  ([VxlTextAttr stack="on"
			ws="TitleStyle"
			fsize="150" ])))
	</DelayAppend>	
	<FormatEval type="DelayAppend"> 
		(CurrentEnvironment) (cdr sym)
	</FormatEval>
	<DelayAppend>
		(quote((VxlTextPop) "\n" ))
	</DelayAppend>	
</Let>
</Define>

<Define Order="Normal"> ^H1 ^sym
<Let>
	<DelayAppend>
		(quote( "\n"  ([VxlTextAttr stack="on"
			ws="TitleStyle"
			fsize="200" ])))
	</DelayAppend>	
	<FormatEval type="DelayAppend"> 
		(CurrentEnvironment) (cdr sym)
	</FormatEval>
	<DelayAppend>
		(quote((VxlTextPop) "\n" ))
	</DelayAppend>	
</Let>
</Define>

<Define Order="Normal"> ^TABLE ^sym
<Let>
<Sub>
<sym> (cdr sym) </sym>
<tr-ret> () </tr-ret>
<row> 0 </row>
<col> 0 </col>
</Sub>
	<For> (Not (= sym ()))
	<Let>
	<Sub>
	<el> (car sym) </el>
	<s> (If (= el ()) (Then ()) (Else (car el))) </s>
	<elp> (If (= el ()) (Then ()) (Else (cdr el))) </elp>
	</Sub>
	<If> (= s 'TR) <Then>
	<Let>
	<Sub> 
	<td-ret> () </td-ret> 
	<c> 0 </c>
	</Sub>
		<For dec="elp">
		<Let>
		<Sub>
		<el> (car elp) </el>
		<s> (car el) </s>
		</Sub>
		<If> (= s 'TD) <Then>
		<Define ignore.delay="on"> ^target <Thread>
			(FormatEval HTMLenv (cdr el))
		</Thread></Define>
		<set> ^td-ret (cons (quote
			<TD><VxlText visible="1"
				ps-flags="text"
				ws="NormalStyle"
				xltext.Algorism="VText">
				($ target)
			</VxlText></TD>
			) td-ret)
		</set>
		<set> ^c ( + c 1) </set>
		<If> (> c col) <Then>
			<set> ^col ^c </set>
		</Then></If>
		</Then></If>
		</Let>
		</For>
	<set> ^tr-ret (cons (cons 'TR (Reverse td-ret)) tr-ret) </set>
	<set> ^row (+ row 1) </set>
	</Let>
	</Then></If>
	<set> ^sym (cdr sym) </set>
	</Let>
	</For>
	<DelayAppend>
		(List (cons '[VTableView visible="1" rows="$row" cols="$col"
				alignv="FILL" alignh="FILL" 
				homogeneous="0"
				name="TABLE-obj"]
			(Reverse tr-ret)) "\n")
	</DelayAppend>	
</Let>
</Define>

</HTMLenv>

<Define> ^list-regulation ()
<Arguments>
	^input
</Arguments>
<Let>
<Define> ^lr ()
<Arguments>
	^input
</Arguments>
	<For dec="input">
		<Let>
		<Sub>
		<el> (car input) </el>
		</Sub>
		<Switch>
		<Case> (Not (= (TypeOf el) "list"))
			<DelayAppend> (List el) </DelayAppend>
		</Case>
		<Case> (= (TypeOf (car el)) "symbol")
			<DelayAppend>
				(List (list-regulation (cons
					([Cast type="symbol" option="capital"] (car el))
					(cdr el))))
			</DelayAppend>
		</Case>
		<Case> 1
			(lr el)
		</Case>
		</Switch>
		</Let>
	</For>
</Define>
<If> (= (TypeOf input) "list") <Then>
	<Thread>
		(lr input)
	</Thread>
</Then><Else>
	^input
</Else></If>
</Let>
</Define>

<Define Order="Normal"> ^HTML ^sym
<Let>
<Sub>
<name> (IfDef name "") </name>
<refer> (IfDef refer "") </refer>
<refer.id> (IfDef refer.id "") </refer.id>
<eval.flag> (IfDef eval.flag "off") </eval.flag>
</Sub>
	<If> (= eval.flag "on")
	<Then>
		<set> ^sym
			(Eval (CurrentEnvironment) (GE sym 1))
		</set>
	</Then><Else>
		<set> ^sym (cdr sym) </set>
	</Else>
	</If>
	<Switch>
	<Case> (Not (= refer ""))
		<vobjWaitSync type="stop"> ^refer </vobjWaitSync>
	</Case>
	<Case> (Not (= refer.id ""))
		<vobjWaitSync type="stop"> ^refer.id </vobjWaitSync>
	</Case>
	</Switch>
	<Define ignore.delay="on"> ^sym (list-regulation sym) </Define>
<!--
(PrintStd "convert-prev")
(PrintStd sym)
-->
	<Define ignore.delay="on"> ^target <Thread>
		 (FormatEval  HTMLenv sym)
	</Thread></Define>
<!--
(PrintStd "convert")
(PrintStd target)
-->
	<Switch>
	<Case> (Not (= name ""))
		<VxlText visible="1"
			ps-flags="text"
			fsize="120"
			ws="NormalStyle"
			name = "^name"
			xltext.Algorism="VText">
			($ target)
		</VxlText>
	</Case>
	<Case> (Not (= refer ""))
		<VxlText visible="1"
			ps-flags="text"
			fsize="120"
			ws="NormalStyle"
			refer = "^refer"
			xltext.Algorism="VText">
			($ target)
		</VxlText>
	</Case>
	<Case> (Not (= refer.id ""))
		<VxlText visible="1"
			ps-flags="text"
			fsize="120"
			ws="NormalStyle"
			refer.id = "^refer.id"
			xltext.Algorism="VText">
			($ target)
		</VxlText>
	</Case>
	</Switch>
</Let>
</Define>

</vobj>
