From eaff4dbc3ac205f3f2e0c83366f57d93c616977e Mon Sep 17 00:00:00 2001 From: chudov Date: Fri, 26 Jun 2009 08:03:22 +0000 Subject: [PATCH] --- CUEControls/IIconManager.cs | 342 +++++++++++++++++++ CUEControls/Properties/Resources.Designer.cs | 70 ++++ CUEControls/Properties/Resources.resx | 124 +++++++ CUERipper/Resources/accuraterip.bmp | Bin 0 -> 822 bytes CUERipper/Resources/accuraterip_16.bmp | Bin 0 -> 822 bytes CUERipper/app.config | 15 + CUETools/Resources/folder.ico | Bin 0 -> 1150 bytes 7 files changed, 551 insertions(+) create mode 100644 CUEControls/IIconManager.cs create mode 100644 CUEControls/Properties/Resources.Designer.cs create mode 100644 CUEControls/Properties/Resources.resx create mode 100644 CUERipper/Resources/accuraterip.bmp create mode 100644 CUERipper/Resources/accuraterip_16.bmp create mode 100644 CUERipper/app.config create mode 100644 CUETools/Resources/folder.ico diff --git a/CUEControls/IIconManager.cs b/CUEControls/IIconManager.cs new file mode 100644 index 0000000..6c77ba8 --- /dev/null +++ b/CUEControls/IIconManager.cs @@ -0,0 +1,342 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Windows.Forms; +using System.IO; + +namespace CUEControls +{ + public interface IIconManager + { + #region public properties + /// + /// Return the image list that contains the icons found to date. + /// + ImageList ImageList { get; } + #endregion + #region public methods + int GetIconIndex(FileSystemInfo filename, bool open); + + /// + /// Get the icon index associated with a given filename + /// + /// the filename of interest + /// if true, the file is "open", most useful for folders + /// the index into the image list for the icon associated with this file + int GetIconIndex(ExtraSpecialFolder folder, bool open); + void SetExtensionIcon(string extension, Image icon); + void SetExtensionIcon(string extension, Icon icon); + string GetFolderPath(ExtraSpecialFolder folder); + void SetFolderPath(ExtraSpecialFolder folder, string path); + string GetDisplayName(FileSystemInfo filename); + string GetDisplayName(ExtraSpecialFolder folder); + #endregion + } + + // see ShlObj.h + public enum ExtraSpecialFolder + { + // Summary: + // The logical Desktop rather than the physical file system location. + Desktop = 0, + // + // Summary: + // The directory that contains the user's program groups. + Programs = 2, + // + // Summary: + // The "My Documents" folder. + // + // Version 6.0. The virtual folder representing the My Documents + // desktop item. This is equivalent to CSIDL_MYDOCUMENTS. + // Previous to Version 6.0. The file system directory used to + // physically store a user's common repository of documents. + // A typical path is C:\Documents and Settings\username\My Documents. + // This should be distinguished from the virtual My Documents folder + // in the namespace. To access that virtual folder, + // use SHGetFolderLocation, which returns the ITEMIDLIST for the + // virtual location, or refer to the technique described in + // Managing the File System. + MyDocuments = 5, + // + // Summary: + // The directory that serves as a common repository for the user's favorite + // items. + Favorites = 6, + // + // Summary: + // The directory that corresponds to the user's Startup program group. + Startup = 7, + // + // Summary: + // The directory that contains the user's most recently used documents. + Recent = 8, + // + // Summary: + // The directory that contains the Send To menu items. + SendTo = 9, + // + // Summary: + // The directory that contains the Start menu items. + StartMenu = 11, + // + // Summary: + // The "My Music" folder. + MyMusic = 13, + // + // Summary: + // The directory used to physically store file objects on the desktop. + DesktopDirectory = 16, + // + // Summary: + // The "My Computer" folder. + MyComputer = 17, + // + // Summary: + // The directory that serves as a common repository for document templates. + Templates = 21, + // + // Summary: + // The directory that serves as a common repository for application-specific + // data for the current roaming user. + // + // Version 4.71. The file system directory that serves as + // a common repository for application-specific data. + // A typical path is C:\Documents and Settings\username\Application Data. + // This CSIDL is supported by the redistributable Shfolder.dll + // for systems that do not have the Microsoft Internet Explorer 4.0 + // integrated Shell installed + ApplicationData = 26, + // + // Summary: + // The directory that serves as a common repository for application-specific + // data that is used by the current, non-roaming user. + // + // Version 5.0. The file system directory that serves as a data + // repository for local (nonroaming) applications. A typical path + // is C:\Documents and Settings\username\Local Settings\Application Data. + LocalApplicationData = 28, + // + // Summary: + // The directory that serves as a common repository for temporary Internet files. + // + // Version 4.72. The file system directory that serves as + // a common repository for temporary Internet files. A typical + // path is C:\Documents and Settings\username\Local Settings\Temporary Internet Files. + InternetCache = 32, + // + // Summary: + // The directory that serves as a common repository for Internet cookies. + // + // The file system directory that serves as a common repository + // for Internet cookies. A typical path is + // C:\Documents and Settings\username\Cookies. + Cookies = 33, + // + // Summary: + // The directory that serves as a common repository for Internet history items. + History = 34, + // + // Summary: + // The directory that serves as a common repository for application-specific + // data that is used by all users. + // + // Version 5.0. The file system directory containing + // application data for all users. A typical path is + // C:\Documents and Settings\All Users\Application Data. + CommonApplicationData = 35, + + // Summary: + // The Windows directory. + // + // Version 5.0. The Windows directory or SYSROOT. + // This corresponds to the %windir% or %SYSTEMROOT% environment + // variables. A typical path is C:\Windows. + Windows = 0x0024, + + // + // Summary: + // The System directory. + // + // Version 5.0. The Windows System folder. A typical + // path is C:\Windows\System32. + System = 37, + + // + // Summary: + // The program files directory. + // + // Version 5.0. The Program Files folder. A typical + // path is C:\Program Files. + ProgramFiles = 38, + // + // Summary: + // The "My Pictures" folder. + // + // Version 5.0. The file system directory that serves as + // a common repository for image files. A typical path is + // C:\Documents and Settings\username\My Documents\My Pictures. + MyPictures = 39, + // User Profile + Profile = 0x0028, + // + // Summary: + // The directory for components that are shared across applications. + // + // Version 5.0. A folder for components that are shared across + // applications. A typical path is C:\Program Files\Common. + // Valid only for Windows NT, Windows 2000, and Windows XP systems. + // Not valid for Windows Millennium Edition (Windows Me). + CommonProgramFiles = 43, + + // The file system directory that contains documents + // that are common to all users. A typical paths is + // C:\Documents and Settings\All Users\Documents. + // Valid for Windows NT systems and Microsoft Windows 95 and + // Windows 98 systems with Shfolder.dll installed. + CommonDocuments = 0x002e, + + // Version 5.0. The file system directory containing + // administrative tools for all users of the computer. + CommonAdministrativeTools = 0x002f, + + // Version 5.0. The file system directory that is used + // to store administrative tools for an individual user. + // The Microsoft Management Console (MMC) will save customized + // consoles to this directory, and it will roam with the user. + AdministrativeTools = 0x0030, + + // Music common to all users + CommonMusic = 0x0035 + + // Version 5.0. Combine this CSIDL with any of the following CSIDLs + // to force the creation of the associated folder. + // CreateFlag = 0x8000 + } + + public unsafe class MonoIconMgr : IIconManager + { + #region private variables + private ImageList m_image_list; + private IDictionary m_index_map; + private IDictionary m_extension_map; + #endregion + + #region constructor + /// + /// This creates a new shell icon manager. + /// + public MonoIconMgr() + { + m_image_list = new ImageList(); + + m_index_map = new Dictionary(); + m_extension_map = new Dictionary(); + m_image_list.ImageSize = new Size(16, 16); + m_image_list.ColorDepth = ColorDepth.Depth32Bit; + m_image_list.Images.Add(Properties.Resources.folder); + } + #endregion + + #region public properties + /// + /// Return the image list that contains the icons found to date. + /// + public ImageList ImageList + { + get + { + return m_image_list; + } + } + #endregion + + #region public methods + /// + /// Get the icon index associated with a given filename + /// + /// the filename of interest + /// if true, the file is "open", most useful for folders + /// the index into the image list for the icon associated with this file + public int GetIconIndex(FileSystemInfo filename, bool open) + { + int iIcon; + if (filename is FileInfo && m_extension_map.TryGetValue(filename.Extension.ToLower(), out iIcon)) + return iIcon; + //iIcon = MapIcon(System.Drawing.SystemIcons.Application, info.iIcon); + //DestroyIcon(info.hIcon); + return 0; + } + + /// + /// Get the icon index associated with a given filename + /// + /// the filename of interest + /// if true, the file is "open", most useful for folders + /// the index into the image list for the icon associated with this file + public int GetIconIndex(ExtraSpecialFolder folder, bool open) + { + return 0; + } + #endregion + + #region private methods + + //private int MapIcon(IntPtr hIcon, int iIcon) + //{ + // int index = 0; + // if (!m_index_map.TryGetValue(iIcon, out index)) + // { + // m_image_list.Images.Add(Icon.FromHandle(hIcon)); + // index = m_image_list.Images.Count - 1; + // m_index_map.Add(iIcon, index); + // } + // return index; + //} + + public void SetExtensionIcon(string extension, Image icon) + { + m_image_list.Images.Add(extension, icon); + m_extension_map.Add(extension, m_image_list.Images.Count - 1); + } + + public void SetExtensionIcon(string extension, Icon icon) + { + m_image_list.Images.Add(extension, icon); + m_extension_map.Add(extension, m_image_list.Images.Count - 1); + } + + public string GetFolderPath(ExtraSpecialFolder folder) + { + switch (folder) + { + case ExtraSpecialFolder.MyComputer: + return "/"; + } + return Environment.GetFolderPath((Environment.SpecialFolder)folder); + } + + public void SetFolderPath(ExtraSpecialFolder folder, string path) + { + throw new Exception("SetFolderPath not supported"); + } + + public string GetDisplayName(FileSystemInfo filename) + { + return filename.Name; + } + + public string GetDisplayName(ExtraSpecialFolder folder) + { + switch (folder) + { + case ExtraSpecialFolder.MyComputer: + return "/"; + } + return Path.GetFileName(Environment.GetFolderPath((Environment.SpecialFolder) folder)); + } + #endregion + } +} diff --git a/CUEControls/Properties/Resources.Designer.cs b/CUEControls/Properties/Resources.Designer.cs new file mode 100644 index 0000000..c356b83 --- /dev/null +++ b/CUEControls/Properties/Resources.Designer.cs @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.1434 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CUEControls.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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", "2.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() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [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("CUEControls.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Icon folder { + get { + object obj = ResourceManager.GetObject("folder", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + } +} diff --git a/CUEControls/Properties/Resources.resx b/CUEControls/Properties/Resources.resx new file mode 100644 index 0000000..fa9cc89 --- /dev/null +++ b/CUEControls/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\folder.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/CUERipper/Resources/accuraterip.bmp b/CUERipper/Resources/accuraterip.bmp new file mode 100644 index 0000000000000000000000000000000000000000..104e197a1291899453aeb43e91a01a132db6c524 GIT binary patch literal 822 zcmZ?rHDhJ~12YB&1`P%V1_3B$WRL)hGeG4b90>XU|Nk93b}U}JxWB)@t+lhEsi~@= zzM`(Ry1Ko-uA!;1wxzMQt+}^MBdt|I@Gj?Z5N4=l=i8-~Vr1wR}or%c`E~ z7nkhck-z-v-V*^9AD=$myKmRWr%yk9dH3b#lY76PT=@Or@SopXe*atb``?D{!sG2J z=h~C*bfms$E&o{8@#nzlXZP;kx_$lkhZny;Kl}XS<&F0bFMN4-^6R%f-~Jq$GvQoQ z&c(*0XEm`OO0s@r*E~(C{eSSx-}5Ja9^LW($@M>HClW|Nq}; zo$@@l{!3EHkJyxd=?VXeQvWxX{hrzQf7PV_+h_efwBqBL9k1_Rd~oaX|NsAg{r?M! zxUHu?CN%s{D*2zE{-ZqRe_PuB=|%sRHT_%H`Df>h-$z#dd~gAz3<-Zi$b{~N9d E0KsZW^#A|> literal 0 HcmV?d00001 diff --git a/CUERipper/Resources/accuraterip_16.bmp b/CUERipper/Resources/accuraterip_16.bmp new file mode 100644 index 0000000000000000000000000000000000000000..104e197a1291899453aeb43e91a01a132db6c524 GIT binary patch literal 822 zcmZ?rHDhJ~12YB&1`P%V1_3B$WRL)hGeG4b90>XU|Nk93b}U}JxWB)@t+lhEsi~@= zzM`(Ry1Ko-uA!;1wxzMQt+}^MBdt|I@Gj?Z5N4=l=i8-~Vr1wR}or%c`E~ z7nkhck-z-v-V*^9AD=$myKmRWr%yk9dH3b#lY76PT=@Or@SopXe*atb``?D{!sG2J z=h~C*bfms$E&o{8@#nzlXZP;kx_$lkhZny;Kl}XS<&F0bFMN4-^6R%f-~Jq$GvQoQ z&c(*0XEm`OO0s@r*E~(C{eSSx-}5Ja9^LW($@M>HClW|Nq}; zo$@@l{!3EHkJyxd=?VXeQvWxX{hrzQf7PV_+h_efwBqBL9k1_Rd~oaX|NsAg{r?M! zxUHu?CN%s{D*2zE{-ZqRe_PuB=|%sRHT_%H`Df>h-$z#dd~gAz3<-Zi$b{~N9d E0KsZW^#A|> literal 0 HcmV?d00001 diff --git a/CUERipper/app.config b/CUERipper/app.config new file mode 100644 index 0000000..1246c46 --- /dev/null +++ b/CUERipper/app.config @@ -0,0 +1,15 @@ + + + + +
+ + + + + + freedb.org + + + + \ No newline at end of file diff --git a/CUETools/Resources/folder.ico b/CUETools/Resources/folder.ico new file mode 100644 index 0000000000000000000000000000000000000000..ce3c32ee46074387ab83905dc625a4652c2a9355 GIT binary patch literal 1150 zcmZQzU}Ruq5D);-3Je)63=Con3=A3!3=9Gc3=9ek5OD?u1_lQf5IOj;PTP$F-Hsc} zblY#d((SnM9WQPN%YW2qyD=H&6XU*{&+dHq^v{?9!B@&BP$KmHl_-TVO4Z#w1H_xHd4{a^U<=l_XMfBbKJ z`2By;y>I`MZ+-nAa{bGH_sgIETVD9|U+?V4|7xc{{6F>S_kWNcn0~Waw|;#3_4ohg zx4-@`dHM7I)Mr2bw?6v*zwF+(|EagX{tv(Y<-g~Z&;PA2e)?~4?&JS6ApJ9LeTVB` zc;|93zB{=eqIxBoeJzWtBA`Srj5wJ-l&E`R=i z;q#yWrt=Z{&6nN!_3!`x|3Ciz|Nrgp|NmeA{Qv*?&%ggSzWw<>1>}~;-~X50|MoxQ z_SgS0H@^J8{^ieq(@r)8&~LWt)~AoZ{{EkG@9Y1`cfR~@y!z>X)~UDub56hd-+KA| z|AtHN|5sgj|G(_~yZ=S!-~E62{r7*9b+#aal=O>`+xoY|I=*!tt&A7W}9#Q`1=pyu7Cgj|Nr~%KiG}0zW@H8ef-JK z?BkDrz;NZ+XWvUsJ$-1j@n#rIzsZ)H7vc^*{FQL{5gf-Ke)P*`+wHqLn{J5dY`VdZ jf;Zpb*V%kykme?suZW}n|7TzT;RZ$q24XQtJq!Z?bDaB0 literal 0 HcmV?d00001