Index: /trunk/MacFaceFloat/AppSettings.cs
===================================================================
--- /trunk/MacFaceFloat/AppSettings.cs	(revision 13)
+++ /trunk/MacFaceFloat/AppSettings.cs	(revision 13)
@@ -0,0 +1,89 @@
+/* 
+ * appSettings.cs
+ * $Id$
+ * $CVSId: appSettings.cs,v 1.1.1.1 2003/04/01 04:00:51 Mayuki Sawatari Exp $
+ *
+ * Copyright (c) 2003 Mayuki Sawatari, All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE MISUZILLA.ORG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+ 
+using System;
+using System.Xml;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Configuration;
+
+namespace
+Misuzilla.Utilities
+{
+	public class
+	Setting
+	{
+		
+		public static void
+		SaveSettings(String path, StringDictionary sd)
+		{
+			XmlDocument xmlconf = new XmlDocument();
+			xmlconf.AppendChild(xmlconf.CreateElement("appSettings"));
+			foreach (DictionaryEntry o in sd) {
+				//Console.WriteLine("{0}={1}", o.Key, o.Value);
+				XmlElement e = xmlconf.CreateElement("entry");
+				xmlconf.DocumentElement.AppendChild(e);
+				e.SetAttributeNode(xmlconf.CreateAttribute("key"));
+				e.Attributes["key"].Value = (String)o.Key;
+				e.InnerText = (String)o.Value;
+			}
+
+			try {
+				//Console.WriteLine(xmlconf.InnerXml);
+				xmlconf.Save(path);
+			} catch (System.Xml.XmlException) {
+			} catch (System.IO.IOException) {
+			}
+			
+			//return true;
+		} // SaveSettings
+		
+		public static StringDictionary
+		GetSettings(String path)
+		{
+			StringDictionary sd = new StringDictionary();
+			XmlDocument xmlconf = new XmlDocument();
+			
+			try {
+				xmlconf.Load(path);
+				foreach (XmlNode xnode in xmlconf.GetElementsByTagName("entry")) {
+					if (xnode.Attributes["key"] != null) {
+						sd.Add(xnode.Attributes["key"].Value.Trim(), xnode.InnerText);
+					}
+				}
+			} catch (System.Xml.XmlException) {
+			} catch (System.IO.IOException) {
+			}
+			
+			return sd;
+		} // GetSettings
+
+	} // Setting
+
+} // Misuzilla.Utilities
Index: /trunk/MacFaceFloat/AutoConfigurator.cs
===================================================================
--- /trunk/MacFaceFloat/AutoConfigurator.cs	(revision 13)
+++ /trunk/MacFaceFloat/AutoConfigurator.cs	(revision 13)
@@ -0,0 +1,110 @@
+/* 
+ * AutoConfigurator.cs
+ * $Id$
+ *
+ * Copyright (c) 2003 Mayuki Sawatari, All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE MISUZILLA.ORG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+using System;
+using System.ComponentModel;
+using System.Reflection;
+
+namespace Misuzilla.Utilities
+{
+	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
+	public class
+	AutoConfigureAttribute : Attribute
+	{
+		private String _key = "";
+		public
+		AutoConfigureAttribute(String appSettingKey)
+		{
+			_key = appSettingKey;
+		}
+		public String
+		Key
+		{
+			get { return _key; }
+			set { _key = value; }
+		}
+	}
+	
+	public class
+	AutoConfigurator
+	{
+		private AutoConfigurator() {} // 
+		public delegate Object ConfigurationHandler(String key, Type propertyType);
+		public delegate void GetConfigurationHandler(String key, Object value, Type propertyType);
+		public static void
+		Configure(Object o, ConfigurationHandler confHandler)
+		{
+			PropertyInfo pi ;
+			FieldInfo fi;
+			Type t = o.GetType();
+			foreach (MemberInfo mi in t.GetMembers()) {
+				AutoConfigureAttribute attr = Attribute.GetCustomAttribute(mi, typeof(AutoConfigureAttribute)) as AutoConfigureAttribute;
+				if (attr != null && confHandler != null) {
+					try {
+						pi = mi as PropertyInfo;
+						fi = mi as FieldInfo;
+						if (pi != null) {
+							Object value = confHandler(attr.Key, pi.PropertyType);
+							if (value != null) {
+								pi.SetValue(o, value, null);
+							}
+						} else if (fi != null) {
+							Object value = confHandler(attr.Key, fi.FieldType);
+							if (value != null) {
+								fi.SetValue(o, value);
+							}
+						}
+						} catch (Exception) {
+					}
+				}
+			}
+		}
+		public static void
+		GetConfiguration(Object o, GetConfigurationHandler confHandler)
+		{
+			Type t = o.GetType();
+			PropertyInfo pi;
+			FieldInfo fi;
+			foreach (MemberInfo mi in t.GetMembers()) {
+				AutoConfigureAttribute attr = Attribute.GetCustomAttribute(mi, typeof(AutoConfigureAttribute)) as AutoConfigureAttribute;
+				if (attr != null && confHandler != null) {
+					try {
+						pi = mi as PropertyInfo;
+						fi = mi as FieldInfo;
+						if (pi != null) {
+							confHandler(attr.Key, pi.GetValue(o, null), pi.PropertyType);
+						} else if (fi != null) {
+							confHandler(attr.Key, fi.GetValue(o), fi.FieldType);
+						}
+					} catch (Exception) {
+					}
+				}
+			}
+		}
+	}
+}
Index: /trunk/MacFaceFloat/Configuration.cs
===================================================================
--- /trunk/MacFaceFloat/Configuration.cs	(revision 13)
+++ /trunk/MacFaceFloat/Configuration.cs	(revision 13)
@@ -0,0 +1,121 @@
+/*
+ * Configuration.cs
+ * $Id$
+ * 
+ */
+
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+using System.Collections.Specialized;
+using System.ComponentModel;
+
+using Misuzilla.Utilities;
+
+namespace MacFace.FloatApp
+{
+	/// <summary>
+	/// Configuration ÌTvÌà¾Å·B
+	/// </summary>
+	public class Configuration
+	{
+		public static readonly String ConfigurationPath;
+		private static Configuration _configInstance = null;
+
+		private StringDictionary _config = new StringDictionary();
+
+
+		//
+		// vpeBÉ·×«ÈCª·é¯ÇÆè ¦¸tB[hÅB
+		//
+		[AutoConfigure("general.facedefpath")]
+		[Category("SÊ"), Description("OñpµÄ¢½çp^[ÌfBNg")]
+		public String FaceDefPath;
+
+		[AutoConfigure("form.faceform.opacity")]
+		[Category("çtH["), Description("§¾x0-100ÌÅwèµÜ·B")]
+		public Int32 Opacity = 100;
+
+		[AutoConfigure("form.faceform.point")]
+		[Category("çtH["), Description("\¦Êu")]
+		public Point Location;
+
+		[AutoConfigure("form.faceform.transparentmousemessage")]
+		[Category("çtH["), Description("}EXbZ[Wð§ß³¹é©Ç¤©ðwèµÜ·B")]
+		public bool TransparentMouseMessage;
+
+		public static Configuration GetInstance()
+		{
+			if (_configInstance == null) 
+				_configInstance = new Configuration();
+
+			return _configInstance;
+		}
+		private Configuration()
+		{
+			FaceDefPath = System.IO.Path.Combine(Application.StartupPath, "default.mcface");
+		}
+		static Configuration()
+		{
+			ConfigurationPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\MacFace";
+		}
+
+
+		// Û¶AÇÝÝ
+		public void Load()
+		{
+			// StringDictionary©çvpeBÖàÇ·B
+			_config = Setting.GetSettings(ConfigurationPath + @"\AppSettings.xml");
+			AutoConfigurator.Configure(this,
+					new AutoConfigurator.ConfigurationHandler(LoadConfigHandler));
+		}
+
+		public void Save()
+		{
+			if (!System.IO.Directory.Exists(ConfigurationPath))
+				System.IO.Directory.CreateDirectory(ConfigurationPath);
+			
+			// vpeBðStringDictionaryÉi[B
+			AutoConfigurator.GetConfiguration(this,
+				new AutoConfigurator.GetConfigurationHandler(SaveConfigHandler));
+
+			// XML É«o·B
+			Setting.SaveSettings(ConfigurationPath + @"\AppSettings.xml", _config);
+
+		}
+
+
+
+		#region AutoConfiguration Handlers
+		//
+		// SaveÅÄÑo³êénh
+		//
+		private void SaveConfigHandler(String key, Object value, Type propertyType)
+		{
+			TypeConverter tconv = TypeDescriptor.GetConverter(propertyType);
+			_config[key] = tconv.ConvertToString(value);
+		}
+
+		//
+		// LoadÅÄÑo³êénh
+		// HashtableÌStringðTypeConverterÅ³Ì`®Éß·B(©®IÉvpeBÉZbg)
+		//
+		private Object LoadConfigHandler(String key, Type propertyType)
+		{
+			if (!_config.ContainsKey(key)) return null;
+
+			TypeConverter tconv = TypeDescriptor.GetConverter(propertyType);
+			try
+			{
+				Object o = tconv.ConvertFromString(_config[key] as String);
+				return o;
+			} 
+			catch (NotSupportedException) 
+			{
+				return null;
+			}
+		}
+		#endregion
+
+	}
+}
Index: /trunk/MacFaceFloat/ConfigurationForm.cs
===================================================================
--- /trunk/MacFaceFloat/ConfigurationForm.cs	(revision 13)
+++ /trunk/MacFaceFloat/ConfigurationForm.cs	(revision 13)
@@ -0,0 +1,474 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.IO;
+
+namespace MacFace.FloatApp
+{
+	/// <summary>
+	/// ConfigurationForm ÌTvÌà¾Å·B
+	/// </summary>
+	public class ConfigurationForm : System.Windows.Forms.Form
+	{
+		private MainForm _mainForm;
+		private Configuration _config;
+
+		private System.Windows.Forms.TreeView treeCategory;
+		private System.Windows.Forms.Button buttonCancel;
+		private System.Windows.Forms.Button buttonApply;
+		private System.Windows.Forms.Button buttonOK;
+		private System.Windows.Forms.Label labelTitle;
+		private System.Windows.Forms.Panel panelContainer;
+		private System.Windows.Forms.Panel panelAppearance;
+		private System.Windows.Forms.TrackBar trackBarOpacity;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.Label label2;
+		private System.Windows.Forms.Label label3;
+		private System.Windows.Forms.Button buttonBrowse;
+		private System.Windows.Forms.Panel panelFacePatternList;
+		private System.Windows.Forms.ListView listViewFaces;
+		private System.Windows.Forms.ImageList imageListFacePreviews;
+		private System.Windows.Forms.ToolTip toolTipPreviewDetail;
+		private System.Windows.Forms.LinkLabel linkWebSite;
+		private System.Windows.Forms.Label label4;
+		private System.Windows.Forms.CheckBox checkMouseMessage;
+		private System.ComponentModel.IContainer components;
+
+		public ConfigurationForm(MainForm mainForm)
+		{
+			//
+			// Windows tH[ fUCi T|[gÉKvÅ·B
+			//
+			InitializeComponent();
+
+			_mainForm = mainForm;
+			_config = Configuration.GetInstance();
+
+		}
+
+		/// <summary>
+		/// gp³êÄ¢é\[XÉãðÀsµÜ·B
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows tH[ fUCiÅ¶¬³ê½R[h 
+		/// <summary>
+		/// fUCi T|[gÉKvÈ\bhÅ·B±Ì\bhÌàeð
+		/// R[h GfB^ÅÏXµÈ¢Å­¾³¢B
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.components = new System.ComponentModel.Container();
+			this.treeCategory = new System.Windows.Forms.TreeView();
+			this.buttonCancel = new System.Windows.Forms.Button();
+			this.buttonApply = new System.Windows.Forms.Button();
+			this.buttonOK = new System.Windows.Forms.Button();
+			this.labelTitle = new System.Windows.Forms.Label();
+			this.panelContainer = new System.Windows.Forms.Panel();
+			this.panelAppearance = new System.Windows.Forms.Panel();
+			this.label1 = new System.Windows.Forms.Label();
+			this.trackBarOpacity = new System.Windows.Forms.TrackBar();
+			this.label2 = new System.Windows.Forms.Label();
+			this.label3 = new System.Windows.Forms.Label();
+			this.panelFacePatternList = new System.Windows.Forms.Panel();
+			this.listViewFaces = new System.Windows.Forms.ListView();
+			this.buttonBrowse = new System.Windows.Forms.Button();
+			this.imageListFacePreviews = new System.Windows.Forms.ImageList(this.components);
+			this.toolTipPreviewDetail = new System.Windows.Forms.ToolTip(this.components);
+			this.linkWebSite = new System.Windows.Forms.LinkLabel();
+			this.label4 = new System.Windows.Forms.Label();
+			this.checkMouseMessage = new System.Windows.Forms.CheckBox();
+			this.panelContainer.SuspendLayout();
+			this.panelAppearance.SuspendLayout();
+			((System.ComponentModel.ISupportInitialize)(this.trackBarOpacity)).BeginInit();
+			this.panelFacePatternList.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// treeCategory
+			// 
+			this.treeCategory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+				| System.Windows.Forms.AnchorStyles.Left)));
+			this.treeCategory.ImageIndex = -1;
+			this.treeCategory.Location = new System.Drawing.Point(0, 0);
+			this.treeCategory.Name = "treeCategory";
+			this.treeCategory.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
+																					 new System.Windows.Forms.TreeNode("SÊ"),
+																					 new System.Windows.Forms.TreeNode("çp^[")});
+			this.treeCategory.SelectedImageIndex = -1;
+			this.treeCategory.Size = new System.Drawing.Size(193, 449);
+			this.treeCategory.TabIndex = 0;
+			this.treeCategory.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeCategory_AfterSelect);
+			// 
+			// buttonCancel
+			// 
+			this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+			this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.buttonCancel.Location = new System.Drawing.Point(427, 420);
+			this.buttonCancel.Name = "buttonCancel";
+			this.buttonCancel.Size = new System.Drawing.Size(87, 21);
+			this.buttonCancel.TabIndex = 1;
+			this.buttonCancel.Text = "LZ";
+			// 
+			// buttonApply
+			// 
+			this.buttonApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+			this.buttonApply.Enabled = false;
+			this.buttonApply.Location = new System.Drawing.Point(521, 420);
+			this.buttonApply.Name = "buttonApply";
+			this.buttonApply.Size = new System.Drawing.Size(87, 21);
+			this.buttonApply.TabIndex = 2;
+			this.buttonApply.Text = "Kp(&A)";
+			// 
+			// buttonOK
+			// 
+			this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+			this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.buttonOK.Location = new System.Drawing.Point(332, 420);
+			this.buttonOK.Name = "buttonOK";
+			this.buttonOK.Size = new System.Drawing.Size(87, 21);
+			this.buttonOK.TabIndex = 3;
+			this.buttonOK.Text = "OK";
+			this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
+			// 
+			// labelTitle
+			// 
+			this.labelTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+				| System.Windows.Forms.AnchorStyles.Right)));
+			this.labelTitle.BackColor = System.Drawing.SystemColors.ActiveCaption;
+			this.labelTitle.Font = new System.Drawing.Font("MS UI Gothic", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(128)));
+			this.labelTitle.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
+			this.labelTitle.Location = new System.Drawing.Point(199, 5);
+			this.labelTitle.Name = "labelTitle";
+			this.labelTitle.Size = new System.Drawing.Size(412, 27);
+			this.labelTitle.TabIndex = 4;
+			this.labelTitle.Text = "SÊ";
+			this.labelTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// panelContainer
+			// 
+			this.panelContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+				| System.Windows.Forms.AnchorStyles.Left) 
+				| System.Windows.Forms.AnchorStyles.Right)));
+			this.panelContainer.Controls.Add(this.panelFacePatternList);
+			this.panelContainer.Controls.Add(this.panelAppearance);
+			this.panelContainer.Location = new System.Drawing.Point(198, 38);
+			this.panelContainer.Name = "panelContainer";
+			this.panelContainer.Size = new System.Drawing.Size(411, 371);
+			this.panelContainer.TabIndex = 5;
+			// 
+			// panelAppearance
+			// 
+			this.panelAppearance.Controls.Add(this.checkMouseMessage);
+			this.panelAppearance.Controls.Add(this.label3);
+			this.panelAppearance.Controls.Add(this.label2);
+			this.panelAppearance.Controls.Add(this.label1);
+			this.panelAppearance.Controls.Add(this.trackBarOpacity);
+			this.panelAppearance.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.panelAppearance.Location = new System.Drawing.Point(0, 0);
+			this.panelAppearance.Name = "panelAppearance";
+			this.panelAppearance.Size = new System.Drawing.Size(411, 371);
+			this.panelAppearance.TabIndex = 0;
+			// 
+			// label1
+			// 
+			this.label1.Location = new System.Drawing.Point(2, 5);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(196, 18);
+			this.label1.TabIndex = 1;
+			this.label1.Text = "§¾x:";
+			// 
+			// trackBarOpacity
+			// 
+			this.trackBarOpacity.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+				| System.Windows.Forms.AnchorStyles.Right)));
+			this.trackBarOpacity.LargeChange = 10;
+			this.trackBarOpacity.Location = new System.Drawing.Point(8, 26);
+			this.trackBarOpacity.Maximum = 100;
+			this.trackBarOpacity.Name = "trackBarOpacity";
+			this.trackBarOpacity.Size = new System.Drawing.Size(400, 42);
+			this.trackBarOpacity.TabIndex = 0;
+			this.trackBarOpacity.TickFrequency = 10;
+			// 
+			// label2
+			// 
+			this.label2.Location = new System.Drawing.Point(4, 73);
+			this.label2.Name = "label2";
+			this.label2.Size = new System.Drawing.Size(31, 11);
+			this.label2.TabIndex = 2;
+			this.label2.Text = "§¾";
+			// 
+			// label3
+			// 
+			this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+			this.label3.Location = new System.Drawing.Point(364, 73);
+			this.label3.Name = "label3";
+			this.label3.Size = new System.Drawing.Size(45, 11);
+			this.label3.TabIndex = 3;
+			this.label3.Text = "s§¾";
+			// 
+			// panelFacePatternList
+			// 
+			this.panelFacePatternList.Controls.Add(this.label4);
+			this.panelFacePatternList.Controls.Add(this.linkWebSite);
+			this.panelFacePatternList.Controls.Add(this.buttonBrowse);
+			this.panelFacePatternList.Controls.Add(this.listViewFaces);
+			this.panelFacePatternList.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.panelFacePatternList.Location = new System.Drawing.Point(0, 0);
+			this.panelFacePatternList.Name = "panelFacePatternList";
+			this.panelFacePatternList.Size = new System.Drawing.Size(411, 371);
+			this.panelFacePatternList.TabIndex = 7;
+			// 
+			// listViewFaces
+			// 
+			this.listViewFaces.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+				| System.Windows.Forms.AnchorStyles.Left) 
+				| System.Windows.Forms.AnchorStyles.Right)));
+			this.listViewFaces.LargeImageList = this.imageListFacePreviews;
+			this.listViewFaces.Location = new System.Drawing.Point(0, 0);
+			this.listViewFaces.Name = "listViewFaces";
+			this.listViewFaces.Size = new System.Drawing.Size(410, 318);
+			this.listViewFaces.TabIndex = 0;
+			this.listViewFaces.DoubleClick += new System.EventHandler(this.listViewFaces_DoubleClick);
+			this.listViewFaces.MouseMove += new System.Windows.Forms.MouseEventHandler(this.listViewFaces_MouseMove);
+			this.listViewFaces.SelectedIndexChanged += new System.EventHandler(this.listViewFaces_SelectedIndexChanged);
+			// 
+			// buttonBrowse
+			// 
+			this.buttonBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+			this.buttonBrowse.Location = new System.Drawing.Point(322, 323);
+			this.buttonBrowse.Name = "buttonBrowse";
+			this.buttonBrowse.Size = new System.Drawing.Size(87, 21);
+			this.buttonBrowse.TabIndex = 1;
+			this.buttonBrowse.Text = "QÆ(&B)...";
+			this.buttonBrowse.Click += new System.EventHandler(this.buttonBrowse_Click);
+			// 
+			// imageListFacePreviews
+			// 
+			this.imageListFacePreviews.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
+			this.imageListFacePreviews.ImageSize = new System.Drawing.Size(128, 128);
+			this.imageListFacePreviews.TransparentColor = System.Drawing.Color.Transparent;
+			// 
+			// linkWebSite
+			// 
+			this.linkWebSite.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
+				| System.Windows.Forms.AnchorStyles.Right)));
+			this.linkWebSite.Location = new System.Drawing.Point(67, 350);
+			this.linkWebSite.Name = "linkWebSite";
+			this.linkWebSite.Size = new System.Drawing.Size(338, 16);
+			this.linkWebSite.TabIndex = 2;
+			// 
+			// label4
+			// 
+			this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+			this.label4.Location = new System.Drawing.Point(4, 350);
+			this.label4.Name = "label4";
+			this.label4.Size = new System.Drawing.Size(63, 17);
+			this.label4.TabIndex = 3;
+			this.label4.Text = "EFuTCg:";
+			// 
+			// checkMouseMessage
+			// 
+			this.checkMouseMessage.Enabled = false;
+			this.checkMouseMessage.Location = new System.Drawing.Point(5, 115);
+			this.checkMouseMessage.Name = "checkMouseMessage";
+			this.checkMouseMessage.Size = new System.Drawing.Size(400, 16);
+			this.checkMouseMessage.TabIndex = 4;
+			this.checkMouseMessage.Text = "}EXÌ®ìðwÊÌEBhEÖ`¦é(&T)";
+			// 
+			// ConfigurationForm
+			// 
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 12);
+			this.ClientSize = new System.Drawing.Size(616, 450);
+			this.Controls.Add(this.panelContainer);
+			this.Controls.Add(this.labelTitle);
+			this.Controls.Add(this.buttonOK);
+			this.Controls.Add(this.buttonApply);
+			this.Controls.Add(this.buttonCancel);
+			this.Controls.Add(this.treeCategory);
+			this.MinimumSize = new System.Drawing.Size(500, 140);
+			this.Name = "ConfigurationForm";
+			this.Text = "MacFace ÌÝè";
+			this.Load += new System.EventHandler(this.ConfigurationForm_Load);
+			this.panelContainer.ResumeLayout(false);
+			this.panelAppearance.ResumeLayout(false);
+			((System.ComponentModel.ISupportInitialize)(this.trackBarOpacity)).EndInit();
+			this.panelFacePatternList.ResumeLayout(false);
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		private void ConfigurationForm_Load(object sender, System.EventArgs e)
+		{
+			// SÊð\¦B
+			foreach (Panel pane in panelContainer.Controls)
+				pane.Visible = false;
+
+			panelAppearance.Show();
+
+			// úlðZbgB
+			trackBarOpacity.Value = (int) (_mainForm.Opacity * 100);
+			checkMouseMessage.Checked = Configuration.GetInstance().TransparentMouseMessage;
+		}
+
+		private void buttonOK_Click(object sender, System.EventArgs e)
+		{
+			Configuration config = Configuration.GetInstance();
+			config.Opacity = trackBarOpacity.Value;
+			config.TransparentMouseMessage = checkMouseMessage.Checked;
+
+			this.Close();
+		}
+
+		private void treeCategory_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
+		{
+			Panel container;
+
+			// Ä«Æ¤
+			if (e.Node.Text == labelTitle.Text) return;
+			foreach (Panel pane in panelContainer.Controls)
+				pane.Visible = false;
+			switch (e.Node.Text) 
+			{
+				case "SÊ":
+					panelAppearance.Show();
+					break;
+				case "çp^[":
+					listViewFaces.Items.Clear();
+					imageListFacePreviews.Images.Clear();
+					int i = 0;
+
+					using (Bitmap tmpImage = new Bitmap(128, 128)) 
+					{
+						// çp^[XgðìéB
+						// TODO: ±ÌÜÜ¾Æx¢ÌÅß¢¤¿Éñ¯úÉµæ¤B
+						// AvP[VfBNgÌºB
+						foreach (DirectoryInfo dir in (new DirectoryInfo(Application.StartupPath)).GetDirectories("*.mcface"))
+						{
+							AddPreviewListItem(dir.FullName);
+						}
+						// %USERPROFILE%\Application Data\MacFace\Faces ºB
+						string userFaceDefPath = Path.Combine(Configuration.ConfigurationPath, "Faces");
+						if (Directory.Exists(userFaceDefPath)) 
+						{
+							foreach (DirectoryInfo dir in (new DirectoryInfo(userFaceDefPath).GetDirectories("*.mcface")))
+							{
+								AddPreviewListItem(dir.FullName);
+							}
+						}
+					}
+
+					panelFacePatternList.Show();
+					break;
+			}
+
+			labelTitle.Text = e.Node.Text;
+		}
+
+
+		private void AddPreviewListItem(string path)
+		{
+			using (Bitmap tmpImage = new Bitmap(128, 128)) 
+			{
+				try 
+				{
+					FaceDef faceDef = FaceDef.CreateFaceDefFromFile(path);
+					PartList partList = faceDef.FacePattern.GetPartList(100, PageOutFlag.Normal);
+					
+					using (Graphics g = Graphics.FromImage(tmpImage)) 
+					{
+						g.Clear(Color.White);
+						g.DrawRectangle(new Pen(Color.LightGray), 0, 0, 127, 127);
+						foreach (Part part in partList) 
+						{
+							g.DrawImage(part.Image,
+								part.Point.X, part.Point.Y,
+								part.Image.Size.Width, part.Image.Size.Height);
+						}
+					}
+					imageListFacePreviews.Images.Add(tmpImage);
+
+					ListViewItem item = listViewFaces.Items.Add(faceDef.Title, imageListFacePreviews.Images.Count-1);
+					item.SubItems.Add(path);    // 0: pX
+					item.SubItems.Add(faceDef.Author);  // 1: »ìÒ
+					item.SubItems.Add(faceDef.Version); // 2: o[W
+					item.SubItems.Add(
+						(faceDef.WebSite != null ?
+						faceDef.WebSite.ToString() : "")); // 3: EFuTCg
+				} 
+				catch (Exception ex) 
+				{
+					// TODO: Exception ©çàÁÆ·ßéB
+					MessageBox.Show(ex.ToString(), "MacFace for Windows", MessageBoxButtons.OK, MessageBoxIcon.Error);
+				}
+			}
+		}
+
+		private void listViewFaces_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
+		{
+			ListViewItem item = listViewFaces.GetItemAt(e.X, e.Y);
+			
+			if (item != null) 
+			{
+				string tooltipText = String.Format("^Cg: {0}\n»ìÒ: {1}\no[W: {2}",
+					item.Text, item.SubItems[2].Text, item.SubItems[3].Text);
+                
+				if (toolTipPreviewDetail.GetToolTip(listViewFaces) != tooltipText)
+					toolTipPreviewDetail.SetToolTip(listViewFaces, tooltipText);
+			} 
+			else 
+			{
+				// Á·B
+				toolTipPreviewDetail.SetToolTip(listViewFaces, "");
+			}
+		
+		}
+
+		private void listViewFaces_SelectedIndexChanged(object sender, System.EventArgs e)
+		{
+			if (listViewFaces.SelectedItems.Count == 0) 
+			{
+				linkWebSite.Text = "";
+			} 
+			else 
+			{
+				ListViewItem item = listViewFaces.SelectedItems[0];
+				linkWebSite.Text = item.SubItems[4].Text;
+			}
+		}
+
+		private void listViewFaces_DoubleClick(object sender, System.EventArgs e)
+		{
+			Point pos = listViewFaces.PointToClient(Cursor.Position);
+			ListViewItem item = listViewFaces.GetItemAt(pos.X, pos.Y);
+			
+			if (item != null) 
+			{
+				_mainForm.LoadFaceDefine(item.SubItems[1].Text);
+			}
+		}
+
+		private void buttonBrowse_Click(object sender, System.EventArgs e)
+		{
+			FolderBrowserDialog folderBrowser = new FolderBrowserDialog();
+			folderBrowser.SelectedPath = Application.StartupPath;
+			folderBrowser.Description = "çp^[t@CÌ¶Ý·étH_ðIðµÄ­¾³¢B";
+			if (folderBrowser.ShowDialog() == DialogResult.OK) 
+			{
+				AddPreviewListItem(folderBrowser.SelectedPath);
+			} 
+		}
+	}
+}
Index: /trunk/MacFaceFloat/ConfigurationForm.resx
===================================================================
--- /trunk/MacFaceFloat/ConfigurationForm.resx	(revision 13)
+++ /trunk/MacFaceFloat/ConfigurationForm.resx	(revision 13)
@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="treeCategory.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="treeCategory.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="treeCategory.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="buttonCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="buttonCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="buttonCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="buttonApply.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="buttonApply.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="buttonApply.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="buttonOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="buttonOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="buttonOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="labelTitle.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="labelTitle.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="labelTitle.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelContainer.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelContainer.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelContainer.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panelContainer.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelContainer.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelContainer.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="panelAppearance.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelAppearance.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelAppearance.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panelAppearance.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelAppearance.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelAppearance.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="trackBarOpacity.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="trackBarOpacity.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="trackBarOpacity.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label3.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelFacePatternList.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelFacePatternList.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelFacePatternList.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panelFacePatternList.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelFacePatternList.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelFacePatternList.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="listViewFaces.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="listViewFaces.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="listViewFaces.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="buttonBrowse.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="buttonBrowse.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="buttonBrowse.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="imageListFacePreviews.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="imageListFacePreviews.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="imageListFacePreviews.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </data>
+  <data name="toolTipPreviewDetail.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="toolTipPreviewDetail.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>183, 17</value>
+  </data>
+  <data name="toolTipPreviewDetail.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="linkWebSite.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="linkWebSite.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="linkWebSite.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label4.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label4.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="checkMouseMessage.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="checkMouseMessage.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="checkMouseMessage.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Name">
+    <value>ConfigurationForm</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+</root>
Index: /trunk/MacFaceFloat/MacFaceFloat.csproj
===================================================================
--- /trunk/MacFaceFloat/MacFaceFloat.csproj	(revision 12)
+++ /trunk/MacFaceFloat/MacFaceFloat.csproj	(revision 13)
@@ -19,5 +19,5 @@
                 PreBuildEvent = ""
                 PostBuildEvent = ""
-                RootNamespace = "MacFace"
+                RootNamespace = "MacFace.FloatApp"
                 RunPostBuildEvent = "OnBuildSuccess"
                 StartupObject = ""
@@ -114,7 +114,32 @@
                 />
                 <File
+                    RelPath = "AppSettings.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "AssemblyInfo.cs"
                     SubType = "Code"
                     BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "AutoConfigurator.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Configuration.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ConfigurationForm.cs"
+                    SubType = "Form"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ConfigurationForm.resx"
+                    DependentUpon = "ConfigurationForm.cs"
+                    BuildAction = "EmbeddedResource"
                 />
                 <File
Index: /trunk/MacFaceFloat/MainForm.cs
===================================================================
--- /trunk/MacFaceFloat/MainForm.cs	(revision 12)
+++ /trunk/MacFaceFloat/MainForm.cs	(revision 13)
@@ -17,5 +17,5 @@
 using System.Threading;
 
-namespace MacFace
+namespace MacFace.FloatApp
 {
 	public class MainForm : Misuzilla.Windows.Forms.AlphaForm
@@ -23,9 +23,11 @@
 		private System.Windows.Forms.ContextMenu contextMenu;
 		private System.Windows.Forms.MenuItem menuItemPatternSelect;
+		private System.Windows.Forms.MenuItem menuItemConfigure;
 		private System.Windows.Forms.MenuItem menuItemExit;
-		private Hashtable _property;
-		private ArrayList _parts;
 		private String _facePath;
 		private System.Windows.Forms.Timer _updateTimer;
+
+		private FaceDef _currentFaceDef;
+		private Configuration _config;
 		
 		Int32 prevUsage;
@@ -62,8 +64,7 @@
 		}
 
-		// THIS METHOD IS MAINTAINED BY THE FORM DESIGNER
-		// DO NOT EDIT IT MANUALLY! YOUR CHANGES ARE LIKELY TO BE LOST
 		void InitializeComponent() {
 			this.menuItemPatternSelect = new System.Windows.Forms.MenuItem();
+			this.menuItemConfigure = new System.Windows.Forms.MenuItem();
 			this.menuItemExit = new System.Windows.Forms.MenuItem();
 			this.contextMenu = new System.Windows.Forms.ContextMenu();
@@ -71,8 +72,12 @@
 			// menuItemPatternSelect
 			// 
-			this.menuItemPatternSelect.Index = 0;
 			this.menuItemPatternSelect.Text = "çp^[ÌIð(&S)";
-			this.menuItemPatternSelect.Click += new System.EventHandler(this.PatternSelect_Click);
-
+			this.menuItemPatternSelect.Click += new System.EventHandler(this.menuItemPatternSelect_Click);
+
+			// 
+			// menuItemConfigure
+			// 
+			this.menuItemConfigure.Text = "MacFace ÌÝè(&C)...";
+			this.menuItemConfigure.Click +=new EventHandler(menuItemConfigure_Click);
 			// 
 			// menuItemExit
@@ -81,10 +86,10 @@
 			this.menuItemExit.Shortcut = System.Windows.Forms.Shortcut.CtrlQ;
 			this.menuItemExit.Text = "I¹(&X)";
-			this.menuItemExit.Click += new System.EventHandler(this.doQuit);
+			this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_Click);
 			// 
 			// contextMenu
 			// 
 			this.contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
-						this.menuItemPatternSelect, new MenuItem("-"), this.menuItemExit});
+						this.menuItemPatternSelect, this.menuItemConfigure, new MenuItem("-"), this.menuItemExit});
 			// 
 			// MainForm
@@ -102,4 +107,6 @@
 			this.TopMost = true;
 			this.Load += new EventHandler(MainForm_Load);
+			this.Closing += new CancelEventHandler(MainForm_Closing);
+			this.Move += new EventHandler(MainForm_Move);
 		}
 			
@@ -143,6 +150,7 @@
 
 
-		bool LoadFaceDefine(string path)
-		{
+		public bool LoadFaceDefine(string path)
+		{
+			FaceDef newFaceDef = null;
 			string plistPath = Path.Combine(path, "faceDef.plist");
 
@@ -155,8 +163,7 @@
 			}
 			
-			Hashtable property;
 			try 
 			{
-				property = PropertyList.Load(plistPath);
+				newFaceDef = MacFace.FaceDef.CreateFaceDefFromFile(path);
 			} 
 			catch (System.IO.IOException ie) 
@@ -180,7 +187,6 @@
 			if (_updateTimer != null) _updateTimer.Stop();
 
-			_property = property;
-			_facePath = path;
-			_parts = (ArrayList)_property["parts"];
+			_currentFaceDef = newFaceDef;
+			_facePath = _currentFaceDef.Path;
 			prevUsage = -10;
 
@@ -205,18 +211,10 @@
 				
 			if (prevUsage/10 != usage/10) {
-				ArrayList patterns = (ArrayList)_property["pattern"];
-				ArrayList patternCpu = (ArrayList)patterns[0];
-				ArrayList facePattern = (ArrayList)patternCpu[usage/10];
-				
 				this.Graphics.Clear(Color.FromArgb(0, 0, 0, 0));
-				foreach (Int32 i in facePattern) {
-					Hashtable part = _parts[i] as Hashtable;
-					string filename = (string)part["filename"];
-					string imgPath = Path.Combine(_facePath, filename);
-					using (Bitmap bitmap = new Bitmap(imgPath)) {
-						int x = (int)part["pos x"];
-						int y = 128 - (int)part["pos y"] - bitmap.Size.Height;
-						this.Graphics.DrawImage(bitmap,x,y,bitmap.Size.Width,bitmap.Size.Height);
-					}
+				foreach (Part part in _currentFaceDef.FacePattern.GetPartList(usage, PageOutFlag.Normal))
+				{
+					this.Graphics.DrawImage(part.Image,
+						part.Point.X, part.Point.Y,
+						part.Image.Size.Width, part.Image.Size.Height);
 				}
 				this.Update();
@@ -227,12 +225,20 @@
 		
 
+		//
+		// N®
+		//
 		public void MainForm_Load(object sender, System.EventArgs e)
 		{
-			string faceDefPath = Path.Combine(Application.StartupPath, "default.mcface");
+			// Ýè
+			_config = Configuration.GetInstance();
+			_config.Load();
+
+			ApplyConfiguration();
+
+			// çp^[ÇÝÝ
 			bool result = false;
-
-			if (Directory.Exists(faceDefPath))
-			{
-				result = LoadFaceDefine(faceDefPath);
+			if (Directory.Exists(_config.FaceDefPath))
+			{
+				result = LoadFaceDefine(_config.FaceDefPath);
 			}
 
@@ -241,5 +247,5 @@
 				if (!SelectFaceDefine(Application.StartupPath))
 				{
-					Application.Exit();
+					this.Close();
 					return;
 				}
@@ -247,4 +253,19 @@
 			}
 		}
+
+		// 
+		// I¹
+		//
+		private void MainForm_Closing(object sender, CancelEventArgs e)
+		{
+			// Û¶
+			_config.Opacity = (int) (this.Opacity * 100);
+			_config.FaceDefPath = (_currentFaceDef != null ? _currentFaceDef.Path : Path.Combine(Application.StartupPath, "default.mcface"));
+			_config.Location = this.Location;
+			_config.TransparentMouseMessage = this.TransparentMouseMessage;
+
+			_config.Save();
+		}
+
 
 		/*
@@ -252,15 +273,35 @@
 [NbNCxg
 		 */
-		public void PatternSelect_Click(object sender, System.EventArgs e)
+		public void menuItemPatternSelect_Click(object sender, System.EventArgs e)
 		{
 			SelectFaceDefine(_facePath);	
 		}
 
-		public void doQuit(object sender, System.EventArgs e)
+		public void menuItemExit_Click(object sender, System.EventArgs e)
 		{
 			_updateTimer.Stop();
-			Application.Exit();
-		}
-		
+			this.Close();
+		}
+
+		private void menuItemConfigure_Click(object sender, EventArgs e)
+		{
+			ConfigurationForm configForm = new ConfigurationForm(this);
+			if (configForm.ShowDialog() == DialogResult.OK) 
+			{
+				ApplyConfiguration();
+			}
+		}
+
+		private void ApplyConfiguration()
+		{
+			this.Opacity = (float)_config.Opacity / 100;
+			this.Location = _config.Location;
+			this.TransparentMouseMessage = _config.TransparentMouseMessage;
+		}
+
+		private void MainForm_Move(object sender, EventArgs e)
+		{
+			_config.Location = this.Location;
+		}
 	}
 }
Index: /trunk/MacFaceLibrary/FaceDef.cs
===================================================================
--- /trunk/MacFaceLibrary/FaceDef.cs	(revision 12)
+++ /trunk/MacFaceLibrary/FaceDef.cs	(revision 13)
@@ -16,29 +16,61 @@
 	public class FaceDef
 	{
-		public const string FaceDefName = "faceDef.plist";
-		public const int PatternCols = 11;
-		public const int PatternRows = 3;
-
-		protected string path;
-		protected string title;
-		protected string auther;
-		protected string version;
-		protected string webSite;
-
-		protected PartList parts = new PartList();
+		public static readonly string FaceDefName = "faceDef.plist";
+		public static readonly int PatternCols = 11;
+		public static readonly int PatternRows = 3;
+
+		private string _path    = "";
+		private string _title   = "";
+		private string _auther  = "";
+		private string _version = ""; /*Version*/
+		private Uri    _webSite = null;
+
+		internal PartList _parts = new PartList();
 		//protected int[][,] patterns;
-		//protected PartList makers = new PartList();
+		internal PartList _makers = new PartList();
+		internal FacePattern _patterns;
 
 
 		// ctor
-		private FaceDef() {}
-
+		public FaceDef() {}
 
 		// properties
+		public FacePattern FacePattern
+		{
+			get { return _patterns; }
+		}
+		public PartList Markers
+		{
+			get { return _makers; }
+		}
 		public PartList Parts
 		{
-			get { return parts; }
-		}
-
+			get { return _parts; }
+		}
+		public Uri WebSite
+		{
+			get { return _webSite; }
+			set { _webSite = value; }
+		}
+		public string /*Version*/ Version
+		{
+			get { return _version; }
+			set { _version = value; }
+		}
+		public string Author
+		{
+			get { return _auther; }
+			set { _auther = value; }
+		}
+		public string Title
+		{
+			get { return _title; }
+			set { _title = value; }
+		}
+		public string Path
+		{
+			get { return _path; }
+			set { _path = value; }
+		}
 
 		// methods
@@ -47,6 +79,22 @@
 			FaceDef faceDef = new FaceDef();
 
-			string defFile = Path.Combine(path, FaceDefName);
-			Hashtable def = PropertyList.Load(path);
+			string defFile = System.IO.Path.Combine(path, FaceDefName);
+			Hashtable def = PropertyList.Load(defFile);
+
+			// îñ
+			faceDef.Title = (def.ContainsKey("title") ? def["title"] as string : String.Empty);
+			faceDef.Author = (def.ContainsKey("author") ? def["author"] as string : String.Empty);
+			faceDef.Version = (def.ContainsKey("version") ? def["version"] as string : String.Empty);
+			faceDef.Path = path;
+
+			if (def.ContainsKey("web site"))
+			{
+				try 
+				{
+					faceDef.WebSite = new Uri(def["web site"] as string);
+				} 
+				catch (UriFormatException) {}
+			}
+
 
 			// Part ðÇÝÞB
@@ -64,12 +112,24 @@
 				int x = (int)partDef["pos x"];
 				int y = (int)partDef["pos y"];
-				faceDef.Parts.Add(new Part(filename, x, y));
+				faceDef.Parts.Add(new Part(System.IO.Path.Combine(path, filename), x, y));
 			}
 
 			// TODO: pattern ðÇÝÞB
+			faceDef._patterns = new FacePattern(faceDef.Parts, def["pattern"] as ArrayList);
 
 			return faceDef;
 		}
-
+	}
+
+	public enum MarkerBitMask
+	{
+		None    = 0x0000,
+		PageIn  = 0x0001,
+		PageOut = 0x0002
+	}
+
+	public class FaceDefFormatException : ApplicationException
+	{
+		// TODO: tH[}bgªs³¾Á½Æ«É°éExceptionð¢ÄAs³¾Á½Æ«É°éæ¤É·éB
 	}
 }
Index: /trunk/MacFaceLibrary/FacePattern.cs
===================================================================
--- /trunk/MacFaceLibrary/FacePattern.cs	(revision 13)
+++ /trunk/MacFaceLibrary/FacePattern.cs	(revision 13)
@@ -0,0 +1,72 @@
+/*
+ * FacePattern.cs
+ * $Id$
+ * 
+ */
+
+using System;
+using System.Collections;
+
+namespace MacFace
+{
+	public enum PageOutFlag
+	{
+		Normal,
+		PageOut,
+		PageOutLarge
+	}
+
+	/// <summary>
+	/// FacePattern ÌTvÌà¾Å·B
+	/// </summary>
+	public class FacePattern
+	{
+		private PartList[] _partsMemNormal   = new PartList[11];
+		private PartList[] _partsMemPageOut  = new PartList[11];
+		private PartList[] _partsMemPageOutL = new PartList[11];
+
+		protected PartList[] MemoryNormal { get { return _partsMemNormal; } }
+		protected PartList[] MemoryPageOut { get { return _partsMemPageOut; } }
+		protected PartList[] MemoryPageOutLarge { get { return _partsMemPageOutL; } }
+
+		public PartList GetPartList(int cpuUsagePct, PageOutFlag pageOut)
+		{
+			PartList[] partlist = null;
+			switch (pageOut) 
+			{
+				case PageOutFlag.Normal: partlist = _partsMemNormal; break;
+				case PageOutFlag.PageOut: partlist = _partsMemPageOut; break;
+				case PageOutFlag.PageOutLarge: partlist = _partsMemPageOutL; break;
+			}
+			return partlist[cpuUsagePct/10];
+		}
+
+		public FacePattern(PartList faceParts, ArrayList patterns)
+		{
+			// Ì3p^[
+			for (int i = 0; i < 3; i++) 
+			{
+				PartList[] partlist = null;
+				switch (i) 
+				{
+					case 0: partlist = _partsMemNormal; break;
+					case 1: partlist = _partsMemPageOut; break;
+					case 2: partlist = _partsMemPageOutL; break;
+					default: break;
+				}
+
+				ArrayList patternByMem = patterns[i] as ArrayList;
+				// CPU Ì11p^[B
+				for (int j = 0; j < 11; j++) 
+				{
+					partlist[j] = new PartList();
+					ArrayList facePattern = patternByMem[j] as ArrayList;
+					foreach (int patNo in facePattern) 
+					{
+						partlist[j].Add(faceParts[patNo]);
+					}
+				}
+			}
+		}
+	}
+}
Index: /trunk/MacFaceLibrary/MacFaceLibrary.csproj
===================================================================
--- /trunk/MacFaceLibrary/MacFaceLibrary.csproj	(revision 12)
+++ /trunk/MacFaceLibrary/MacFaceLibrary.csproj	(revision 13)
@@ -105,4 +105,9 @@
                 />
                 <File
+                    RelPath = "FacePattern.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "HostStatistics.cs"
                     SubType = "Code"
Index: /trunk/MacFaceLibrary/Part.cs
===================================================================
--- /trunk/MacFaceLibrary/Part.cs	(revision 12)
+++ /trunk/MacFaceLibrary/Part.cs	(revision 13)
@@ -12,10 +12,9 @@
 	/// Part ÌTvÌà¾Å·B
 	/// </summary>
-	public class Part
+	public class Part : IDisposable
 	{
-		protected Image image;
-		protected string filename;
-		protected int x;
-		protected int y;
+		private Image _image;
+		private string _filename;
+		private Point _point;
 
 		/*public Part(string basePath, Hashtable partDef)
@@ -28,36 +27,43 @@
 		public Part(String path, int x, int y)
 		{
-			this.filename = filename;
-			this.image = Image.FromFile(path);
-			this.x = x;
-			this.y = y;
+			_filename = System.IO.Path.GetFileName(path);
+			_image = Image.FromFile(path);
+			this.X = x;
+			this.Y = y;
 		}
 
 		public Part(String path, Image image, int x, int y)
 		{
-			this.filename = filename;
-			this.image = image;
-			this.x = x;
-			this.y = y;
+			_filename = System.IO.Path.GetFileName(path);
+			_image = image;
+			this.X = x;
+			this.Y = y;
 		}
 
 		public string FileName 
 		{
-			get { return filename; }
+			get { return _filename; }
 		}
 
 		public Image Image 
 		{
-			get { return image; }
+			get { return _image; }
 		}
 
+		public Point Point
+		{
+			get { return _point; }
+			set { _point = value; }
+		}
 		public int X
 		{
-			get { return x; }
+			get { return _point.X; }
+			set { _point.X = value; }
 		}
 
 		public int Y
 		{
-			get { return y; }
+			get { return 128 - _point.Y - _image.Height; }
+			set { _point.Y = 128 - value - _image.Height; }
 		}
 
@@ -67,4 +73,28 @@
 			g.DrawImage(img, x, drawY, img.Size.Width, img.Size.Height);
 		}*/
+
+		#region IDisposable o
+
+		public void Dispose()
+		{
+			Dispose(true);
+			GC.SuppressFinalize(this);
+		}
+
+		protected virtual void Dispose(bool disposing) 
+		{
+			if (disposing)
+			{
+			}
+			// í
+			if (_image != null) { _image.Dispose(); }
+		}
+
+		~Part()
+		{
+			Dispose(false);
+		}
+
+		#endregion
 	}
 }
