summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--src/xtm/Main.Designer.cs302
-rw-r--r--src/xtm/Main.cs269
-rw-r--r--src/xtm/Main.resx287
-rw-r--r--src/xtm/Program.cs21
-rw-r--r--src/xtm/Properties/AssemblyInfo.cs38
-rw-r--r--src/xtm/Properties/Resources.Designer.cs63
-rw-r--r--src/xtm/Properties/Resources.resourcesbin0 -> 180 bytes
-rw-r--r--src/xtm/Properties/Resources.resx120
-rw-r--r--src/xtm/Properties/Settings.Designer.cs26
-rw-r--r--src/xtm/Properties/Settings.settings7
-rw-r--r--src/xtm/README.md7
-rw-r--r--src/xtm/Resources/xchat.icobin0 -> 9662 bytes
-rw-r--r--src/xtm/app.config3
-rw-r--r--src/xtm/xtm.csproj163
-rw-r--r--win32/copy/copy.vcxproj2
-rw-r--r--win32/installer/xchat-wdk-x64.skel.iss3
-rw-r--r--win32/installer/xchat-wdk-x86.skel.iss3
-rw-r--r--win32/xchat.sln7
19 files changed, 1322 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 86b4fbc2..f1e9c0a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 plugins/wmpa/wmpa_h.h

 plugins/wmpa/wmpa_i.c

 src/pixmaps/inline_pngs.h

+src/xtm/obj/*

 win32/build/*

 win32/ipch/*

 win32/xchat.opensdf

diff --git a/src/xtm/Main.Designer.cs b/src/xtm/Main.Designer.cs
new file mode 100644
index 00000000..16d4ebcc
--- /dev/null
+++ b/src/xtm/Main.Designer.cs
@@ -0,0 +1,302 @@
+namespace thememan
+{
+    partial class XTM
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(XTM));
+            this.themelist = new System.Windows.Forms.ListBox();
+            this.themecolor0 = new System.Windows.Forms.Label();
+            this.themecolor1 = new System.Windows.Forms.Label();
+            this.themecolor2 = new System.Windows.Forms.Label();
+            this.themecolor3 = new System.Windows.Forms.Label();
+            this.themecolor4 = new System.Windows.Forms.Label();
+            this.themecolor5 = new System.Windows.Forms.Label();
+            this.themecolor6 = new System.Windows.Forms.Label();
+            this.themecolor7 = new System.Windows.Forms.Label();
+            this.themecolor8 = new System.Windows.Forms.Label();
+            this.themecolor9 = new System.Windows.Forms.Label();
+            this.themecolora = new System.Windows.Forms.Label();
+            this.themecolorb = new System.Windows.Forms.Label();
+            this.themecolorc = new System.Windows.Forms.Label();
+            this.themecolord = new System.Windows.Forms.Label();
+            this.themecolore = new System.Windows.Forms.Label();
+            this.themecolorf = new System.Windows.Forms.Label();
+            this.themecolorfg = new System.Windows.Forms.Label();
+            this.themecolortextbg = new System.Windows.Forms.Label();
+            this.importbutton = new System.Windows.Forms.Button();
+            this.applybutton = new System.Windows.Forms.Button();
+            this.themecolorfgmarked = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // themelist
+            // 
+            this.themelist.FormattingEnabled = true;
+            this.themelist.Location = new System.Drawing.Point(12, 12);
+            this.themelist.Name = "themelist";
+            this.themelist.Size = new System.Drawing.Size(154, 199);
+            this.themelist.TabIndex = 0;
+            this.themelist.SelectedIndexChanged += new System.EventHandler(this.theme_selected);
+            // 
+            // themecolor0
+            // 
+            this.themecolor0.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolor0.Location = new System.Drawing.Point(189, 36);
+            this.themecolor0.Name = "themecolor0";
+            this.themecolor0.Size = new System.Drawing.Size(40, 40);
+            this.themecolor0.TabIndex = 6;
+            // 
+            // themecolor1
+            // 
+            this.themecolor1.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolor1.Location = new System.Drawing.Point(239, 36);
+            this.themecolor1.Name = "themecolor1";
+            this.themecolor1.Size = new System.Drawing.Size(40, 40);
+            this.themecolor1.TabIndex = 10;
+            // 
+            // themecolor2
+            // 
+            this.themecolor2.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolor2.Location = new System.Drawing.Point(289, 36);
+            this.themecolor2.Name = "themecolor2";
+            this.themecolor2.Size = new System.Drawing.Size(40, 40);
+            this.themecolor2.TabIndex = 14;
+            // 
+            // themecolor3
+            // 
+            this.themecolor3.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolor3.Location = new System.Drawing.Point(339, 36);
+            this.themecolor3.Name = "themecolor3";
+            this.themecolor3.Size = new System.Drawing.Size(40, 40);
+            this.themecolor3.TabIndex = 18;
+            // 
+            // themecolor4
+            // 
+            this.themecolor4.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolor4.Location = new System.Drawing.Point(189, 87);
+            this.themecolor4.Name = "themecolor4";
+            this.themecolor4.Size = new System.Drawing.Size(40, 40);
+            this.themecolor4.TabIndex = 4;
+            // 
+            // themecolor5
+            // 
+            this.themecolor5.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolor5.Location = new System.Drawing.Point(239, 87);
+            this.themecolor5.Name = "themecolor5";
+            this.themecolor5.Size = new System.Drawing.Size(40, 40);
+            this.themecolor5.TabIndex = 8;
+            // 
+            // themecolor6
+            // 
+            this.themecolor6.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolor6.Location = new System.Drawing.Point(289, 87);
+            this.themecolor6.Name = "themecolor6";
+            this.themecolor6.Size = new System.Drawing.Size(40, 40);
+            this.themecolor6.TabIndex = 12;
+            // 
+            // themecolor7
+            // 
+            this.themecolor7.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolor7.Location = new System.Drawing.Point(339, 87);
+            this.themecolor7.Name = "themecolor7";
+            this.themecolor7.Size = new System.Drawing.Size(40, 40);
+            this.themecolor7.TabIndex = 16;
+            // 
+            // themecolor8
+            // 
+            this.themecolor8.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolor8.Location = new System.Drawing.Point(189, 138);
+            this.themecolor8.Name = "themecolor8";
+            this.themecolor8.Size = new System.Drawing.Size(40, 40);
+            this.themecolor8.TabIndex = 5;
+            // 
+            // themecolor9
+            // 
+            this.themecolor9.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolor9.Location = new System.Drawing.Point(239, 138);
+            this.themecolor9.Name = "themecolor9";
+            this.themecolor9.Size = new System.Drawing.Size(40, 40);
+            this.themecolor9.TabIndex = 9;
+            // 
+            // themecolora
+            // 
+            this.themecolora.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolora.Location = new System.Drawing.Point(289, 138);
+            this.themecolora.Name = "themecolora";
+            this.themecolora.Size = new System.Drawing.Size(40, 40);
+            this.themecolora.TabIndex = 13;
+            // 
+            // themecolorb
+            // 
+            this.themecolorb.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolorb.Location = new System.Drawing.Point(339, 138);
+            this.themecolorb.Name = "themecolorb";
+            this.themecolorb.Size = new System.Drawing.Size(40, 40);
+            this.themecolorb.TabIndex = 17;
+            // 
+            // themecolorc
+            // 
+            this.themecolorc.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolorc.Location = new System.Drawing.Point(189, 189);
+            this.themecolorc.Name = "themecolorc";
+            this.themecolorc.Size = new System.Drawing.Size(40, 40);
+            this.themecolorc.TabIndex = 7;
+            // 
+            // themecolord
+            // 
+            this.themecolord.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolord.Location = new System.Drawing.Point(239, 189);
+            this.themecolord.Name = "themecolord";
+            this.themecolord.Size = new System.Drawing.Size(40, 40);
+            this.themecolord.TabIndex = 11;
+            // 
+            // themecolore
+            // 
+            this.themecolore.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolore.Location = new System.Drawing.Point(289, 189);
+            this.themecolore.Name = "themecolore";
+            this.themecolore.Size = new System.Drawing.Size(40, 40);
+            this.themecolore.TabIndex = 15;
+            // 
+            // themecolorf
+            // 
+            this.themecolorf.BackColor = System.Drawing.SystemColors.HotTrack;
+            this.themecolorf.Location = new System.Drawing.Point(339, 189);
+            this.themecolorf.Name = "themecolorf";
+            this.themecolorf.Size = new System.Drawing.Size(40, 40);
+            this.themecolorf.TabIndex = 19;
+            // 
+            // themecolorfg
+            // 
+            this.themecolorfg.AutoSize = true;
+            this.themecolorfg.BackColor = System.Drawing.Color.Transparent;
+            this.themecolorfg.Location = new System.Drawing.Point(190, 18);
+            this.themecolorfg.Name = "themecolorfg";
+            this.themecolorfg.Size = new System.Drawing.Size(66, 13);
+            this.themecolorfg.TabIndex = 21;
+            this.themecolorfg.Text = "Sample Text";
+            // 
+            // themecolortextbg
+            // 
+            this.themecolortextbg.Location = new System.Drawing.Point(180, 15);
+            this.themecolortextbg.Name = "themecolortextbg";
+            this.themecolortextbg.Size = new System.Drawing.Size(208, 223);
+            this.themecolortextbg.TabIndex = 20;
+            // 
+            // importbutton
+            // 
+            this.importbutton.Location = new System.Drawing.Point(90, 220);
+            this.importbutton.Name = "importbutton";
+            this.importbutton.Size = new System.Drawing.Size(60, 23);
+            this.importbutton.TabIndex = 2;
+            this.importbutton.Text = "Import";
+            this.importbutton.UseVisualStyleBackColor = true;
+            this.importbutton.Click += new System.EventHandler(this.importbutton_Click_1);
+            // 
+            // applybutton
+            // 
+            this.applybutton.Location = new System.Drawing.Point(23, 220);
+            this.applybutton.Name = "applybutton";
+            this.applybutton.Size = new System.Drawing.Size(60, 23);
+            this.applybutton.TabIndex = 1;
+            this.applybutton.Text = "Apply";
+            this.applybutton.UseVisualStyleBackColor = true;
+            this.applybutton.Click += new System.EventHandler(this.applybutton_Click_1);
+            // 
+            // themecolorfgmarked
+            // 
+            this.themecolorfgmarked.AutoSize = true;
+            this.themecolorfgmarked.Location = new System.Drawing.Point(313, 18);
+            this.themecolorfgmarked.Name = "themecolorfgmarked";
+            this.themecolorfgmarked.Size = new System.Drawing.Size(67, 13);
+            this.themecolorfgmarked.TabIndex = 22;
+            this.themecolorfgmarked.Text = "Marked Text";
+            // 
+            // XTM
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(397, 248);
+            this.Controls.Add(this.themecolorfgmarked);
+            this.Controls.Add(this.themecolorfg);
+            this.Controls.Add(this.themecolorf);
+            this.Controls.Add(this.themecolor3);
+            this.Controls.Add(this.themecolorb);
+            this.Controls.Add(this.themecolor7);
+            this.Controls.Add(this.themecolore);
+            this.Controls.Add(this.themecolor2);
+            this.Controls.Add(this.themecolora);
+            this.Controls.Add(this.themecolor6);
+            this.Controls.Add(this.themecolord);
+            this.Controls.Add(this.themecolor1);
+            this.Controls.Add(this.themecolor9);
+            this.Controls.Add(this.themecolor5);
+            this.Controls.Add(this.themecolorc);
+            this.Controls.Add(this.themecolor0);
+            this.Controls.Add(this.themecolor8);
+            this.Controls.Add(this.themecolor4);
+            this.Controls.Add(this.importbutton);
+            this.Controls.Add(this.applybutton);
+            this.Controls.Add(this.themelist);
+            this.Controls.Add(this.themecolortextbg);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+            this.Name = "XTM";
+            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
+            this.Text = "XChat Theme Manager";
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.ListBox themelist;
+        private System.Windows.Forms.Label themecolor0;
+        private System.Windows.Forms.Label themecolor1;
+        private System.Windows.Forms.Label themecolor2;
+        private System.Windows.Forms.Label themecolor3;
+        private System.Windows.Forms.Label themecolor4;
+        private System.Windows.Forms.Label themecolor5;
+        private System.Windows.Forms.Label themecolor6;
+        private System.Windows.Forms.Label themecolor7;
+        private System.Windows.Forms.Label themecolor8;
+        private System.Windows.Forms.Label themecolor9;
+        private System.Windows.Forms.Label themecolora;
+        private System.Windows.Forms.Label themecolorb;
+        private System.Windows.Forms.Label themecolorc;
+        private System.Windows.Forms.Label themecolord;
+        private System.Windows.Forms.Label themecolore;
+        private System.Windows.Forms.Label themecolorf;
+        private System.Windows.Forms.Label themecolorfg;
+        private System.Windows.Forms.Label themecolortextbg;
+        private System.Windows.Forms.Button importbutton;
+        private System.Windows.Forms.Button applybutton;
+        private System.Windows.Forms.Label themecolorfgmarked;
+    }
+}
+
diff --git a/src/xtm/Main.cs b/src/xtm/Main.cs
new file mode 100644
index 00000000..e740e994
--- /dev/null
+++ b/src/xtm/Main.cs
@@ -0,0 +1,269 @@
+/* XChat Theme Manager

+ *

+ * Copyright (C) 2012 Patrick Griffs

+ * Copyright (C) 2012 Berke Viktor

+ *

+ * This program is free software; you can redistribute it and/or modify

+ * it under the terms of the GNU General Public License as published by

+ * the Free Software Foundation; either version 2 of the License, or

+ * (at your option) any later version.

+ *

+ * This program is distributed in the hope that it will be useful,

+ * but WITHOUT ANY WARRANTY; without even the implied warranty of

+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

+ * GNU General Public License for more details.

+ *

+ * You should have received a copy of the GNU General Public License

+ * along with this program; if not, write to the Free Software

+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA

+ */

+

+using System;

+using System.Collections.Generic;

+using System.Collections;

+using System.ComponentModel;

+using System.Data;

+using System.Drawing;

+using System.IO;

+/* using System.IO.Compression; */

+using System.IO.Packaging;

+using System.Linq;

+using System.Text;

+using System.Windows.Forms;

+using System.Net;

+

+namespace thememan

+{

+    public partial class XTM : Form

+    {

+        public string appdata = (Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\X-Chat 2\\");

+        public string home = (Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/.xchat2/");

+

+        public string xchatdir;

+        public string themedir = "themes\\";

+

+        OpenFileDialog importDialog;

+

+        public XTM ()

+		{

+			InitializeComponent ();

+            

+			if (File.Exists ("portable-mode"))

+				xchatdir = ("config\\");

+			else if (Directory.Exists (appdata))

+				xchatdir = (appdata);

+			else if (Directory.Exists (home)) {

+				xchatdir = (home); themedir = "themes/";

+			} else

+				Console.WriteLine("Install not found");

+

+            ListThemes();

+        }

+

+        private void ListThemes()

+        {

+            themelist.Items.Clear();

+

+            if (Directory.Exists(xchatdir + themedir))

+            {

+                foreach (string theme in Directory.GetDirectories(xchatdir + themedir))

+                {

+                    themelist.Items.Add(theme.Remove(0, xchatdir.Length + themedir.Length));

+                }

+            }

+            else

+            {

+                Directory.CreateDirectory(xchatdir + themedir);

+            }

+

+            if (themelist.Items.Count == 0)

+            {

+                applybutton.Enabled = false;

+            }

+            else

+            {

+                themelist.SetSelected(0, true);

+            }

+        }

+

+        private void ShowColors(List<List<string>> themecolors)

+        {

+            List<Control> labels = this.Controls.OfType<Label>().Cast<Control>().OrderBy(label => label.Name).ToList();

+            for (byte themecolor = 0; themecolor < themecolors.Count; themecolor++)

+            {

+                byte rval = Convert.ToByte(int.Parse(themecolors[themecolor][0].ToString(), System.Globalization.NumberStyles.HexNumber) / 257);

+                byte gval = Convert.ToByte(int.Parse(themecolors[themecolor][1].ToString(), System.Globalization.NumberStyles.HexNumber) / 257);

+                byte bval = Convert.ToByte(int.Parse(themecolors[themecolor][2].ToString(), System.Globalization.NumberStyles.HexNumber) / 257);

+                

+                if (themecolor <= 15)

+                    labels[themecolor].BackColor = Color.FromArgb(rval, gval, bval);

+                else if (themecolor == 16)

+                    themecolorfgmarked.ForeColor = Color.FromArgb(rval, gval, bval);

+                else if (themecolor == 17)

+                    themecolorfgmarked.BackColor = Color.FromArgb(rval, gval, bval);

+                else if (themecolor == 18)

+                    themecolorfg.ForeColor = Color.FromArgb(rval, gval, bval);

+                else if (themecolor == 19)

+                {

+                    themecolortextbg.BackColor = Color.FromArgb(rval, gval, bval);

+                    themecolorfg.BackColor = themecolortextbg.BackColor;

+                }

+            }

+        }

+

+        private List<List<string>> ReadTheme(string theme)

+        {

+            List<List<string>> themecolors = new List<List<string>>();

+            foreach (string line in File.ReadLines(xchatdir + themedir + theme + "/colors.conf"))

+            {

+                List<string> colors = new List<string>();

+                List<string> colorlist = new List<string>();

+                string[] possiblecolors = { "color_256", "color_257", "color_258", "color_259" };

+

+                for (byte num = 16; num <=31; num++)

+                    colorlist.Add("color_" + num);

+                colorlist.AddRange(possiblecolors);

+

+                string[] config = line.Split(new char[] { ' ' });

+                if(colorlist.Contains(config[0]) == true)

+                {

+                    colors.Add(config[2]);

+                    colors.Add(config[3]);

+                    colors.Add(config[4]);

+                    themecolors.Add(colors);

+                }

+            }

+            return themecolors;

+        }

+

+        private void applybutton_Click_1(object sender, EventArgs e)

+        {

+            DialogResult result = MessageBox.Show("XChat must be closed and this will overwrite your current theme!\n\nDo you wish to continue?", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

+            if (result == DialogResult.OK)

+            {

+                File.Copy(xchatdir + themedir + themelist.SelectedItem.ToString() + "\\colors.conf", xchatdir + "colors.conf", true);

+                if (File.Exists(xchatdir + themedir + themelist.SelectedItem.ToString() + "\\pevents.conf"))

+                {

+                    File.Copy(xchatdir + themedir + themelist.SelectedItem.ToString() + "\\pevents.conf", xchatdir + "pevents.conf", true);

+                }

+            }

+        }

+

+        private void theme_selected(object sender, EventArgs e)

+        {

+            if (themelist.SelectedItem != null)

+            {

+                ShowColors(ReadTheme(themelist.SelectedItem.ToString()));

+                applybutton.Enabled = true;

+            }

+        }

+

+        private void importbutton_Click_1(object sender, EventArgs e)

+        {

+            importDialog = new OpenFileDialog();

+            importDialog.Filter = "XChat Theme Files|*.xct";

+            importDialog.FilterIndex = 1;

+            importDialog.FileOk += new CancelEventHandler(importdialog_FileOk);

+            importDialog.ShowDialog();

+        }

+

+        private void importdialog_FileOk(object sender, System.ComponentModel.CancelEventArgs e)

+        {

+            FileInfo fi = new FileInfo(importDialog.FileName);

+            string newTheme = extractTheme(fi);

+            ListThemes();

+            themelist.SetSelected(themelist.FindStringExact(newTheme), true);

+        }

+

+        /* gzip solution, not good enough coz we need multiple files

+         * 

+        public string extractTheme(FileInfo fi)

+        {

+            using (FileStream inFile = fi.OpenRead())

+            {

+                string themeName = fi.Name.Remove(fi.Name.Length - fi.Extension.Length);

+                string destFolder = xchatdir + themedir + themeName;

+

+                if (!Directory.Exists(destFolder))

+                {

+                    Directory.CreateDirectory(destFolder);

+                }

+

+                using (FileStream outFile = File.Create(destFolder + "\\colors.conf"))

+                {

+                    using (GZipStream Decompress = new GZipStream(inFile, CompressionMode.Decompress))

+                    {

+                        Decompress.CopyTo(outFile);

+                    }

+                }

+                return themeName;

+            }

+        }

+         */

+

+        /* using System.IO.Package:

+         * http://weblogs.asp.net/jgalloway/archive/2007/10/25/creating-zip-archives-in-net-without-an-external-library-like-sharpziplib.aspx

+         * [Content_Types].xml must be present for every zip file

+         */

+

+        private const long BUFFER_SIZE = 4096;

+

+        private string extractTheme(FileInfo zipFile)

+        {

+            string themeName = zipFile.Name.Remove(zipFile.Name.Length - zipFile.Extension.Length);

+            string destFolder = xchatdir + themedir + themeName;

+

+            using (Package zip = Package.Open(zipFile.FullName, FileMode.Open))

+            {

+                PackagePartCollection parts = zip.GetParts();

+

+                if (!Directory.Exists(destFolder))

+                {

+                    Directory.CreateDirectory(destFolder);

+                }

+

+                foreach (PackagePart part in parts)

+                {

+                    /* not sure what's this good for */

+                    /* String archive = part.Uri.ToString().Replace(@"/", @"\"); */

+                    String destFile = destFolder + part.Uri.ToString();

+

+                    using (FileStream outFileStream = new FileStream(destFile, FileMode.CreateNew, FileAccess.ReadWrite))

+                    {

+                        using (Stream inStream = part.GetStream())

+                        {

+                            long bufferSize = inStream.Length < BUFFER_SIZE ? inStream.Length : BUFFER_SIZE;

+                            byte[] buffer = new byte[bufferSize];

+                            int bytesRead = 0;

+                            long bytesWritten = 0;

+

+                            while ((bytesRead = inStream.Read(buffer, 0, buffer.Length)) != 0)

+                            {

+                                outFileStream.Write(buffer, 0, bytesRead);

+                                bytesWritten += bufferSize;

+                            }

+                        }

+                    }

+                }

+            }

+

+            if (IsDirectoryEmpty(destFolder))

+            {

+                Directory.Delete(destFolder);

+                return null;

+            }

+            else

+            {

+                return themeName;

+            }

+        }

+

+        public bool IsDirectoryEmpty(string path)

+        {

+            return !Directory.EnumerateFileSystemEntries(path).Any();

+        }

+

+

+

+    }

+}

diff --git a/src/xtm/Main.resx b/src/xtm/Main.resx
new file mode 100644
index 00000000..6a5fe137
--- /dev/null
+++ b/src/xtm/Main.resx
@@ -0,0 +1,287 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    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">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </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 for serialized 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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <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" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </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>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        AAABAAEAMDAAAAEAIACoJQAAFgAAACgAAAAwAAAAYAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAQAAAAEgAA
+        AAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEgAAABAAAAABAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAA
+        AE0AAACDAAAAiQAAAFsAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAABbAAAAiQAA
+        AIMAAABNAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAGAAAAUgAAAKAAAADwAAAA9gAAAKwAAABdAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAA
+        AF0AAACsAAAA9gAAAPAAAACgAAAAUgAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAYAAABSAAAAoAEBAvQFI5n/BiSZ/wEBA/kAAACsAAAAXQAAAAoAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAKAAAAXQAAAKwBAQP5BhuZ/wUamf8BAQL0AAAAoAAAAFIAAAAGAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAFIAAACgAQEC9AQmmv8AOf//ADj//wcpov8CAgX5AAAArAAA
+        AF0AAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAoAAABdAAAArAICBfkHHqL/ACb//wAl//8EGpr/AQEC9AAAAKAAAABSAAAABgAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAUgAAAKABAQL0BCqa/wA///8APv//AD3//wA8
+        //8ILqr/AgMG+QAAAKwAAABmAAAAFwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAFwAAAGYAAACsAgMG+Qgkqv8AK///ACr//wAp//8AKP//BBya/wEB
+        AvQAAACgAAAAUgAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAABSAAAAoAEBAvQELZr/AET//wBD
+        //8AQ///AEL//wBB//8AQf//BjKy/wIDCPoAAADCAAAAcgAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAcgAAAMICAwj6Biiy/wAw//8AL///AC///wAu
+        //8ALf//AC3//wQemv8BAQL0AAAAoAAAAFIAAAAFAAAAAAAAAAAAAAAAAAAAAAAAADwAAACeAQEC9AQw
+        mv8ASv//AEn//wBI//8AR///AEf//wBG//8ARf//AEX//wU1uv8CBQv9AAAAxQAAAHIAAAAYAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAByAAAAxQIEC/0FLLr/ADb//wA1
+        //8ANP//ADP//wAz//8AMv//ADH//wAx//8EIZr/AQEC9AAAAJ4AAAA8AAAAAAAAAAAAAAAAAAAAAAAA
+        AE8AAADNBR5V/wBP//8ATv//AE7//wBN//8ATP//AEz//wBL//8ASv//AEn//wBJ//8GO8H/AwcP/QAA
+        AMUAAAByAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAHIAAADFAwYP/QYy
+        wf8AO///ADr//wA6//8AOf//ADj//wA4//8AN///ADb//wA1//8ANf//BRZV/wAAAM0AAABPAAAAAAAA
+        AAAAAAAAAAAAAAAAAEIAAACnAQEB+Qg3l/8AU///AFL//wBS//8AUf//AFD//wBQ//8AT///AE7//wBN
+        //8ATf//B0HI/wQIE/0AAADFAAAAcgAAAB8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfAAAAcgAA
+        AMUECBP9BznI/wBB//8AQP//AD///wA+//8APv//AD3//wA8//8APP//ADv//wA6//8IKJf/AQEB+QAA
+        AKcAAABCAAAAAAAAAAAAAAAAAAAAAAAAAAkAAABdAAAArAECA/kJPaL/AFf//wBX//8AVv//AFX//wBU
+        //8AVP//AFP//wBS//8AUv//AFH//wZFz/8DCRf9AAAAzAAAAHsAAAAhAAAAAAAAAAAAAAAAAAAAAAAA
+        ACEAAAB7AAAAzAMJF/0GPs//AEb//wBF//8ARf//AET//wBD//8AQ///AEL//wBB//8AQP//AED//wku
+        ov8BAgP5AAAArAAAAF0AAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAXQAAAKwCAwX5B0Kt/wBb
+        //8AW///AFr//wBZ//8AWP//AFj//wBX//8AVv//AFb//wBV//8ESdb/Awsb/gAAANEAAAB7AAAAIQAA
+        AAAAAAAAAAAAIQAAAHsAAADRAwsb/gRD1v8ATP//AEv//wBK//8ASf//AEn//wBI//8AR///AEf//wBG
+        //8ARf//BzOt/wICBfkAAACsAAAAXQAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAA
+        AF0AAACsAQMH+gRHt/8AX///AF///wBe//8AXf//AFz//wBc//8AW///AFr//wBa//8AWf//BE/c/wUP
+        If4AAADRAAAAewAAACEAAAAhAAAAewAAANEFDiH+BErc/wBR//8AUP//AFD//wBP//8ATv//AE7//wBN
+        //8ATP//AEv//wBL//8EOLf/AQMH+gAAAKwAAABdAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAoAAABjAAAAuAIFCvsGTr7/AGP//wBj//8AYv//AGH//wBh//8AYP//AF///wBe
+        //8AXv//AF3//wVV4f8FEif+AAAA0QAAAH0AAAB9AAAA0QURJ/4FUOH/AFf//wBW//8AVf//AFT//wBU
+        //8AU///AFL//wBS//8AUf//AFD//wY/vv8CBAr7AAAAuAAAAGMAAAAKAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAABAAAACNAAAApQAAAKUAAACrAAAAywAAAOcBAwX+Ah5I/wAmXv8APpz/AGb//wBf
+        7/8ALXL/ACVe/wA8nP8AYv//AGL//wBh//8FWub/BBMq/gAAAOsAAADwAw0e/wVW5v8AVu//AChy/wAg
+        Wv8AIFr/ACBa/wAfWv8BIF7/ADWc/wBW//8AUO//AyFg/wIDBv4BAQHSAAAAaAAAAB8BAQGNAgICpQIC
+        AqUCAgKhAgICYwAAAAAAAAAAAAAADO7u7s7+/v7//v7+//7+/v/+/v7//v7+//7+/v/+/v7//v7+/8DI
+        0/8AP5b/AGbz/8DU8f/+/v7/wMfT/wAucf8AZ///AGf//wBm//8AYPP/wdLv//7+/v/AwcL/ASlq/wBd
+        8//A0vH//v7+//7+/v/+/v7//v7+//7+/v/AxtP/ADaW/wBW8//A0fH//v7+/8TExPoAAAC5AAAAG+3t
+        7c7+/v7//v7+//7+/v/Pz8/sAAAAaQAAAAAAAAAAAAAAFv39/f/9/f3//f39//39/f/9/f3//f39//39
+        /f/9/f3//f39/8DBwv8EW8v/AGbp//39/f/9/f3//f39/wAubf8AbP//AGv//wBr//8AYen//f39//39
+        /f/9/f3/ACxt/wBd6f/9/f3//v7+//7+/v/+/v7//v7+//7+/v/A0vH/AFz0/wNMx//+/v7//v7+//7+
+        /v8AAACXAAAAFv7+/v/+/v7//v7+//7+/v/t7e3OAAAACwAAAAAAAAAAAAAAFvz8/P/8/Pz//Pz8/x4e
+        HqEAAAAWAAAAFgAAABYAAAAmAAAAggAAANIEDhv+BVzF//z8/P/8/Pz//Pz8/wAwbf8Acf//AHD//wBv
+        //8AZen//Pz8//z8/P/8/Pz/AC5t/wBi6f/8/Pz//Pz8//z8/P8TOXD/AF7p/wBe6v8AYfT/BVra/wQN
+        G/79/f3//f39//39/f8AAACSAAAAFv39/f/9/f3//f39/x4eHqEAAAAMAAAAAAAAAAAAAAAAAQEBFvv7
+        +//7+/v/+/v7/wAAAJIAAAAAAAAAAAAAAAAAAAAAAAAAIQAAAHsAAADRBA8b/vv7+//7+/v/+/v7/wAy
+        bf8Adv//AHX//wB0//8Aaen/+/v7//v7+//7+/v/ADBt/wBm6f/7+/v/+/v7//v7+/8ALm3/AGz//wBs
+        //8FYeH/BREh/gAAANj7+/v/+/v7//v7+/8AAABuAAAAFvv7+//7+/v/+/v7/wAAAJIAAAAAAAAAAAAA
+        AAAAAAAAAQEBFvn5+f/5+fn/+fn5/wAAAJkAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACEAAAB7AAAA0vn5
+        +f/5+fn/+fn5/wAwZv8AePv/AHr//wB5//8Aben/+fn5//n5+f/5+fn/ADJt/wBq6f/5+fn/+fn5//n5
+        +f8ALWb/AG/7/wNo6P8FFCj+AAAA0QAAAIj5+fn/+vr6/9fX1+IAAAAMAQEBFvr6+v/6+vr/+vr6/wAA
+        AJkAAAAEAAAAAAAAAAAAAAAAAgICFvb29v/29vb/9vb2/xsbG7MAAAClAAAApQAAAKUAAAClAAAApQAA
+        AKEAAACBAAAAhPb29v/29vb/9vb2/xM4Xv8ALFr/ACxa/wAsWv8TN17/9vb2//b29v/29vb/ADRt/wBv
+        6f/39/f/9/f3//f39/8TNl7/ASdU/wEJEv8AAADxAAAA0RkZGcD39/f/9/f3/xAQEJkAAAABYmJiMff3
+        9//39/f/9/f3/xsbG7MAAAChAAAAYwAAAAAAAAAAAwMDFvLy8v/y8vL/8vLy//Ly8v/y8vL/8vLy//Ly
+        8v/y8vL/8vLy/8bGxuwAAABpAQEBN/Ly8v/y8vL/8vLy//Ly8v/y8vL/8vLy//Ly8v/y8vL/8/Pz//Pz
+        8//z8/P/AEmS/wBz6v/z8/P/8/Pz//Pz8//z8/P/8/Pz//Pz8//z8/P/8/Pz//Pz8//z8/P/8/Pz/wAA
+        AG0CAgIL5OTk0vPz8//z8/P/8/Pz//Pz8//Hx8fsAAAAaQAAAAAAAAAAAgICDN7e3s7s7Oz/7Ozs/+zs
+        7P/s7Oz/7Ozs/+zs7P/s7Oz/7Ozs/9/f384CAgILAwMDG+3t7f/t7e3/7e3t/+3t7f/t7e3/7e3t/+3t
+        7f/t7e3/7e3t/+3t7f+1zub/AH3z/wB98/+1zub/7u7u/+7u7v/u7u7/7u7u/+7u7v/u7u7/7u7u/+7u
+        7v/u7u7/4eHhzgICAgwCAgIL4eHhzu/v7//v7+//7+/v/+/v7//h4eHOAgICCwAAAAAAAAAAAAAAAAMD
+        AwsFBQUVBgYGFgYGBhYGBgYWBgYGFgYGBhYFBQUWBQUFFQMDAwsAAAAGAQEBXuXl5f/l5eX/5eXl/xNb
+        lP8Agur/AIHp/wCA6f8AgOn/AH/p/wB/6v8Ag/T/AIj//wCH//8AgfT/AHvq/wB66f8Beun/BT90/wAA
+        APYAAACqAQEBYwQEBBsEBAQVAwMDCwAAAAAAAAAAAgICDFVVVTro6Oj/6Ojo/yYmJn0CAgIMAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAABSAAAApKmp
+        qf7b29v/qMXZ/wCM8/8Akv//AJL//wCR//8AkP//AI///wCP//8Ajv//AI3//wCN//8AjP//AIv//wCK
+        //8Aiv//AIn//wZIgf8AAQH0AAAAoAAAAFIAAAAGAAAAAAAAAAAAAAAAAAAAAAUFBQzT09PO09PTzgUF
+        BQwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAA
+        AFIAAACgAQEB9AhUhv8Bjev/AJL0/wCX//8Al///AJb//wCW//8Alf//AJT//wCT//8Ak///AJL//wCR
+        //8Akf//AJD//wCP//8Ajv//AI7//wCN//8IUIr/AQEB9AAAAKAAAABSAAAACQAAAAAAAAAAAAAAAAAA
+        AAAFBQULBQUFCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAQAAAAZwAAAKYBAgL0CGCT/wCf//8Anv//AJ3//wCd//8AnP//AJv//wCa//8Amv//AJn//wCY
+        //8AmP//AJf//wCW//8Alf//AJX//wCU//8Ak///AJP//wCS//8Akf//CFeT/wEBAvQAAACmAAAAZwAA
+        ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAABAAAABoAAAAuAECA/sGaJ3/AKT//wCj//8Ao///AKL//wCh//8Aof//AKD//wCf
+        //8Anv//AJ7//wCd//8AnP//AJz//wCb//8Amv//AJn//wCZ//8AmP//AJf//wCX//8Alv//AJX//wZe
+        nf8BAgP7AAAAuAAAAGgAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAGgAAAC4AgQF+wZxpf8Aqv//AKn//wCo//8AqP//AKf//wCm
+        //8Apf//AKX//wCk//8Ao///AKP//wCi//8Aof//AKD//wCg//8An///AJ7//wCe//8Anf//AJz//wCb
+        //8Am///AJr//wCZ//8GZqX/AgQF+wAAALgAAABoAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAaAAAALgCBgj7CHuu/wCv//8Arv//AK7//wCt
+        //8ArP//AKz//wCr//8Aqv//AKn//wCp//8AqP//AKf//wpZhP8KWYT/AKX//wCk//8ApP//AKP//wCi
+        //8Aov//AKH//wCg//8An///AJ///wCe//8Anf//CG6u/wIGCPsAAAC4AAAAaAAAABAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAABuAAAAuQIIC/sIhLf/ALX//wC0
+        //8As///ALL//wCy//8Asf//ALD//wCw//8Ar///AK7//wCu//8Arf//CWOP/wABAfYAAQH2CWKP/wCp
+        //8AqP//AKj//wCn//8Apv//AKb//wCl//8ApP//AKT//wCj//8Aov//AKH//wh2t/8CCAv7AAAAuQAA
+        AG4AAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAHIAAADEAgoN/AaO
+        v/8Auv//ALn//wC5//8AuP//ALf//wC3//8Atv//ALX//wC0//8AtP//ALP//wCy//8FbZr/AQEC9AAA
+        AKEAAAChAQEC9AVqmv8Arf//AK3//wCs//8Aq///AKr//wCq//8Aqf//AKj//wCo//8Ap///AKb//wCl
+        //8Gfr//AgkN/AAAAMQAAAByAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAcgAA
+        AMUDDhH9BJfH/wDA//8Av///AL7//wC+//8Avf//ALz//wC7//8Au///ALr//wC5//8AuP//ALj//wd3
+        pP8BAgP7AAAAqgAAAFYAAABWAAAAqgECA/sHdKT/ALH//wCx//8AsP//AK///wCu//8Arv//AK3//wCs
+        //8ArP//AKv//wCq//8Aqf//BIXH/wMMEf0AAADFAAAAcgAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        ABgAAAByAAAAxQQSFv0GoM3/AMX//wDE//8AxP//AMP//wDC//8Awv//AMH//wDA//8Av///AL///wC+
+        //8Avf//CIGt/wIEBfsAAAC4AAAAZwAAAAsAAAALAAAAZwAAALgCBAX7CH2t/wC1//8Atf//ALT//wCz
+        //8As///ALL//wCx//8AsP//ALD//wCv//8Arv//AK7//waNzf8EEBb9AAAAxQAAAHIAAAAYAAAAAAAA
+        AAAAAAAAAAAAFQAAAHIAAADFBBYa/Qaq0/8Ay///AMr//wDJ//8AyP//AMj//wDH//8Axv//AMb//wDF
+        //8AxP//AMP//wDD//8Hi7b/AgYH+wAAALgAAABoAAAAEAAAAAAAAAAAAAAAEAAAAGgAAAC4AgYH+weG
+        tv8Auf//ALn//wC4//8At///ALf//wC2//8Atf//ALT//wC0//8As///ALL//wCy//8GldP/BBMa/QAA
+        AMUAAAByAAAAFQAAAAAAAAAAAAAASgAAALgDGR79BbPZ/wDQ//8Az///AM///wDO//8Azf//AM3//wDM
+        //8Ay///AMr//wDK//8Ayf//AMj//wSWvv8CCAn8AAAAuAAAAGgAAAAQAAAAAAAAAAAAAAAAAAAAAAAA
+        ABAAAABoAAAAuAIHCfwEj77/AL7//wC9//8AvP//ALv//wC7//8Auv//ALn//wC5//8AuP//ALf//wC2
+        //8Atv//BZzZ/wMWHv0AAAC4AAAASgAAAAAAAAAAAAAATgAAAMUEPEf/AdD4/wDV//8A1P//ANP//wDT
+        //8A0v//ANH//wDR//8A0P//AM///wDO//8Azv//BqHH/wMLDf0AAADCAAAAagAAABAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAQAAAAagAAAMIDCw39BpjH/wDC//8Awf//AMD//wC///8Av///AL7//wC9
+        //8Avf//ALz//wC7//8Auv//AbX4/wQ0R/8AAADFAAAATgAAAAAAAAAAAAAAJAAAAIMAAADcBEFM/wHU
+        +P8A2f//ANj//wDY//8A1///ANb//wDV//8A1f//ANT//wDT//8HrM//BBAT/QAAAMUAAAByAAAAFwAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFwAAAHIAAADFBA8T/Qeiz/8Axv//AMX//wDE
+        //8AxP//AMP//wDC//8Awf//AMH//wDA//8Buvj/BDlM/wAAANwAAACDAAAAJAAAAAAAAAAAAAAAAAAA
+        ACwAAACDAAAA3ARCTP8B2Pj/AN3//wDc//8A3P//ANv//wDa//8A2f//ANn//wW31/8EFBj9AAAAxQAA
+        AHIAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAByAAAAxQQT
+        GP0Fq9f/AMr//wDJ//8AyP//AMj//wDH//8Axv//AMX//wHA+P8EO0z/AAAA3AAAAIMAAAAsAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAsAAAAgwAAANwEQ0z/Adz4/wDh//8A4P//AOD//wDf//8A3v//A8He/wIZ
+        Hf4AAADFAAAAcgAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAYAAAAcgAAAMUCFx3+A7Te/wDO//8Azf//AMz//wDM//8Ay///AcX4/wQ8TP8AAADcAAAAgwAA
+        ACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAIMAAADcBEVM/wHg+P8A5f//AOT//wDk
+        //8EyuP/BB8i/gAAANEAAAB4AAAAGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAGQAAAHgAAADRBB0i/gS84/8A0v//ANH//wDQ//8Byvj/BD5M/wAA
+        ANwAAACDAAAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAACDAAAA3ARF
+        TP8B4vj/AOj//wTT6P8FJSn+AAAA0QAAAHsAAAAhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACEAAAB7AAAA0QUjKf4Ew+j/ANb//wHQ
+        +P8EQEz/AAAA3AAAAIMAAAAsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAsAAAAgwAAANwERUz/BNHm/wUrL/4AAADRAAAAewAAACEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhAAAAewAA
+        ANEFKS/+BMXm/wRBTP8AAADcAAAAgwAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAIMAAADcAgoL/QAAANEAAAB7AAAAIQAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAIQAAAHsAAADRAgkL/QAAANwAAACDAAAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAB/AAAAmwAAAHgAAAAhAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACEAAAB4AAAAmwAAAH8AAAAsAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAIAAA
+        AA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPAAAAIAAAABMAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////8AAP///////wAA/5////n/
+        AAD/D///8P8AAP4H///gfwAA/AP//8A/AAD4Af//gB8AAPAA//8ADwAA4AB//gAHAADgAD/8AAcAAOAA
+        H/gABwAA8AAP8AAPAAD4AAfgAB8AAPwAA8AAPwAA/gABgAB/AADgAAAAAMMAAMAAAAAAgwAAwAAAAACD
+        AADDwAAAAIcAAMPwAAABhwAAw/gAAAGHAADAAAAAAYMAAMAMAAADAwAAwAwAAAMDAAD//AAAP88AAP/4
+        AAAfzwAA//AAAA//AAD/4AAAB/8AAP/AAAAD/wAA/4AAAAH/AAD/AAAAAP8AAP4AAAAAfwAA/AAAAAA/
+        AAD4AAGAAB8AAPAAA8AADwAA4AAH4AAHAADAAA/wAAMAAMAAH/gAAwAAwAA//AADAADgAH/+AAcAAPAA
+        //8ADwAA+AH//4AfAAD8A///wD8AAP4H///gfwAA/w////D/AAD/3///+/8AAP///////wAA////////
+        AAA=
+</value>
+  </data>
+</root>
\ No newline at end of file
diff --git a/src/xtm/Program.cs b/src/xtm/Program.cs
new file mode 100644
index 00000000..c9bb7144
--- /dev/null
+++ b/src/xtm/Program.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+
+namespace thememan
+{
+    static class Program
+    {
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new XTM());
+        }
+    }
+}
diff --git a/src/xtm/Properties/AssemblyInfo.cs b/src/xtm/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..75d92f87
--- /dev/null
+++ b/src/xtm/Properties/AssemblyInfo.cs
@@ -0,0 +1,38 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Resources;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("XChat Theme Manager")]
+[assembly: AssemblyDescription("Manages XChat Themes.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("thememan")]
+[assembly: AssemblyCopyright("Copyright ©  2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("adb04fa6-faee-4dcc-be53-7ba67e74c2a0")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: NeutralResourcesLanguageAttribute("en-US")]
diff --git a/src/xtm/Properties/Resources.Designer.cs b/src/xtm/Properties/Resources.Designer.cs
new file mode 100644
index 00000000..829857ee
--- /dev/null
+++ b/src/xtm/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------

+// <auto-generated>

+//     This code was generated by a tool.

+//     Runtime Version:4.0.30319.17626

+//

+//     Changes to this file may cause incorrect behavior and will be lost if

+//     the code is regenerated.

+// </auto-generated>

+//------------------------------------------------------------------------------

+

+namespace thememan.Properties {

+    using System;

+    

+    

+    /// <summary>

+    ///   A strongly-typed resource class, for looking up localized strings, etc.

+    /// </summary>

+    // This class was auto-generated by the StronglyTypedResourceBuilder

+    // class via a tool like ResGen or Visual Studio.

+    // To add or remove a member, edit your .ResX file then rerun ResGen

+    // with the /str option, or rebuild your VS project.

+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]

+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]

+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]

+    internal class Resources {

+        

+        private static global::System.Resources.ResourceManager resourceMan;

+        

+        private static global::System.Globalization.CultureInfo resourceCulture;

+        

+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]

+        internal Resources() {

+        }

+        

+        /// <summary>

+        ///   Returns the cached ResourceManager instance used by this class.

+        /// </summary>

+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]

+        internal static global::System.Resources.ResourceManager ResourceManager {

+            get {

+                if (object.ReferenceEquals(resourceMan, null)) {

+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("thememan.Properties.Resources", typeof(Resources).Assembly);

+                    resourceMan = temp;

+                }

+                return resourceMan;

+            }

+        }

+        

+        /// <summary>

+        ///   Overrides the current thread's CurrentUICulture property for all

+        ///   resource lookups using this strongly typed resource class.

+        /// </summary>

+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]

+        internal static global::System.Globalization.CultureInfo Culture {

+            get {

+                return resourceCulture;

+            }

+            set {

+                resourceCulture = value;

+            }

+        }

+    }

+}

diff --git a/src/xtm/Properties/Resources.resources b/src/xtm/Properties/Resources.resources
new file mode 100644
index 00000000..6c05a977
--- /dev/null
+++ b/src/xtm/Properties/Resources.resources
Binary files differdiff --git a/src/xtm/Properties/Resources.resx b/src/xtm/Properties/Resources.resx
new file mode 100644
index 00000000..1af7de15
--- /dev/null
+++ b/src/xtm/Properties/Resources.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    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">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </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 for serialized 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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <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" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </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>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
\ No newline at end of file
diff --git a/src/xtm/Properties/Settings.Designer.cs b/src/xtm/Properties/Settings.Designer.cs
new file mode 100644
index 00000000..35939b71
--- /dev/null
+++ b/src/xtm/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------

+// <auto-generated>

+//     This code was generated by a tool.

+//     Runtime Version:4.0.30319.17626

+//

+//     Changes to this file may cause incorrect behavior and will be lost if

+//     the code is regenerated.

+// </auto-generated>

+//------------------------------------------------------------------------------

+

+namespace thememan.Properties {

+    

+    

+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]

+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]

+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {

+        

+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

+        

+        public static Settings Default {

+            get {

+                return defaultInstance;

+            }

+        }

+    }

+}

diff --git a/src/xtm/Properties/Settings.settings b/src/xtm/Properties/Settings.settings
new file mode 100644
index 00000000..39645652
--- /dev/null
+++ b/src/xtm/Properties/Settings.settings
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>
diff --git a/src/xtm/README.md b/src/xtm/README.md
new file mode 100644
index 00000000..7f837263
--- /dev/null
+++ b/src/xtm/README.md
@@ -0,0 +1,7 @@
+xchat-theme-manager
+------------------
+
+- Shows previews of and can load/save themes
+- Will run on windows/linux (still wip)
+
+![XTM Screenshot](http://puu.sh/uoZz)
\ No newline at end of file
diff --git a/src/xtm/Resources/xchat.ico b/src/xtm/Resources/xchat.ico
new file mode 100644
index 00000000..0fd65ef1
--- /dev/null
+++ b/src/xtm/Resources/xchat.ico
Binary files differdiff --git a/src/xtm/app.config b/src/xtm/app.config
new file mode 100644
index 00000000..2f7cce78
--- /dev/null
+++ b/src/xtm/app.config
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup></configuration>
diff --git a/src/xtm/xtm.csproj b/src/xtm/xtm.csproj
new file mode 100644
index 00000000..5acac6de
--- /dev/null
+++ b/src/xtm/xtm.csproj
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="utf-8"?>

+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

+  <PropertyGroup>

+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>

+    <ProductVersion>8.0.30703</ProductVersion>

+    <SchemaVersion>2.0</SchemaVersion>

+    <ProjectGuid>{DE87FFCA-9606-4116-B747-062D88A56A28}</ProjectGuid>

+    <OutputType>WinExe</OutputType>

+    <AppDesignerFolder>Properties</AppDesignerFolder>

+    <RootNamespace>thememan</RootNamespace>

+    <AssemblyName>thememan</AssemblyName>

+    <FileAlignment>512</FileAlignment>

+    <IsWebBootstrapper>false</IsWebBootstrapper>

+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>

+    <TargetFrameworkProfile>Client</TargetFrameworkProfile>

+    <PublishUrl>publish\</PublishUrl>

+    <Install>true</Install>

+    <InstallFrom>Disk</InstallFrom>

+    <UpdateEnabled>false</UpdateEnabled>

+    <UpdateMode>Foreground</UpdateMode>

+    <UpdateInterval>7</UpdateInterval>

+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>

+    <UpdatePeriodically>false</UpdatePeriodically>

+    <UpdateRequired>false</UpdateRequired>

+    <MapFileExtensions>true</MapFileExtensions>

+    <AutorunEnabled>true</AutorunEnabled>

+    <ApplicationRevision>1</ApplicationRevision>

+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>

+    <UseApplicationTrust>false</UseApplicationTrust>

+    <PublishWizardCompleted>true</PublishWizardCompleted>

+    <BootstrapperEnabled>true</BootstrapperEnabled>

+  </PropertyGroup>

+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">

+    <PlatformTarget>x86</PlatformTarget>

+    <DebugType>pdbonly</DebugType>

+    <Optimize>true</Optimize>

+    <OutputPath>..\..\win32\build\Win32\bin\</OutputPath>

+    <DefineConstants>TRACE</DefineConstants>

+    <ErrorReport>prompt</ErrorReport>

+    <WarningLevel>4</WarningLevel>

+    <CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>

+  </PropertyGroup>

+  <PropertyGroup>

+    <ApplicationIcon>Resources\xchat.ico</ApplicationIcon>

+  </PropertyGroup>

+  <PropertyGroup>

+    <ManifestCertificateThumbprint>25412E3EF25458D894050F8209E4D9DCCDF432D7</ManifestCertificateThumbprint>

+  </PropertyGroup>

+  <PropertyGroup>

+    <ManifestKeyFile>xtm_TemporaryKey.pfx</ManifestKeyFile>

+  </PropertyGroup>

+  <PropertyGroup>

+    <GenerateManifests>false</GenerateManifests>

+  </PropertyGroup>

+  <PropertyGroup>

+    <SignManifests>false</SignManifests>

+  </PropertyGroup>

+  <PropertyGroup>

+    <TargetZone>LocalIntranet</TargetZone>

+  </PropertyGroup>

+  <PropertyGroup />

+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">

+    <OutputPath>..\..\win32\build\x64\bin\</OutputPath>

+    <DefineConstants>TRACE</DefineConstants>

+    <Optimize>true</Optimize>

+    <DebugType>pdbonly</DebugType>

+    <PlatformTarget>x64</PlatformTarget>

+    <CodeAnalysisLogFile>bin\Release\thememan.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>

+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>

+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>

+    <ErrorReport>prompt</ErrorReport>

+    <CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>

+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>

+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>

+    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>

+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>

+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>

+    <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>

+  </PropertyGroup>

+  <ItemGroup>

+    <Reference Include="Microsoft.VisualBasic" />

+    <Reference Include="System" />

+    <Reference Include="System.Core" />

+    <Reference Include="System.Xml.Linq" />

+    <Reference Include="System.Data.DataSetExtensions" />

+    <Reference Include="Microsoft.CSharp" />

+    <Reference Include="System.Data" />

+    <Reference Include="System.Deployment" />

+    <Reference Include="System.Drawing" />

+    <Reference Include="System.Windows.Forms" />

+    <Reference Include="System.Xml" />

+    <Reference Include="WindowsBase" />

+  </ItemGroup>

+  <ItemGroup>

+    <Compile Include="Main.cs">

+      <SubType>Form</SubType>

+    </Compile>

+    <Compile Include="Main.Designer.cs">

+      <DependentUpon>Main.cs</DependentUpon>

+    </Compile>

+    <Compile Include="Program.cs" />

+    <Compile Include="Properties\AssemblyInfo.cs" />

+    <EmbeddedResource Include="Main.resx">

+      <DependentUpon>Main.cs</DependentUpon>

+    </EmbeddedResource>

+    <EmbeddedResource Include="Properties\Resources.resx">

+      <Generator>ResXFileCodeGenerator</Generator>

+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>

+      <SubType>Designer</SubType>

+    </EmbeddedResource>

+    <Compile Include="Properties\Resources.Designer.cs">

+      <AutoGen>True</AutoGen>

+      <DependentUpon>Resources.resx</DependentUpon>

+      <DesignTime>True</DesignTime>

+    </Compile>

+    <None Include="app.config">

+      <SubType>Designer</SubType>

+    </None>

+    <None Include="Properties\Settings.settings">

+      <Generator>SettingsSingleFileGenerator</Generator>

+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>

+    </None>

+    <Compile Include="Properties\Settings.Designer.cs">

+      <AutoGen>True</AutoGen>

+      <DependentUpon>Settings.settings</DependentUpon>

+      <DesignTimeSharedInput>True</DesignTimeSharedInput>

+    </Compile>

+  </ItemGroup>

+  <ItemGroup>

+    <Content Include="Resources\xchat.ico" />

+  </ItemGroup>

+  <ItemGroup>

+    <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">

+      <Visible>False</Visible>

+      <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>

+      <Install>true</Install>

+    </BootstrapperPackage>

+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">

+      <Visible>False</Visible>

+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>

+      <Install>false</Install>

+    </BootstrapperPackage>

+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">

+      <Visible>False</Visible>

+      <ProductName>.NET Framework 3.5 SP1</ProductName>

+      <Install>false</Install>

+    </BootstrapperPackage>

+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">

+      <Visible>False</Visible>

+      <ProductName>Windows Installer 3.1</ProductName>

+      <Install>true</Install>

+    </BootstrapperPackage>

+  </ItemGroup>

+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->

+</Project>
\ No newline at end of file
diff --git a/win32/copy/copy.vcxproj b/win32/copy/copy.vcxproj
index a68df4a0..7a3cf9d9 100644
--- a/win32/copy/copy.vcxproj
+++ b/win32/copy/copy.vcxproj
@@ -68,6 +68,7 @@ echo 2&gt; portable-mode
 move portable-mode "$(XChatDest)"

 copy "$(OutDir)\xchat.exe" "$(XChatDest)"

 copy "$(OutDir)\xchat-text.exe" "$(XChatDest)"

+copy "$(OutDir)\thememan.exe" "$(XChatDest)"

 copy "$(DepsRoot)\bin\libatk-1.0-0.dll" "$(XChatDest)"

 copy "$(DepsRoot)\bin\libcairo-2.dll" "$(XChatDest)"

 copy "$(DepsRoot)\bin\libexpat-1.dll" "$(XChatDest)"

@@ -150,6 +151,7 @@ echo 2&gt; portable-mode
 move portable-mode "$(XChatDest)"

 copy "$(OutDir)\xchat.exe" "$(XChatDest)"

 copy "$(OutDir)\xchat-text.exe" "$(XChatDest)"

+copy "$(OutDir)\thememan.exe" "$(XChatDest)"

 copy "$(DepsRoot)\bin\libatk-1.0-0.dll" "$(XChatDest)"

 copy "$(DepsRoot)\bin\libcairo-2.dll" "$(XChatDest)"

 copy "$(DepsRoot)\bin\libexpat-1.dll" "$(XChatDest)"

diff --git a/win32/installer/xchat-wdk-x64.skel.iss b/win32/installer/xchat-wdk-x64.skel.iss
index 915d6607..bff772a7 100644
--- a/win32/installer/xchat-wdk-x64.skel.iss
+++ b/win32/installer/xchat-wdk-x64.skel.iss
@@ -30,6 +30,7 @@ Name: "custom"; Description: "Custom Installation"; Flags: iscustom
 [Components]

 Name: "libs"; Description: "XChat-WDK"; Types: normal full minimal custom; Flags: fixed

 Name: "xctext"; Description: "XChat-Text"; Types: full custom; Flags: disablenouninstallwarning

+Name: "xtm"; Description: "XChat Theme Manager (Requires .NET 4.0)"; Types: full custom; Flags: disablenouninstallwarning

 Name: "translations"; Description: "Translations"; Types: normal full custom; Flags: disablenouninstallwarning

 ;obs Name: "gtkengines"; Description: "GTK+ Engines"; Types: full custom; Flags: disablenouninstallwarning

 ;Name: "spelling"; Description: "Spelling Dictionaries"; Types: full custom; Flags: disablenouninstallwarning

@@ -176,10 +177,12 @@ Source: "plugins\xcperl-514.dll"; DestDir: "{app}\plugins"; DestName: "xcperl.dl
 

 Source: "xchat.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: libs

 Source: "xchat-text.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: xctext

+Source: "thememan.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: xtm

 

 [Icons]

 Name: "{group}\XChat-WDK (x64)"; Filename: "{app}\xchat.exe"; Tasks: not portable

 Name: "{group}\XChat-Text (x64)"; Filename: "{app}\xchat-text.exe"; Components: xctext; Tasks: not portable

+Name: "{group}\XChat Theme Manager (x64)"; Filename: "{app}\thememan.exe"; Components: xtm; Tasks: not portable

 Name: "{group}\Uninstall XChat-WDK (x64)"; Filename: "{uninstallexe}"; Tasks: not portable

 

 [Messages]

diff --git a/win32/installer/xchat-wdk-x86.skel.iss b/win32/installer/xchat-wdk-x86.skel.iss
index 748c2b19..1653e395 100644
--- a/win32/installer/xchat-wdk-x86.skel.iss
+++ b/win32/installer/xchat-wdk-x86.skel.iss
@@ -29,6 +29,7 @@ Name: "custom"; Description: "Custom Installation"; Flags: iscustom
 [Components]

 Name: "libs"; Description: "XChat-WDK"; Types: normal full minimal custom; Flags: fixed

 Name: "xctext"; Description: "XChat-Text"; Types: full custom; Flags: disablenouninstallwarning

+Name: "xtm"; Description: "XChat Theme Manager (Requires .NET 4.0)"; Types: full custom; Flags: disablenouninstallwarning

 Name: "translations"; Description: "Translations"; Types: normal full custom; Flags: disablenouninstallwarning

 ;obs Name: "gtkengines"; Description: "GTK+ Engines"; Types: full custom; Flags: disablenouninstallwarning

 ;Name: "spelling"; Description: "Spelling Dictionaries"; Types: full custom; Flags: disablenouninstallwarning

@@ -179,10 +180,12 @@ Source: "plugins\xcperl-516.dll"; DestDir: "{app}\plugins"; DestName: "xcperl.dl
 

 Source: "xchat.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: libs

 Source: "xchat-text.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: xctext

+Source: "thememan.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: xtm

 

 [Icons]

 Name: "{group}\XChat-WDK (x86)"; Filename: "{app}\xchat.exe"; Tasks: not portable

 Name: "{group}\XChat-Text (x86)"; Filename: "{app}\xchat-text.exe"; Components: xctext; Tasks: not portable

+Name: "{group}\XChat Theme Manager (x86)"; Filename: "{app}\thememan.exe"; Components: xtm; Tasks: not portable

 Name: "{group}\Uninstall XChat-WDK (x86)"; Filename: "{uninstallexe}"; Tasks: not portable

 

 [Messages]

diff --git a/win32/xchat.sln b/win32/xchat.sln
index ef7a3000..42969f38 100644
--- a/win32/xchat.sln
+++ b/win32/xchat.sln
@@ -110,6 +110,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy", "copy\copy.vcxproj",
 		{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE} = {E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE}

 		{18871EBA-AC85-4652-8919-EB8064B9A714} = {18871EBA-AC85-4652-8919-EB8064B9A714}

 		{E4BDB4C8-2335-415A-ACEE-BA88B19BFE82} = {E4BDB4C8-2335-415A-ACEE-BA88B19BFE82}

+		{DE87FFCA-9606-4116-B747-062D88A56A28} = {DE87FFCA-9606-4116-B747-062D88A56A28}

 		{3C4F42FC-292A-420B-B63D-C03DFBDD8E4E} = {3C4F42FC-292A-420B-B63D-C03DFBDD8E4E}

 	EndProjectSection

 EndProject

@@ -118,6 +119,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "installer", "installer\inst
 		{C9B735E4-75BC-45AC-A5E3-39A6D076F912} = {C9B735E4-75BC-45AC-A5E3-39A6D076F912}

 	EndProjectSection

 EndProject

+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "xtm", "..\src\xtm\xtm.csproj", "{DE87FFCA-9606-4116-B747-062D88A56A28}"

+EndProject

 Global

 	GlobalSection(SolutionConfigurationPlatforms) = preSolution

 		Release|Win32 = Release|Win32

@@ -232,6 +235,9 @@ Global
 		{5A0F4962-E670-4DA2-9E45-52CC47F26E2F}.Release|Win32.Build.0 = Release|Win32

 		{5A0F4962-E670-4DA2-9E45-52CC47F26E2F}.Release|x64.ActiveCfg = Release|x64

 		{5A0F4962-E670-4DA2-9E45-52CC47F26E2F}.Release|x64.Build.0 = Release|x64

+		{DE87FFCA-9606-4116-B747-062D88A56A28}.Release|Win32.ActiveCfg = Release|x86

+		{DE87FFCA-9606-4116-B747-062D88A56A28}.Release|x64.ActiveCfg = Release|x64

+		{DE87FFCA-9606-4116-B747-062D88A56A28}.Release|x64.Build.0 = Release|x64

 	EndGlobalSection

 	GlobalSection(SolutionProperties) = preSolution

 		HideSolutionNode = FALSE

@@ -241,6 +247,7 @@ Global
 		{E4BDB4C8-2335-415A-ACEE-BA88B19BFE82} = {AAACEB12-9475-410E-AF5A-FDFF907E9043}

 		{E93E1255-95D1-4B08-8FDF-B53CC6A21280} = {AAACEB12-9475-410E-AF5A-FDFF907E9043}

 		{87554B59-006C-4D94-9714-897B27067BA3} = {AAACEB12-9475-410E-AF5A-FDFF907E9043}

+		{DE87FFCA-9606-4116-B747-062D88A56A28} = {AAACEB12-9475-410E-AF5A-FDFF907E9043}

 		{6CD3647E-4541-4849-9DD7-C8816665AE42} = {BB051F0F-A841-4A9A-BAF6-51DD9866D65A}

 		{98B56DF9-E4F1-4696-A565-5F7823CF214D} = {BB051F0F-A841-4A9A-BAF6-51DD9866D65A}

 		{4980AF24-9D42-427D-A8E6-0DF3B97C455D} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}