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


<MoveDefine> ^SetNativeProxy ^Env1 ^Env0 </MoveDefine>
<MoveDefine> ^SetProxy ^Env1 ^Env0 </MoveDefine>


<vobj type="raw">

<Define> ^read-default-conditions ()
<Arguments/>
<Let>
<Sub>
	<preferences> ([gv-resource rid="4"] (gv-resource-status)) </preferences>
	<def.cond> ([GE path="gv-resource/default-conditions"
			el="1"
			default=""] 
		preferences)
	</def.cond>
</Sub>
	<If> (Or (= def.cond "") (= def.cond ()))
	<Then>
		<quote>
<OR>
 <query qtype="property" title="Today's Maps" active="on">
  <AND>
   <qualifier cond="boundary">
    xlp://isjhp1.nichibun.ac.jp:8080/gb_metadata
    0
    content.period
    W3C-DTF
    ^"2005-4-*.*.*:*:* / 2005-6-*.*.*:*:*"
   </qualifier>
   <qualifier cond="part">
    xlp://isjhp1.nichibun.ac.jp:8080/gb_metadata
    0
    property
    ()
    base 
   </qualifier>
  </AND>
 </query>
 <query qtype="property" title="Today's Aero Photograph" active="off">
  <AND>
   <qualifier cond="boundary">
    xlp://isjhp1.nichibun.ac.jp:8080/gb_metadata
    0
    content.period
    W3C-DTF
    ^"2005-4-*.*.*:*:* / 2005-6-*.*.*:*:*"
   </qualifier>
   <qualifier cond="part">
    xlp://isjhp1.nichibun.ac.jp:8080/gb_metadata
    0
    property
    ()
    photo 
   </qualifier>
  </AND>
 </query>
 <query qtype="property" title="Old Maps" active="off">
  <AND>
   <qualifier cond="boundary">
    xlp://isjhp1.nichibun.ac.jp:8080/gb_metadata
    0
    content.period
    W3C-DTF
    ^"1740-4-*.*.*:*:* / 1760-12-*.*.*:*:*"
   </qualifier>
   <qualifier cond="part">
    xlp://isjhp1.nichibun.ac.jp:8080/gb_metadata
    0
    property
    ()
    base 
   </qualifier>
  </AND>
 </query>
</OR>
		</quote>
	</Then>
	<Else>
		^def.cond
	</Else>
	</If>
</Let>
</Define>

<Define> ^read-initial-warp-method ()
<Arguments/>
<Let>
<Sub>
	<preferences> ([gv-resource rid="4"] (gv-resource-status)) </preferences>
	<method> ([Cast type="integer"] ([GE path="gv-resource/initial-warp-method"
			el="1"
			default="0"] 
		preferences))
	</method>
</Sub>
	^method
</Let>
</Define>

<Define> ^read-start-point-URL ()
<Arguments/>
<Let>
<Sub>
	<preferences> ([gv-resource rid="4"] (gv-resource-status)) </preferences>
	<sp-URL> ([GE path="gv-resource/start-point-URL"
			el="1"
			default="xlp://isjhp2.nichibun.ac.jp:8080/world/00.crd"] 
		preferences)
	</sp-URL>
</Sub>
	^sp-URL
</Let>
</Define>

<Define> ^preferences-window-home-reset () ^sym
<Let>
<Sub>
	<def.cond> (read-default-conditions)	</def.cond>
	<url> (read-start-point-URL) </url>
</Sub>
<vobjTarget>
	<VgbQueryIndicate refer="window-preferences-conditions"
		qind.qthReplace="def.cond" />
	<VEditText refer="window-preferences-home"
		descriptor="^url"/>
</vobjTarget>
</Let>
</Define>

<Define> ^preferences-window-home-set ()
<Arguments/>
<Let>
<Sub>
	<def.cond><GE path="qind.qthGet" el="1">
		<VgbQueryIndicate refer="window-preferences-conditions"
			flags="qind.qthGet" />
	</GE></def.cond>
	<sp-URL><GE path="descriptor" el="1">
		<GetStatus refer="window-preferences-home"
			flags="descriptor" />
	</GE></sp-URL>
	<method><GE path="value" el="1">
		<GetStatus refer="window-preferences-home-use-initial-warp-file"
			flags="value" />
	</GE></method>
</Sub>
(PrintStd method)
	<gv-resource rid="4">
		<default-conditions> ($ def.cond) </default-conditions>
		<start-point-URL> ^sp-URL </start-point-URL>
		<initial-warp-method> ^method </initial-warp-method>
	</gv-resource>
</Let>
</Define>



<Define> ^preferences-window-appearance-reset () ^sym
<Let>
<Sub>
	<preferences> ([gv-resource rid="4"] (gv-resource-status)) </preferences>
	<theme> ([GE path="gv-resource/theme"
			el="1"
			default="skeleton1"] 
		preferences)
	</theme>
	<lang> (lang-no)
	</lang>
</Sub>
<vobjTarget>
(PrintStd theme)
(PrintStd lang)
	<VxlEditLine refer="window-preferences-theme-file"
			descriptor="theme">
		<List> ^theme </List>
	</VxlEditLine>
	<VPopupButton refer="window-preferences-setLang"
				value="^lang"/>
</vobjTarget>
</Let>
</Define>

<Define> ^preferences-window-appearance-set ()
<Arguments/>
<Let>
<Sub>
	<app.lang>
	<Cast type="integer"><GE path="value" el="1">
	<VPopupButton refer="window-preferences-setLang"
			flags="value"/>
	</GE></Cast>
	</app.lang>
	<app.theme>
	<GE><GE path="Arguments" el="1">
	<VxlEditLine refer="window-preferences-theme-file"
			flags="Arguments"/>
	</GE> 0</GE>
	</app.theme>
</Sub>
(PrintStd app.lang)
(PrintStd app.theme)
	<gv-resource rid="4">
		<lang> (GE (GE languages app.lang) 0) </lang>
		<theme> ^app.theme </theme>
	</gv-resource>
</Let>
</Define>


<Define> ^preferences-window-proxy-native-reset () ^sym
<Let>
<Sub>
	<proxy><gv-resource rid="4">
				(GetNativeProxy)
	</gv-resource></proxy>
	<proxy.type>
		(GE proxy 1)
	</proxy.type>
</Sub>
<vobjTarget>
<Switch>
<Case> (= proxy.type "NoProxy")
	<VRadioButton refer="window-preferences-proxy-native-off"
		value="1"/>
</Case>
<Case> (= proxy.type "NativeProxy")
	<Let>
	<Sub>
		<proxy.server>
			(GE proxy 2)
		</proxy.server>
		<proxy.port>
			(GE proxy 3)
		</proxy.port>
		<proxy.servers.get>
			(cdr(cdr(cdr(cdr proxy))))
		</proxy.servers.get>
	</Sub>
	<Define> ^proxy.servers () </Define>
	<For dec="proxy.servers.get">
		<set> ^proxy.servers (cons (GE (car proxy.servers.get) 2) proxy.servers)
		</set>
	</For>
	<vobjTarget>
	<VRadioButton refer="window-preferences-proxy-native-on"
		value="1"/>
(PrintStd proxy.servers)
	<VEditText refer="window-preferences-proxy-native-server"
			descriptor="^proxy.server"/>
	<VEditText refer="window-preferences-proxy-native-port"
			descriptor="^proxy.port"/>
	<VxlEditLine refer="window-preferences-proxy-native-dservers">
		^proxy.servers
	</VxlEditLine>
	</vobjTarget>
	</Let>
</Case>
</Switch>

</vobjTarget>
</Let>
</Define>

<Define> ^preferences-window-proxy-native-set ()
<Arguments/>
<Let>
<Sub>
<value-off>
([GetStatus refer="window-preferences-proxy-native-off" flags="value"])
</value-off>
<value-on>
([GetStatus refer="window-preferences-proxy-native-on" flags="value"])
</value-on>
</Sub>
(PrintStd value-off)
(PrintStd value-on)
<Switch>
<Case> (= ([GE path="value" el="1"] value-off ) 1)
(PrintStd "Proxy-OFF")
	<gv-resource rid="4">
		<SetNativeProxy type="NoProxy"/>
	</gv-resource>
</Case>
<Case> (= ([GE path="value" el="1"] value-on) 1)
	<gv-resource rid="4">
(PrintStd "Proxy-ON")
		<Let>
		<Sub>
		<d-list><GE path="Arguments" el="1">
			<VxlEditLine refer="window-preferences-proxy-native-dservers"
					flags="Arguments"/>
		</GE></d-list>
		<pserver><GE path="descriptor" el="1">
			<VEditText refer="window-preferences-proxy-native-server"
					flags="descriptor"/>
		</GE></pserver>
		<pport><GE path="descriptor" el="1">
			<VEditText refer="window-preferences-proxy-native-port"
					flags="descriptor"/>
		</GE></pport>
		</Sub>
(PrintStd d-list)
(PrintStd pserver)
(PrintStd pport)
		<SetNativeProxy type="NativeProxy" server="^pserver" port="^pport"/>
		<For dec="d-list">
			<Define> ^s (car d-list) </Define>
			<SetNativeProxy type="NoProxy" direct="^s"/>
		</For>
		</Let>
	</gv-resource>
</Case>
<Case> 1
(PrintStd "Proxy ???")
</Case>
</Switch>
</Let>
</Define>


<Define> ^preferences-window-proxy-http-reset () ^sym
<Let>
<Sub>
	<proxy><gv-resource rid="4">
				(GetProxy)
	</gv-resource></proxy>
	<proxy.type>
		(GE proxy 1)
	</proxy.type>
</Sub>
<vobjTarget>
(PrintStd proxy)
(PrintStd proxy.type)
<Switch>
<Case> (= proxy.type "NoProxy")
	<VRadioButton refer="window-preferences-proxy-http-off"
		value="1"/>
</Case>
<Case> (= proxy.type "XLoHTTP")
	<VRadioButton refer="window-preferences-proxy-http-direct"
		value="1"/>
</Case>
<Case> (= proxy.type "HTTPProxy")
	<Let>
	<Sub>
		<proxy.server>
			(GE proxy 2)
		</proxy.server>
		<proxy.port>
			(GE proxy 3)
		</proxy.port>
		<proxy.servers.get>
			(cdr(cdr(cdr(cdr proxy))))
		</proxy.servers.get>
	</Sub>
	<Define> ^proxy.servers () </Define>
	<For dec="proxy.servers.get">
		<set> ^proxy.servers (cons (GE (car proxy.servers.get) 2) proxy.servers)
		</set>
	</For>
	<vobjTarget>
	<VRadioButton refer="window-preferences-proxy-http-on"
		value="1"/>
	<VEditText refer="window-preferences-proxy-http-server"
			descriptor="^proxy.server"/>
	<VEditText refer="window-preferences-proxy-http-port"
			descriptor="^proxy.port"/>
(PrintStd proxy.servers)
	<VxlEditLine refer="window-preferences-proxy-http-dservers">
		^proxy.servers
	</VxlEditLine>
	</vobjTarget>
	</Let>
</Case>
</Switch>

</vobjTarget>
</Let>
</Define>


<Define> ^preferences-window-proxy-http-set ()
<Arguments/>
<Let>

<Switch>
<Case> (= ([GE path="value" el="1"] 
			([GetStatus refer="window-preferences-proxy-http-off"
			flags="value"])) 1)
(PrintStd "Proxy-OFF")
	<gv-resource rid="4">
		<SetProxy type="NoProxy"/>
	</gv-resource>
</Case>
<Case> (= ([GE path="value" el="1"] 
			([GetStatus refer="window-preferences-proxy-http-direct"
			flags="value"])) 1)
(PrintStd "Proxy-XLoHTTP")
	<gv-resource rid="4">
		<SetProxy type="XLoHTTP"/>
	</gv-resource>
</Case>
<Case> (= ([GE path="value" el="1"] 
			([GetStatus refer="window-preferences-proxy-http-on"
			flags="value"])) 1)
	<gv-resource rid="4">
(PrintStd "Proxy-ON")
		<Let>
		<Sub>
		<d-list><GE path="Arguments" el="1">
			<VxlEditLine refer="window-preferences-proxy-http-dservers"
					flags="Arguments"/>
		</GE></d-list>
		<pserver><GE path="descriptor" el="1">
			<VEditText refer="window-preferences-proxy-http-server"
					flags="descriptor"/>
		</GE></pserver>
		<pport><GE path="descriptor" el="1">
			<VEditText refer="window-preferences-proxy-http-port"
					flags="descriptor"/>
		</GE></pport>
		</Sub>
(PrintStd d-list)
(PrintStd pserver)
(PrintStd pport)
		<SetProxy type="HTTPProxy" server="^pserver" port="^pport"/>
		<For dec="d-list">
			<Define> ^s (car d-list) </Define>
			<SetProxy type="NoProxy" direct="^s"/>
		</For>
		</Let>
	</gv-resource>
</Case>
<Case> 1
(PrintStd "Proxy ???")
</Case>
</Switch>
</Let>
</Define>


<Define> ^preferences-window-gateway-reset () ^sym
<Let>
<Sub>
	<preferences> ([gv-resource rid="4"] (gv-resource-status)) </preferences>
	<gw-server> ([GE path="gv-resource/gateway"
			el="1"
			default=""] 
		preferences)
	</gw-server>
	<gw-port> ([GE path="gv-resource/gateway"
			el="2"
			default=""] 
		preferences)
	</gw-port>
</Sub>
<vobjTarget>
<Switch>
<Case> (Or (= gw-server "") (= gw-server ()) (= gw-port "") (= gw-port ()))
	<VRadioButton refer="window-preferences-proxy-gateway-off"
		value="1"/>
</Case>
<Case> 1
	<VRadioButton refer="window-preferences-proxy-gateway-on"
		value="1"/>
	<VEditText refer="window-preferences-gateway-server"
			descriptor="^gw-server"/>
	<VEditText refer="window-preferences-gateway-port"
			descriptor="^gw-port"/>
</Case>
</Switch>

</vobjTarget>
</Let>
</Define>

<Define> ^preferences-window-gateway-set ()
<Arguments/>
<Let>

<Switch>
<Case> (= ([GE path="value" el="1"] 
			([GetStatus refer="window-preferences-proxy-gateway-off"
			flags="value"])) 1)
(PrintStd "Gateway-off")
	<gv-resource rid="4">
		<gateway> ^"" 0 </gateway>
	</gv-resource>
</Case>
<Case> 1
	<gv-resource rid="4">
(PrintStd "Gateway-on")
		<Let>
		<Sub>
		<gw-server><GE path="descriptor" el="1">
			<VEditText refer="window-preferences-gateway-server"
				flags="descriptor"/>
		</GE></gw-server>
		<gw-port><GE path="descriptor" el="1">
			<VEditText refer="window-preferences-gateway-port"
					flags="descriptor"/>
		</GE></gw-port>
		</Sub>
(PrintStd gw-server)
(PrintStd gw-port)
		<gateway> ^gw-server ^gw-port </gateway>
		</Let>
	</gv-resource>
</Case>
<Case> 1
(PrintStd "Proxy ???")
</Case>
</Switch>
</Let>
</Define>


<Define> ^preferences-window-cache-set ()
<Arguments/>
<Let>
<Sub>
	<cache.resource.off>
		<GE path="value" el="1">
		<GetStatus refer="windows-preferences-resource-cache-off"
			flags="value"/>
		</GE>
	</cache.resource.off>
	<cache.resource.wr>
		<GE path="value" el="1">
		<GetStatus refer="windows-preferences-resource-cache-wr"
			flags="value"/>
		</GE>
	</cache.resource.wr>
	<cache.resource.on>
		<GE path="value" el="1">
		<GetStatus refer="windows-preferences-resource-cache-on"
			flags="value"/>
		</GE>
	</cache.resource.on>
	<cache.mappath.off>
		<GE path="value" el="1">
		<GetStatus refer="windows-preferences-mappath-cache-off"
			flags="value"/>
		</GE>
	</cache.mappath.off>
	<cache.mappath.wr>
		<GE path="value" el="1">
		<GetStatus refer="windows-preferences-mappath-cache-wr"
			flags="value"/>
		</GE>
	</cache.mappath.wr>
	<cache.mappath.on>
		<GE path="value" el="1">
		<GetStatus refer="windows-preferences-mappath-cache-on"
			flags="value"/>
		</GE>
	</cache.mappath.on>
</Sub>
	<Switch>
	<Case> (= cache.resource.off 1)
		<Define> ^resource-flag off </Define>
	</Case>
	<Case> (= cache.resource.wr 1)
		<Define> ^resource-flag w </Define>
	</Case>
	<Case> 1
		<Define> ^resource-flag r/w </Define>
	</Case>
	</Switch>
	<Switch>
	<Case> (= cache.mappath.off 1)
		<Define> ^mappath-flag off </Define>
	</Case>
	<Case> (= cache.mappath.wr 1)
		<Define> ^mappath-flag w </Define>
	</Case>
	<Case> 1
		<Define> ^mappath-flag r/w </Define>
	</Case>
	</Switch>
	<gv-resource rid="4">
		<gv-set-cache resource="^resource-flag" routing="^mappath-flag" />
	</gv-resource>
</Let>
</Define>


<Define> ^preferences-window-cache-reset () ^sym
<Let>
<Sub>
	<cache><gv-resource rid="4">
				(gv-get-cache)
	</gv-resource></cache>
	<cache.resource>
		([GE path="resource" el="1"] cache)
	</cache.resource>
	<cache.routing>
		([GE path="routing" el="1"] cache)
	</cache.routing>
</Sub>
<vobjTarget>
<Switch>
<Case> (= cache.resource "off")
	<VRadioButton refer="windows-preferences-resource-cache-off"
		value="1"/>
</Case>
<Case> (= cache.resource "w")
	<VRadioButton refer="windows-preferences-resource-cache-wr"
		value="1"/>
</Case>
<Case> (= cache.resource "r/w")
	<VRadioButton refer="windows-preferences-resource-cache-on"
		value="1"/>
</Case>
</Switch>
<Switch>
<Case> (= cache.routing "off")
	<VRadioButton refer="windows-preferences-mappath-cache-off"
		value="1"/>
</Case>
<Case> (= cache.routing "w")
	<VRadioButton refer="windows-preferences-mappath-cache-wr"
		value="1"/>
</Case>
<Case> (= cache.routing "r/w")

	<VRadioButton refer="windows-preferences-mappath-cache-on"
		value="1"/>
</Case>
</Switch>
</vobjTarget>
</Let>
</Define>


<Define ignore.delay="on"> ^preferences-window-object-list
<Thread pri="1">
	(preferences-window-initialize)
</Thread>
</Define>

<Define> ^preferences-window () ^sym
<vobj>
<vobjTarget>
<ObjectList> ^preferences-window-object-list </ObjectList>
	(preferences-window-home-reset)
	(preferences-window-cache-reset)
	(preferences-window-proxy-http-reset)
	(preferences-window-proxy-native-reset)
	(preferences-window-appearance-reset)
	(preferences-window-gateway-reset)
	<VWindow refer="preferences-window" visible="1"/>
</vobjTarget>
</vobj>
</Define>


</vobj>
