<?xml version="1.0" encoding="UTF-8"?>
<app extensions=".bios .bin .rom .img" icon="images/icon_small.png" name="Bios Flasher" version="2.0.4">
	<resources>
		<module src="../../modules/bflash.klf" />
		<module src="modules/app_bios_flasher.klf" />

		<image name="logo" src="images/logo.png" />
		<image name="progressbar_back" src="images/progressbar_back.png" />
		<image name="progressbar_fore" src="images/progressbar_fore.png" />

		<image name="button_exit" src="images/btn_close_norm.png" />
		<image name="button_exit_hl" src="images/btn_close_over.png" />
		<image name="button_settings" src="images/btn_settings_norm.png" />
		<image name="button_settings_hl" src="images/btn_settings_over.png" />

		<font name="m23" size="15" src="../../fonts/ttf/m23.ttf" type="ttf" />
		<font name="arial" size="15" src="../../fonts/ttf/arial_lite.ttf" type="ttf" />

		<surface height="480" name="page1" width="100%">
			<fill color="#B2E2F9" height="366" />
			<fill color="#31799F" height="114" width="100%" y="366" />

			<fill color="#FFFFFF" height="305" width="50%" x="3%" y="120" />
			<fill color="#61BDEC" height="292" width="48%" x="4%" y="127" />

			<fill color="#FFFFFF" height="305" width="43%" x="54%" y="120" />
			<fill color="#61BDEC" height="292" width="41%" x="55%" y="127" />
			
			<blit height="84" surface="logo" width="16%" x="3%" y="14" />
		</surface>

		<surface height="480" name="page2" width="100%">
			<fill color="#B2E2F9" height="366" />
			<fill color="#31799F" height="114" width="100%" y="366" />
			<fill color="#FFFFFF" height="318" width="69%" x="14%" y="55" />
			<fill color="#CCE4F0" height="298" width="67%" x="15%" y="66" />
		</surface>

		<surface height="480" name="page3" width="100%">
			<fill color="#B2E2F9" height="366" />
			<fill color="#31799F" height="114" width="100%" y="366" />

			<fill color="#FFFFFF" height="274" width="92%" x="4%" y="106" />
			<fill color="#61BDEC" height="260" width="90%" x="5%" y="113" />
			
			<blit height="84" surface="logo" width="16%" x="3%" y="14" />
		</surface>

		<surface height="30" name="item-normal" width="47%">
			<fill color="#CCE4F0" height="28" />
			<fill color="#FFFFFF" height="2" width="100%" y="28" />
		</surface>
		<surface height="30" name="item-focus" width="47%">
			<fill color="#85C4E2" height="28" />
			<fill color="#FFFFFF" height="2" width="100%" y="28" />
		</surface>
		<surface height="30" name="item-selected" width="47%">
			<fill color="#D4F129" height="28" />
			<fill color="#FFFFFF" height="2" width="100%" y="28" />
		</surface>

		<surface height="72" name="button_large" width="46%">
			<fill color="#FFFFFF" />
			<fill color="#31799F" height="60" width="96%" x="2%" y="6" />
		</surface>
		<surface height="72" name="button_large_hl" width="46%">
			<fill color="#FFFFFF" />
			<fill color="#61BDEC" height="60" width="96%" x="2%" y="6" />
		</surface>

		<surface height="72" name="button_small" width="38%">
			<fill color="#FFFFFF" />
			<fill color="#31799F" height="60" width="96%" x="2%" y="6" />
		</surface>
		<surface height="72" name="button_small_hl" width="38%">
			<fill color="#FFFFFF" />
			<fill color="#61BDEC" height="60" width="96%" x="2%" y="6" />
		</surface>

		<surface height="20" name="text_edit_normal" width="23%">
			<fill color="#FFFFFF" />
		</surface>
		<surface height="20" name="text_edit_focus" width="23%">
			<fill color="#666666" />
			<fill color="#FFFFFF" height="18" width="99%" x="1%" y="1" />
		</surface>
		<surface height="20" name="text_edit_high" width="23%">
			<fill color="#29B1EA" />
			<fill color="#FFFFFF" height="18" width="99%" x="1%" y="1" />
		</surface>

	</resources>

	<body height="480" onload="export:BiosFlasher_Init()" width="100%">
		<cardstack height="480" name="pages" width="100%">

			<panel background="page1" name="main_page">	
				<input disabled="button_settings" height="30" highlight="button_settings_hl" normal="button_settings" onclick="export:BiosFlasher_OnSettingsPressed()" pressed="button_settings" type="button" width="5%" x="86%" y="45" />

				<input disabled="button_exit" height="31" highlight="button_exit_hl" normal="button_exit" onclick="export:BiosFlasher_OnExitPressed()" pressed="button_exit" type="button" width="5%" x="92%" y="45" />

				<input disabled="button_large" height="72" highlight="button_large_hl" normal="button_large" onclick="export:BiosFlasher_OnWritePressed()" pressed="button_large_hl" type="button" width="46%" x="5%" y="140">
					<label align="center" color="#ffffff" font="m23" height="50" text="Write" width="100%" y="10" />
				</input>

				<input disabled="button_large" height="72" highlight="button_large_hl" normal="button_large" onclick="export:BiosFlasher_OnReadPressed()" pressed="button_large_hl" type="button" width="46%" x="5%" y="233">
					<label align="center" color="#ffffff" font="m23" height="50" text="Read" width="100%" y="10" />
				</input>

				<input disabled="button_large" height="72" highlight="button_large_hl" normal="button_large" onclick="export:BiosFlasher_OnComparePressed()" pressed="button_large_hl" type="button" width="46%" x="5%" y="330">
					<label align="center" color="#ffffff" font="m23" height="50" text="Compare" width="100%" y="10" />
				</input>

				<input disabled="button_small" height="72" highlight="button_small_hl" normal="button_small" onclick="export:BiosFlasher_OnDetectPressed()" pressed="button_small_hl" type="button" width="38%" x="57%" y="330">
					<label align="center" color="#ffffff" font="m23" height="50" text="Detect" width="100%" y="10" />
				</input>

				<panel height="50" width="40%" x="56%" y="130">	
					<label color="#ffffff" font="m23" name="label_flash_name" text="Macronix" y="3" />
				</panel>
				<panel height="50" width="40%" x="56%" y="175">	
					<label color="#ffffff" font="m23" name="label_flash_size" text="Size: 1024Kb" y="3" />
				</panel>
				<panel height="50" width="40%" x="56%" y="220">	
					<label color="#ffffff" font="m23" name="label_flash_voltage" text="Voltage: 3V" y="3" />
				</panel>
				<panel height="50" width="40%" x="56%" y="265">	
					<label color="#ffffff" font="m23" name="label_flash_access" text="Read/Write" y="3" />
				</panel>
			</panel> 

			<panel background="page2" name="filemanager_page">	
				<filemanager height="299" item_disabled="item-normal" item_font="m23" item_font_b="160" item_font_g="120" item_font_r="50" item_highlight="item-focus" item_normal="item-normal" item_pressed="item-focus" name="file_browser" onclick="export:BiosFlasher_ItemClick()" path="../../firmware/bios" width="52%" x="24%" y="66" />

				<input disabled="./images/btn_left_disabled.png" height="27" highlight="./images/btn_left_norm.png" name="btn_scroll_left" normal="./images/btn_left_over.png" onclick="export:BiosFlasher_OnLeftScrollPressed()" pressed="./images/btn_left_over.png" type="button" width="2%" x="11%" y="100" />

				<input disabled="./images/btn_right_disabled.png" height="27" highlight="./images/btn_right_norm.png" name="btn_scroll_right" normal="./images/btn_right_over.png" onclick="export:BiosFlasher_OnRightScrollPressed()" pressed="./images/btn_right_disabled.png" type="button" width="2%" x="86%" y="100" />

				<input disabled="button_large" height="72" highlight="button_large_hl" normal="button_large" onclick="export:BiosFlasher_OnBackPressed()" pressed="button_large_hl" type="button" width="46%" x="3%" y="385">
					<label align="center" color="#ffffff" font="m23" height="50" name="back_label" text="Back" width="100%" y="10" />
				</input>

				<input disabled="button_large" height="72" highlight="button_large_hl" normal="button_large" onclick="export:BiosFlasher_OnConfirmPressed()" pressed="button_large_hl" type="button" width="46%" x="50%" y="385">
					<label align="center" color="#ffffff" font="m23" height="50" name="confirm_label" text="Confirm" width="100%" y="10" />
				</input>

				<label align="center" color="#ffffff" font="m23" height="50" name="page2_info_label" text="Chose bios file (*.bios, *.bin, *.img)" y="20" />	
			</panel> 

			<panel background="page3" name="progress_page">	

				<panel height="50" width="90%" x="5%" y="170">	
					<label color="#ffffff" font="m23" height="50" name="progress_text" text="10%%" width="100%" />
				</panel>
				<panel height="50" width="90%" x="5%" y="220">	
					<progressbar bimage="progressbar_back" height="41" name="progressbar" pimage="progressbar_fore" pos="0.3" width="76%" x="12%" />
				</panel>
				<panel height="50" width="90%" x="5%" y="270">	
					<label color="#ffffff" font="m23" height="50" name="progress_desc" text="Don't touch the Dreamcast and even don't breathe J" width="100%" />
				</panel>

			</panel> 

			<panel background="page3" name="result_page">	

				<panel height="50" width="90%" x="5%" y="170">	
					<label color="#ffffff" font="m23" height="50" name="result_title_text" text="10%%" width="100%" />
				</panel>
				<panel height="50" width="90%" x="5%" y="220">	
					<label color="#ffffff" font="m23" height="50" name="result_desc_text" text="Don't touch the Dreamcast and even don't breathe J" width="100%" />
				</panel>

				<input disabled="button_large" height="72" highlight="button_large_hl" normal="button_large" onclick="export:BiosFlasher_OnBackPressed()" pressed="button_large_hl" type="button" width="46%" x="27%" y="290">

					<label align="center" color="#ffffff" font="m23" height="50" name="ok_label" text="OK" width="100%" y="10" />
				</input>

			</panel> 

			<panel background="page3" name="settings_page">	
				<panel height="50" width="31%" x="9%" y="150">
					<label align="left" color="#000000" font="arial" height="20" text="Start address, 0 to default" width="100%" />
					<input focus="text_edit_focus" font="arial" fontcolor="#000000" height="20" highlight="text_edit_high" name="start_addresss" normal="text_edit_normal" size="30" type="text" value="0" width="75%" y="20" />
				</panel>

				<panel height="50" width="31%" x="9%" y="200">
					<label align="left" color="#000000" font="arial" height="20" text="Data length, 0 to default" width="100%" />
					<input focus="text_edit_focus" font="arial" fontcolor="#000000" height="20" highlight="text_edit_high" name="data_length" normal="text_edit_normal" size="30" type="text" value="0" width="75%" y="20" />
				</panel>
				
				<input disabled="button_small" height="72" highlight="button_small_hl" normal="button_small" onclick="export:BiosFlasher_OnSupportedPressed()" pressed="button_small_hl" type="button" width="38%" x="51%" y="170">
					<label align="center" color="#ffffff" font="m23" height="50" text="Flash list" width="100%" y="10" />
				</input>

				<input disabled="button_small" height="72" highlight="button_small_hl" normal="button_small" onclick="export:BiosFlasher_OnBackPressed()" pressed="button_small_hl" type="button" width="38%" x="9%" y="290">
					<label align="center" color="#ffffff" font="m23" height="50" text="Cancel" width="100%" y="10" />
				</input>

				<input disabled="button_small" height="72" highlight="button_small_hl" normal="button_small" onclick="export:BiosFlasher_OnSaveSettingsPressed()" pressed="button_small_hl" type="button" width="38%" x="51%" y="290">
					<label align="center" color="#ffffff" font="m23" height="50" text="Save" width="100%" y="10" />
				</input>

			</panel> 

		</cardstack>
	</body>
</app>