diff --git a/Plugins/Wox.Plugin.Clipboard/ClipboardMonitor.cs b/Plugins/Wox.Plugin.Clipboard/ClipboardMonitor.cs deleted file mode 100644 index b561586531..0000000000 --- a/Plugins/Wox.Plugin.Clipboard/ClipboardMonitor.cs +++ /dev/null @@ -1,234 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Threading; -using System.Windows.Forms; - -namespace Wox.Plugin.Clipboard -{ - public static class ClipboardMonitor - { - public delegate void OnClipboardChangeEventHandler(ClipboardFormat format, object data); - public static event OnClipboardChangeEventHandler OnClipboardChange; - - public static void Start() - { - ClipboardWatcher.Start(); - ClipboardWatcher.OnClipboardChange += (ClipboardFormat format, object data) => - { - if (OnClipboardChange != null) - OnClipboardChange(format, data); - }; - } - - public static void Stop() - { - OnClipboardChange = null; - ClipboardWatcher.Stop(); - } - - class ClipboardWatcher : Form - { - // static instance of this form - private static ClipboardWatcher mInstance; - - // needed to dispose this form - static IntPtr nextClipboardViewer; - - public delegate void OnClipboardChangeEventHandler(ClipboardFormat format, object data); - public static event OnClipboardChangeEventHandler OnClipboardChange; - - // start listening - public static void Start() - { - // we can only have one instance if this class - if (mInstance != null) - return; - - Thread t = new Thread(new ParameterizedThreadStart(x => - { - Application.Run(new ClipboardWatcher()); - })); - t.SetApartmentState(ApartmentState.STA); // give the [STAThread] attribute - t.Start(); - } - - // stop listening (dispose form) - public static void Stop() - { - mInstance.Invoke(new MethodInvoker(() => - { - ChangeClipboardChain(mInstance.Handle, nextClipboardViewer); - })); - mInstance.Invoke(new MethodInvoker(mInstance.Close)); - - mInstance.Dispose(); - - mInstance = null; - } - - // on load: (hide this window) - protected override void SetVisibleCore(bool value) - { - CreateHandle(); - - mInstance = this; - - nextClipboardViewer = SetClipboardViewer(mInstance.Handle); - - base.SetVisibleCore(false); - } - - [DllImport("User32.dll", CharSet = CharSet.Auto)] - public static extern IntPtr SetClipboardViewer(IntPtr hWndNewViewer); - - [DllImport("User32.dll", CharSet = CharSet.Auto)] - public static extern bool ChangeClipboardChain(IntPtr hWndRemove, IntPtr hWndNewNext); - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - public static extern int SendMessage(IntPtr hwnd, int wMsg, IntPtr wParam, IntPtr lParam); - - // defined in winuser.h - const int WM_DRAWCLIPBOARD = 0x308; - const int WM_CHANGECBCHAIN = 0x030D; - - protected override void WndProc(ref Message m) - { - switch (m.Msg) - { - case WM_DRAWCLIPBOARD: - ClipChanged(); - SendMessage(nextClipboardViewer, m.Msg, m.WParam, m.LParam); - break; - - case WM_CHANGECBCHAIN: - if (m.WParam == nextClipboardViewer) - nextClipboardViewer = m.LParam; - else - SendMessage(nextClipboardViewer, m.Msg, m.WParam, m.LParam); - break; - - default: - base.WndProc(ref m); - break; - } - } - - static readonly string[] formats = Enum.GetNames(typeof(ClipboardFormat)); - - private void ClipChanged() - { - IDataObject iData = System.Windows.Forms.Clipboard.GetDataObject(); - - ClipboardFormat? format = null; - - foreach (var f in formats) - { - if (iData.GetDataPresent(f)) - { - format = (ClipboardFormat)Enum.Parse(typeof(ClipboardFormat), f); - break; - } - } - - object data = iData.GetData(format.ToString()); - - if (data == null || format == null) - return; - - if (OnClipboardChange != null) - OnClipboardChange((ClipboardFormat)format, data); - } - - - } - } - - public enum ClipboardFormat : byte - { - /// Specifies the standard ANSI text format. This static field is read-only. - /// - /// 1 - Text, - /// Specifies the standard Windows Unicode text format. This static field - /// is read-only. - /// 1 - UnicodeText, - /// Specifies the Windows device-independent bitmap (DIB) format. This static - /// field is read-only. - /// 1 - Dib, - /// Specifies a Windows bitmap format. This static field is read-only. - /// 1 - Bitmap, - /// Specifies the Windows enhanced metafile format. This static field is - /// read-only. - /// 1 - EnhancedMetafile, - /// Specifies the Windows metafile format, which Windows Forms does not - /// directly use. This static field is read-only. - /// 1 - MetafilePict, - /// Specifies the Windows symbolic link format, which Windows Forms does - /// not directly use. This static field is read-only. - /// 1 - SymbolicLink, - /// Specifies the Windows Data Interchange Format (DIF), which Windows Forms - /// does not directly use. This static field is read-only. - /// 1 - Dif, - /// Specifies the Tagged Image File Format (TIFF), which Windows Forms does - /// not directly use. This static field is read-only. - /// 1 - Tiff, - /// Specifies the standard Windows original equipment manufacturer (OEM) - /// text format. This static field is read-only. - /// 1 - OemText, - /// Specifies the Windows palette format. This static field is read-only. - /// - /// 1 - Palette, - /// Specifies the Windows pen data format, which consists of pen strokes - /// for handwriting software, Windows Forms does not use this format. This static - /// field is read-only. - /// 1 - PenData, - /// Specifies the Resource Interchange File Format (RIFF) audio format, - /// which Windows Forms does not directly use. This static field is read-only. - /// 1 - Riff, - /// Specifies the wave audio format, which Windows Forms does not directly - /// use. This static field is read-only. - /// 1 - WaveAudio, - /// Specifies the Windows file drop format, which Windows Forms does not - /// directly use. This static field is read-only. - /// 1 - FileDrop, - /// Specifies the Windows culture format, which Windows Forms does not directly - /// use. This static field is read-only. - /// 1 - Locale, - /// Specifies text consisting of HTML data. This static field is read-only. - /// - /// 1 - Html, - /// Specifies text consisting of Rich Text Format (RTF) data. This static - /// field is read-only. - /// 1 - Rtf, - /// Specifies a comma-separated value (CSV) format, which is a common interchange - /// format used by spreadsheets. This format is not used directly by Windows Forms. - /// This static field is read-only. - /// 1 - CommaSeparatedValue, - /// Specifies the Windows Forms string class format, which Windows Forms - /// uses to store string objects. This static field is read-only. - /// 1 - StringFormat, - /// Specifies a format that encapsulates any type of Windows Forms object. - /// This static field is read-only. - /// 1 - Serializable, - } -} \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Clipboard/Images/clipboard.png b/Plugins/Wox.Plugin.Clipboard/Images/clipboard.png deleted file mode 100644 index 78afddcd9e..0000000000 Binary files a/Plugins/Wox.Plugin.Clipboard/Images/clipboard.png and /dev/null differ diff --git a/Plugins/Wox.Plugin.Clipboard/Main.cs b/Plugins/Wox.Plugin.Clipboard/Main.cs deleted file mode 100644 index dafa8a1bc0..0000000000 --- a/Plugins/Wox.Plugin.Clipboard/Main.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Windows.Forms; -using WindowsInput; -using WindowsInput.Native; - -namespace Wox.Plugin.Clipboard -{ - public class Main : IPlugin - { - private const int MaxDataCount = 100; - private readonly KeyboardSimulator keyboardSimulator = new KeyboardSimulator(new InputSimulator()); - private PluginInitContext context; - List dataList = new List(); - - public List Query(Query query) - { - var results = new List(); - List displayData = new List(); - if (query.ActionParameters.Count == 0) - { - displayData = dataList; - } - else - { - displayData = dataList.Where(i => i.ToLower().Contains(query.GetAllRemainingParameter().ToLower())) - .ToList(); - } - - results.AddRange(displayData.Select(o => new Result - { - Title = o, - IcoPath = "Images\\clipboard.png", - Action = c => - { - if (c.SpecialKeyState.CtrlPressed) - { - context.ShowCurrentResultItemTooltip(o); - return false; - } - else - { - System.Windows.Forms.Clipboard.SetText(o); - context.HideApp(); - keyboardSimulator.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_V); - return true; - } - } - }).Reverse()); - return results; - } - - public void Init(PluginInitContext context) - { - this.context = context; - ClipboardMonitor.OnClipboardChange += ClipboardMonitor_OnClipboardChange; - ClipboardMonitor.Start(); - } - - void ClipboardMonitor_OnClipboardChange(ClipboardFormat format, object data) - { - if (format == ClipboardFormat.Html || - format == ClipboardFormat.SymbolicLink || - format == ClipboardFormat.Text || - format == ClipboardFormat.UnicodeText) - { - if (data != null && !string.IsNullOrEmpty(data.ToString())) - { - if (dataList.Contains(data.ToString())) - { - dataList.Remove(data.ToString()); - } - dataList.Add(data.ToString()); - - if (dataList.Count > MaxDataCount) - { - dataList.Remove(dataList.First()); - } - } - } - } - } -} diff --git a/Plugins/Wox.Plugin.Clipboard/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Clipboard/Properties/AssemblyInfo.cs deleted file mode 100644 index 87df553b6e..0000000000 --- a/Plugins/Wox.Plugin.Clipboard/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 -[assembly: AssemblyTitle("Wox.Plugin.DotnetPluginTest")] -[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.DotnetPluginTest")] -[assembly: AssemblyCopyright("The MIT License (MIT)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("62685493-1710-4c1d-a179-cf466a44f45e")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Plugins/Wox.Plugin.Clipboard/Wox.Plugin.Clipboard.csproj b/Plugins/Wox.Plugin.Clipboard/Wox.Plugin.Clipboard.csproj deleted file mode 100644 index 6b379bdd95..0000000000 --- a/Plugins/Wox.Plugin.Clipboard/Wox.Plugin.Clipboard.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - - Debug - AnyCPU - {8C14DC11-2737-4DCB-A121-5D7BDD57FEA2} - Library - Properties - Wox.Plugin.Clipboard - Wox.Plugin.Clipboard - v3.5 - 512 - ..\..\ - true - - - true - full - false - ..\..\Output\Debug\Plugins\Wox.Plugin.Clipboard\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - ..\..\Output\Release\Plugins\Wox.Plugin.Clipboard\ - TRACE - prompt - 4 - - - - - - - - - - - ..\..\packages\InputSimulator.1.0.4.0\lib\net20\WindowsInput.dll - - - - - - - - - - {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} - Wox.Plugin - - - - - - PreserveNewest - - - - - PreserveNewest - - - - - - - - - - - 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 - - - - - \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Clipboard/packages.config b/Plugins/Wox.Plugin.Clipboard/packages.config deleted file mode 100644 index e0d9b88d27..0000000000 --- a/Plugins/Wox.Plugin.Clipboard/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Clipboard/plugin.json b/Plugins/Wox.Plugin.Clipboard/plugin.json deleted file mode 100644 index 112bbf34a3..0000000000 --- a/Plugins/Wox.Plugin.Clipboard/plugin.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "ID":"D2D2C23B084D411DB66FE0C79D6C2A6C", - "ActionKeyword":"cb", - "Name":"Wox.Plugin.Clipboard", - "Description":"clipboard history search", - "Author":"qianlifeng", - "Version":"1.0", - "Language":"csharp", - "Website":"http://www.getwox.com", - "ExecuteFileName":"Wox.Plugin.Clipboard.dll" -} \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Doc/Doc.cs b/Plugins/Wox.Plugin.Doc/Doc.cs deleted file mode 100644 index 655d6e8f05..0000000000 --- a/Plugins/Wox.Plugin.Doc/Doc.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Wox.Plugin.Doc -{ - public class Doc - { - public string DBPath { get; set; } - public string DBType { get; set; } - public string Name { get; set; } - public string IconPath { get; set; } - } -} \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Doc/DocViewFrm.Designer.cs b/Plugins/Wox.Plugin.Doc/DocViewFrm.Designer.cs deleted file mode 100644 index db273fb300..0000000000 --- a/Plugins/Wox.Plugin.Doc/DocViewFrm.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -namespace Wox.Plugin.Doc -{ - partial class DocViewFrm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.webBrowser1 = new System.Windows.Forms.WebBrowser(); - this.SuspendLayout(); - // - // webBrowser1 - // - this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill; - this.webBrowser1.Location = new System.Drawing.Point(0, 0); - this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); - this.webBrowser1.Name = "webBrowser1"; - this.webBrowser1.ScriptErrorsSuppressed = true; - this.webBrowser1.Size = new System.Drawing.Size(926, 611); - this.webBrowser1.TabIndex = 0; - // - // DocViewFrm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(926, 611); - this.Controls.Add(this.webBrowser1); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "DocViewFrm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "DocViewer"; - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.WebBrowser webBrowser1; - } -} \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Doc/DocViewFrm.cs b/Plugins/Wox.Plugin.Doc/DocViewFrm.cs deleted file mode 100644 index b59d1ae356..0000000000 --- a/Plugins/Wox.Plugin.Doc/DocViewFrm.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Text; -using System.Windows.Forms; - -namespace Wox.Plugin.Doc -{ - public partial class DocViewFrm : Form - { - public DocViewFrm() - { - InitializeComponent(); - FormClosing+=DocViewFrm_FormClosing; - } - - private void DocViewFrm_FormClosing(object sender, FormClosingEventArgs e) - { - e.Cancel = true; - Hide(); - } - - public void ShowDoc(string path) - { - //string html = File.ReadAllText(path); - //webBrowser1.DocumentText = html; - webBrowser1.Url = new Uri(String.Format("file:///{0}", path)); - Show(); - } - } -} diff --git a/Plugins/Wox.Plugin.Doc/DocViewFrm.resx b/Plugins/Wox.Plugin.Doc/DocViewFrm.resx deleted file mode 100644 index 7080a7d118..0000000000 --- a/Plugins/Wox.Plugin.Doc/DocViewFrm.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Doc/Main.cs b/Plugins/Wox.Plugin.Doc/Main.cs deleted file mode 100644 index 7dec42fab6..0000000000 --- a/Plugins/Wox.Plugin.Doc/Main.cs +++ /dev/null @@ -1,178 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.SQLite; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Text; -using System.Web; -using Microsoft.Win32; - -namespace Wox.Plugin.Doc -{ - public class Main : IPlugin - { - private List docs = new List(); - DocViewFrm frm = new DocViewFrm(); - private string docsetBasePath; - - public List Query(Query query) - { - List results = new List(); - if (query.ActionParameters.Count == 0) - { - results.AddRange(docs.Select(o => new Result() - { - Title = o.Name.Replace(".docset", "").Replace(" ",""), - IcoPath = o.IconPath - }).ToList()); - return results; - } - - if (query.ActionParameters.Count >= 2) - { - Doc firstOrDefault = docs.FirstOrDefault(o => o.Name.Replace(".docset", "").Replace(" ","").ToLower() == query.ActionParameters[0]); - if (firstOrDefault != null) - { - results.AddRange(QuerySqllite(firstOrDefault, query.ActionParameters[1])); - } - } - else - { - foreach (Doc doc in docs) - { - results.AddRange(QuerySqllite(doc, query.ActionParameters[0])); - } - } - - - return results; - } - - public void Init(PluginInitContext context) - { - docsetBasePath = Path.Combine(context.CurrentPluginMetadata.PluginDirecotry, @"Docset"); - if (!Directory.Exists(docsetBasePath)) - Directory.CreateDirectory(docsetBasePath); - - foreach (string path in Directory.GetDirectories(docsetBasePath)) - { - string name = path.Substring(path.LastIndexOf('\\') + 1); - string dbPath = path + @"\Contents\Resources\docSet.dsidx"; - string dbType = CheckTableExists("searchIndex", dbPath) ? "DASH" : "ZDASH"; - docs.Add(new Doc - { - Name = name, - DBPath = dbPath, - DBType = dbType, - IconPath = TryGetIcon(name, path) - }); - } - } - - private string TryGetIcon(string name, string path) - { - string url = "https://raw.github.com/jkozera/zeal/master/zeal/icons/" + - name.Replace(".docset", "").Replace(" ", "_") + ".png"; - string imagePath = path + "\\icon.png"; - if (!File.Exists(imagePath)) - { - HttpWebRequest lxRequest = (HttpWebRequest)WebRequest.Create(url); - // returned values are returned as a stream, then read into a string - String lsResponse = string.Empty; - using (HttpWebResponse lxResponse = (HttpWebResponse)lxRequest.GetResponse()) - { - using (BinaryReader reader = new BinaryReader(lxResponse.GetResponseStream())) - { - Byte[] lnByte = reader.ReadBytes(1 * 1024 * 1024 * 10); - using (FileStream lxFS = new FileStream(imagePath, FileMode.Create)) - { - lxFS.Write(lnByte, 0, lnByte.Length); - } - } - } - } - return imagePath; - } - - private List QuerySqllite(Doc doc, string key) - { - string dbPath = "Data Source =" + doc.DBPath; - SQLiteConnection conn = new SQLiteConnection(dbPath); - conn.Open(); - string sql = GetSqlByDocDBType(doc.DBType).Replace("{0}", key); - SQLiteCommand cmdQ = new SQLiteCommand(sql, conn); - SQLiteDataReader reader = cmdQ.ExecuteReader(); - - List results = new List(); - while (reader.Read()) - { - string name = reader.GetString(reader.GetOrdinal("name")); - string docPath = reader.GetString(reader.GetOrdinal("path")); - - results.Add(new Result - { - Title = name, - SubTitle = doc.Name.Replace(".docset", ""), - IcoPath = doc.IconPath, - Action = (c) => - { - string url = string.Format(@"{0}\{1}\Contents\Resources\Documents\{2}#{3}", docsetBasePath, - doc.Name, docPath, name); - - //frm.ShowDoc(url); - string browser = GetDefaultBrowserPath(); - Process.Start(browser, String.Format("\"file:///{0}\"", url)); - return true; - } - }); - } - - conn.Close(); - - return results; - } - - private static string GetDefaultBrowserPath() - { - string key = @"HTTP\shell\open\command"; - using (RegistryKey registrykey = Registry.ClassesRoot.OpenSubKey(key, false)) - { - if (registrykey != null) return ((string)registrykey.GetValue(null, null)).Split('"')[1]; - } - return null; - } - - private string GetSqlByDocDBType(string type) - { - string sql = string.Empty; - if (type == "DASH") - { - sql = "select * from searchIndex where name like '%{0}%' order by name asc, path asc limit 30"; - } - if (type == "ZDASH") - { - sql = @"select ztokenname as name, zpath as path from ztoken -join ztokenmetainformation on ztoken.zmetainformation = ztokenmetainformation.z_pk -join zfilepath on ztokenmetainformation.zfile = zfilepath.z_pk -where (ztokenname like '%{0}%') order by lower(ztokenname) asc, zpath asc limit 30"; - } - - return sql; - } - - private bool CheckTableExists(string table, string path) - { - string dbPath = "Data Source =" + path; - SQLiteConnection conn = new SQLiteConnection(dbPath); - conn.Open(); - string sql = "SELECT name FROM sqlite_master WHERE type='table' AND name='" + table + "';"; - SQLiteCommand cmdQ = new SQLiteCommand(sql, conn); - object obj = cmdQ.ExecuteScalar(); - conn.Close(); - return obj != null; - } - } -} diff --git a/Plugins/Wox.Plugin.Doc/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Doc/Properties/AssemblyInfo.cs deleted file mode 100644 index 260c234499..0000000000 --- a/Plugins/Wox.Plugin.Doc/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// 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("Wox.Plugin.Doc")] -[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.Doc")] -[assembly: AssemblyCopyright("The MIT License (MIT)")] -[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("e0efc3c8-af56-47c0-adb0-3967635b5394")] - -// 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")] diff --git a/Plugins/Wox.Plugin.Doc/README.md b/Plugins/Wox.Plugin.Doc/README.md deleted file mode 100644 index fa721944c3..0000000000 --- a/Plugins/Wox.Plugin.Doc/README.md +++ /dev/null @@ -1,5 +0,0 @@ -How to use? - -1. Docset download link:[http://kapeli.com/docset_links](http://kapeli.com/docset_links) -2. Unzip doc zip into "Plugins\Doc\Docset\{docname}" -3. Restart Wox \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Doc/Wox.Plugin.Doc.csproj b/Plugins/Wox.Plugin.Doc/Wox.Plugin.Doc.csproj deleted file mode 100644 index fc6ef0ed57..0000000000 --- a/Plugins/Wox.Plugin.Doc/Wox.Plugin.Doc.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - - Debug - AnyCPU - {6B6696B1-A547-4FD4-85EF-E1FD0F54AD2C} - Library - Properties - Wox.Plugin.Doc - Wox.Plugin.Doc - v3.5 - 512 - ..\..\ - true - - - true - full - false - ..\..\Output\Debug\Plugins\Wox.Plugin.Doc\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - ..\..\Output\Release\Plugins\Wox.Plugin.Doc\ - TRACE - prompt - 4 - - - - - - False - ..\..\packages\System.Data.SQLite.x64.1.0.90.0\lib\net20\System.Data.SQLite.dll - - - False - ..\..\packages\System.Data.SQLite.x64.1.0.90.0\lib\net20\System.Data.SQLite.Linq.dll - - - - - - - - - - - - Form - - - DocViewFrm.cs - - - - - - - - PreserveNewest - - - - - - {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} - Wox.Plugin - - - - - - - - - DocViewFrm.cs - - - - - - - - - - \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Doc/packages.config b/Plugins/Wox.Plugin.Doc/packages.config deleted file mode 100644 index 88d9c92811..0000000000 --- a/Plugins/Wox.Plugin.Doc/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Doc/plugin.json b/Plugins/Wox.Plugin.Doc/plugin.json deleted file mode 100644 index ecc1de97ed..0000000000 --- a/Plugins/Wox.Plugin.Doc/plugin.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "ID":"D2D2C23B084D411DB66FE0C79D6C2A6B", - "ActionKeyword":"doc", - "Name":"Dash.Doc", - "Description":"Offline doc, inspired by dash", - "Author":"qianlifeng", - "Version":"1.0", - "Language":"csharp", - "Website":"http://www.getwox.com", - "ExecuteFileName":"Wox.Plugin.Doc.dll" -} diff --git a/Plugins/Wox.Plugin.Everything/EverythingAPI.cs b/Plugins/Wox.Plugin.Everything/EverythingAPI.cs deleted file mode 100644 index 51433f4752..0000000000 --- a/Plugins/Wox.Plugin.Everything/EverythingAPI.cs +++ /dev/null @@ -1,331 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; - -namespace Wox.Plugin.Everything -{ - public sealed class EverythingAPI - { - - #region Const - const string EVERYTHING_DLL_NAME = "Everything.dll"; - #endregion - - #region DllImport - [DllImport(EVERYTHING_DLL_NAME)] - private static extern int Everything_SetSearch(string lpSearchString); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern void Everything_SetMatchPath(bool bEnable); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern void Everything_SetMatchCase(bool bEnable); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern void Everything_SetMatchWholeWord(bool bEnable); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern void Everything_SetRegex(bool bEnable); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern void Everything_SetMax(int dwMax); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern void Everything_SetOffset(int dwOffset); - - [DllImport(EVERYTHING_DLL_NAME)] - private static extern bool Everything_GetMatchPath(); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern bool Everything_GetMatchCase(); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern bool Everything_GetMatchWholeWord(); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern bool Everything_GetRegex(); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern UInt32 Everything_GetMax(); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern UInt32 Everything_GetOffset(); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern string Everything_GetSearch(); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern StateCode Everything_GetLastError(); - - [DllImport(EVERYTHING_DLL_NAME, EntryPoint = "Everything_QueryW")] - private static extern bool Everything_Query(bool bWait); - - [DllImport(EVERYTHING_DLL_NAME)] - private static extern void Everything_SortResultsByPath(); - - [DllImport(EVERYTHING_DLL_NAME)] - private static extern int Everything_GetNumFileResults(); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern int Everything_GetNumFolderResults(); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern int Everything_GetNumResults(); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern int Everything_GetTotFileResults(); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern int Everything_GetTotFolderResults(); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern int Everything_GetTotResults(); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern bool Everything_IsVolumeResult(int nIndex); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern bool Everything_IsFolderResult(int nIndex); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern bool Everything_IsFileResult(int nIndex); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern void Everything_GetResultFullPathName(int nIndex, StringBuilder lpString, int nMaxCount); - [DllImport(EVERYTHING_DLL_NAME)] - private static extern void Everything_Reset(); - #endregion - - #region Enum - enum StateCode - { - OK, - MemoryError, - IPCError, - RegisterClassExError, - CreateWindowError, - CreateThreadError, - InvalidIndexError, - InvalidCallError - } - #endregion - - #region Property - - /// - /// Gets or sets a value indicating whether [match path]. - /// - /// true if [match path]; otherwise, false. - public Boolean MatchPath - { - get - { - return Everything_GetMatchPath(); - } - set - { - Everything_SetMatchPath(value); - } - } - - /// - /// Gets or sets a value indicating whether [match case]. - /// - /// true if [match case]; otherwise, false. - public Boolean MatchCase - { - get - { - return Everything_GetMatchCase(); - } - set - { - Everything_SetMatchCase(value); - } - } - - /// - /// Gets or sets a value indicating whether [match whole word]. - /// - /// true if [match whole word]; otherwise, false. - public Boolean MatchWholeWord - { - get - { - return Everything_GetMatchWholeWord(); - } - set - { - Everything_SetMatchWholeWord(value); - } - } - - /// - /// Gets or sets a value indicating whether [enable regex]. - /// - /// true if [enable regex]; otherwise, false. - public Boolean EnableRegex - { - get - { - return Everything_GetRegex(); - } - set - { - Everything_SetRegex(value); - } - } - #endregion - - #region Public Method - /// - /// Resets this instance. - /// - public void Reset() - { - Everything_Reset(); - } - - /// - /// Searches the specified key word. - /// - /// The key word. - /// - public IEnumerable Search(string keyWord) - { - return Search(keyWord, 0, int.MaxValue); - } - - private void no() - { - switch (Everything_GetLastError()) - { - case StateCode.CreateThreadError: - throw new CreateThreadException(); - case StateCode.CreateWindowError: - throw new CreateWindowException(); - case StateCode.InvalidCallError: - throw new InvalidCallException(); - case StateCode.InvalidIndexError: - throw new InvalidIndexException(); - case StateCode.IPCError: - throw new IPCErrorException(); - case StateCode.MemoryError: - throw new MemoryErrorException(); - case StateCode.RegisterClassExError: - throw new RegisterClassExException(); - } - } - - /// - /// Searches the specified key word. - /// - /// The key word. - /// The offset. - /// The max count. - /// - public IEnumerable Search(string keyWord, int offset, int maxCount) - { - if (string.IsNullOrEmpty(keyWord)) - throw new ArgumentNullException("keyWord"); - - if (offset < 0) - throw new ArgumentOutOfRangeException("offset"); - - if (maxCount < 0) - throw new ArgumentOutOfRangeException("maxCount"); - - if (keyWord.StartsWith("@")) - { - Everything_SetRegex(true); - keyWord = keyWord.Substring(1); - } - Everything_SetSearch(keyWord); - Everything_SetOffset(offset); - Everything_SetMax(maxCount); - - - if (!Everything_Query(true)) - { - switch (Everything_GetLastError()) - { - case StateCode.CreateThreadError: - throw new CreateThreadException(); - case StateCode.CreateWindowError: - throw new CreateWindowException(); - case StateCode.InvalidCallError: - throw new InvalidCallException(); - case StateCode.InvalidIndexError: - throw new InvalidIndexException(); - case StateCode.IPCError: - throw new IPCErrorException(); - case StateCode.MemoryError: - throw new MemoryErrorException(); - case StateCode.RegisterClassExError: - throw new RegisterClassExException(); - } - yield break; - } - - Everything_SortResultsByPath(); - - const int bufferSize = 4096; - StringBuilder buffer = new StringBuilder(bufferSize); - for (int idx = 0; idx < Everything_GetNumResults(); ++idx) - { - Everything_GetResultFullPathName(idx, buffer, bufferSize); - - var result = new SearchResult() { FullPath = buffer.ToString() }; - if (Everything_IsFolderResult(idx)) - result.Type = ResultType.Folder; - else if (Everything_IsFileResult(idx)) - result.Type = ResultType.File; - - yield return result; - } - } - #endregion - } - - public enum ResultType - { - Volume, - Folder, - File - } - - public class SearchResult - { - public string FullPath { get; set; } - public ResultType Type { get; set; } - } - - /// - /// - /// - public class MemoryErrorException : ApplicationException - { - } - - /// - /// - /// - public class IPCErrorException : ApplicationException - { - } - - /// - /// - /// - public class RegisterClassExException : ApplicationException - { - } - - /// - /// - /// - public class CreateWindowException : ApplicationException - { - } - - /// - /// - /// - public class CreateThreadException : ApplicationException - { - } - - /// - /// - /// - public class InvalidIndexException : ApplicationException - { - } - - /// - /// - /// - public class InvalidCallException : ApplicationException - { - } -} diff --git a/Plugins/Wox.Plugin.Everything/Images/folder.png b/Plugins/Wox.Plugin.Everything/Images/folder.png deleted file mode 100644 index 330cb2e4bf..0000000000 Binary files a/Plugins/Wox.Plugin.Everything/Images/folder.png and /dev/null differ diff --git a/Plugins/Wox.Plugin.Everything/Images/image.png b/Plugins/Wox.Plugin.Everything/Images/image.png deleted file mode 100644 index 85c8a708d3..0000000000 Binary files a/Plugins/Wox.Plugin.Everything/Images/image.png and /dev/null differ diff --git a/Plugins/Wox.Plugin.Everything/Main.cs b/Plugins/Wox.Plugin.Everything/Main.cs deleted file mode 100644 index dc8abe93ab..0000000000 --- a/Plugins/Wox.Plugin.Everything/Main.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; - -namespace Wox.Plugin.Everything -{ - public class Main : IPlugin - { - Wox.Plugin.PluginInitContext context; - EverythingAPI api = new EverythingAPI(); - private static List imageExts = new List() { ".png", ".jpg", ".jpeg", ".gif", ".bmp", ".tiff", ".ico" }; - - public List Query(Query query) - { - var results = new List(); - if (query.ActionParameters.Count > 0 && query.ActionParameters[0].Length > 0) - { - var keyword = string.Join(" ", query.ActionParameters.ToArray()); - var enumerable = api.Search(keyword, 0, 100); - foreach (var s in enumerable) - { - var path = s.FullPath; - Result r = new Result(); - r.Title = Path.GetFileName(path); - r.SubTitle = path; - r.IcoPath = GetIconPath(s); - r.Action = (c) => - { - context.HideApp(); - context.ShellRun(path); - return true; - }; - results.Add(r); - } - } - - api.Reset(); - - return results; - } - - private string GetIconPath(SearchResult s) - { - if (s.Type == ResultType.Folder) - { - return "Images\\folder.png"; - } - else - { - var ext = Path.GetExtension(s.FullPath); - if (!string.IsNullOrEmpty(ext) && imageExts.Contains(ext.ToLower())) - return "Images\\image.png"; - else - return s.FullPath; - } - } - - [System.Runtime.InteropServices.DllImport("kernel32.dll")] - private static extern int LoadLibrary(string name); - - public void Init(Wox.Plugin.PluginInitContext context) - { - this.context = context; - - LoadLibrary(Path.Combine( - Path.Combine(context.CurrentPluginMetadata.PluginDirecotry, (IntPtr.Size == 4) ? "x86" : "x64"), - "Everything.dll" - )); - //init everything - } - } -} diff --git a/Plugins/Wox.Plugin.Everything/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Everything/Properties/AssemblyInfo.cs deleted file mode 100644 index a6ff8af12c..0000000000 --- a/Plugins/Wox.Plugin.Everything/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 -[assembly: AssemblyTitle("Wox.Plugin.Everything")] -[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.Everything")] -[assembly: AssemblyCopyright("The MIT License (MIT)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("97f6ccd0-e9dc-4aa2-b4ce-6b9f14ea20a7")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj b/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj deleted file mode 100644 index 1953ba3b43..0000000000 --- a/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - - Debug - AnyCPU - {230AE83F-E92E-4E69-8355-426B305DA9C0} - Library - Properties - Wox.Plugin.Everything - Wox.Plugin.Everything - v3.5 - 512 - - - true - full - false - ..\..\Output\Debug\Plugins\Wox.Plugin.Everything\ - DEBUG;TRACE - prompt - 4 - AnyCPU - - - pdbonly - true - ..\..\Output\Release\Plugins\Wox.Plugin.Everything\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} - Wox.Plugin - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - PreserveNewest - - - - - - - - - - \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Everything/nativesrc/Everything.c b/Plugins/Wox.Plugin.Everything/nativesrc/Everything.c deleted file mode 100644 index fa74002337..0000000000 --- a/Plugins/Wox.Plugin.Everything/nativesrc/Everything.c +++ /dev/null @@ -1,1801 +0,0 @@ - -// disable warnings -#pragma warning(disable : 4996) // deprecation - -#define EVERYTHINGUSERAPI __declspec(dllexport) - -// include -#include "Everything.h" -#include "Everything_IPC.h" - -// return copydata code -#define _EVERYTHING_COPYDATA_QUERYCOMPLETEA 0 -#define _EVERYTHING_COPYDATA_QUERYCOMPLETEW 1 - -// internal state -static BOOL _Everything_MatchPath = FALSE; -static BOOL _Everything_MatchCase = FALSE; -static BOOL _Everything_MatchWholeWord = FALSE; -static BOOL _Everything_Regex = FALSE; -static DWORD _Everything_LastError = FALSE; -static DWORD _Everything_Max = EVERYTHING_IPC_ALLRESULTS; -static DWORD _Everything_Offset = 0; -static BOOL _Everything_IsUnicodeQuery = FALSE; -static BOOL _Everything_IsUnicodeSearch = FALSE; -static LPVOID _Everything_Search = NULL; // wchar or char -static LPVOID _Everything_List = NULL; // EVERYTHING_IPC_LISTW or EVERYTHING_IPC_LISTA -static volatile BOOL _Everything_Initialized = FALSE; -static volatile LONG _Everything_InterlockedCount = 0; -static CRITICAL_SECTION _Everything_cs; -static HWND _Everything_ReplyWindow = 0; -static DWORD _Everything_ReplyID = 0; - -static VOID _Everything_Initialize(VOID) -{ - if (!_Everything_Initialized) - { - if (InterlockedIncrement(&_Everything_InterlockedCount) == 1) - { - // do the initialization.. - InitializeCriticalSection(&_Everything_cs); - - _Everything_Initialized = 1; - } - else - { - // wait for initialization.. - while (!_Everything_Initialized) Sleep(0); - } - } -} - -static VOID _Everything_Lock(VOID) -{ - _Everything_Initialize(); - - EnterCriticalSection(&_Everything_cs); -} - -static VOID _Everything_Unlock(VOID) -{ - LeaveCriticalSection(&_Everything_cs); -} - -// aVOID other libs -static int _Everything_StringLengthA(LPCSTR start) -{ - register LPCSTR s; - - s = start; - - while(*s) - { - s++; - } - - return (int)(s-start); -} - -static int _Everything_StringLengthW(LPCWSTR start) -{ - register LPCWSTR s; - - s = start; - - while(*s) - { - s++; - } - - return (int)(s-start); -} - -VOID EVERYTHINGAPI Everything_SetSearchW(LPCWSTR lpString) -{ - int len; - - _Everything_Lock(); - - if (_Everything_Search) HeapFree(GetProcessHeap(),0,_Everything_Search); - - len = _Everything_StringLengthW(lpString) + 1; - - _Everything_Search = HeapAlloc(GetProcessHeap(),0,len*sizeof(wchar_t)); - if (_Everything_Search) - { - CopyMemory(_Everything_Search,lpString,len*sizeof(wchar_t)); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_MEMORY; - } - - _Everything_IsUnicodeSearch = 1; - - _Everything_Unlock(); -} - -VOID EVERYTHINGAPI Everything_SetSearchA(LPCSTR lpString) -{ - int size; - - _Everything_Lock(); - - if (_Everything_Search) HeapFree(GetProcessHeap(),0,_Everything_Search); - - size = _Everything_StringLengthA(lpString) + 1; - - _Everything_Search = (LPWSTR )HeapAlloc(GetProcessHeap(),0,size); - if (_Everything_Search) - { - CopyMemory(_Everything_Search,lpString,size); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_MEMORY; - } - - _Everything_IsUnicodeSearch = 0; - - _Everything_Unlock(); -} - -LPCSTR EVERYTHINGAPI Everything_GetSearchA(VOID) -{ - LPCSTR ret; - - _Everything_Lock(); - - if (_Everything_Search) - { - if (_Everything_IsUnicodeSearch) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = NULL; - } - else - { - ret = (LPCSTR)_Everything_Search; - } - } - else - { - ret = ""; - } - - _Everything_Unlock(); - - return ret; -} - -LPCWSTR EVERYTHINGAPI Everything_GetSearchW(VOID) -{ - LPCWSTR ret; - - _Everything_Lock(); - - if (_Everything_Search) - { - if (!_Everything_IsUnicodeSearch) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = NULL; - } - else - { - ret = (LPCWSTR)_Everything_Search; - } - } - else - { - ret = L""; - } - - _Everything_Unlock(); - - return ret; -} - -VOID EVERYTHINGAPI Everything_SetMatchPath(BOOL bEnable) -{ - _Everything_Lock(); - - _Everything_MatchPath = bEnable; - - _Everything_Unlock(); -} - -VOID EVERYTHINGAPI Everything_SetMatchCase(BOOL bEnable) -{ - _Everything_Lock(); - - _Everything_MatchCase = bEnable; - - _Everything_Unlock(); -} - -VOID EVERYTHINGAPI Everything_SetMatchWholeWord(BOOL bEnable) -{ - _Everything_Lock(); - - _Everything_MatchWholeWord = bEnable; - - _Everything_Unlock(); -} - -VOID EVERYTHINGAPI Everything_SetRegex(BOOL bEnable) -{ - _Everything_Lock(); - - _Everything_Regex = bEnable; - - _Everything_Unlock(); -} - -VOID EVERYTHINGAPI Everything_SetMax(DWORD dwMax) -{ - _Everything_Lock(); - - _Everything_Max = dwMax; - - _Everything_Unlock(); -} - -VOID EVERYTHINGAPI Everything_SetOffset(DWORD dwOffset) -{ - _Everything_Lock(); - - _Everything_Offset = dwOffset; - - _Everything_Unlock(); -} - -VOID EVERYTHINGAPI Everything_SetReplyWindow(HWND hWnd) -{ - _Everything_Lock(); - - _Everything_ReplyWindow = hWnd; - - _Everything_Unlock(); -} - -VOID EVERYTHINGAPI Everything_SetReplyID(DWORD nId) -{ - _Everything_Lock(); - - _Everything_ReplyID = nId; - - _Everything_Unlock(); -} - -BOOL EVERYTHINGAPI Everything_GetMatchPath(VOID) -{ - BOOL ret; - - _Everything_Lock(); - - ret = _Everything_MatchPath; - - _Everything_Unlock(); - - return ret; -} - -BOOL EVERYTHINGAPI Everything_GetMatchCase(VOID) -{ - BOOL ret; - - _Everything_Lock(); - - ret = _Everything_MatchCase; - - _Everything_Unlock(); - - return ret; -} - -BOOL EVERYTHINGAPI Everything_GetMatchWholeWord(VOID) -{ - BOOL ret; - - _Everything_Lock(); - - ret = _Everything_MatchWholeWord; - - _Everything_Unlock(); - - return ret; -} - -BOOL EVERYTHINGAPI Everything_GetRegex(VOID) -{ - BOOL ret; - - _Everything_Lock(); - - ret = _Everything_Regex; - - _Everything_Unlock(); - - return ret; -} - -DWORD EVERYTHINGAPI Everything_GetMax(VOID) -{ - BOOL ret; - - _Everything_Lock(); - - ret = _Everything_Max; - - _Everything_Unlock(); - - return ret; -} - -DWORD EVERYTHINGAPI Everything_GetOffset(VOID) -{ - BOOL ret; - - _Everything_Lock(); - - ret = _Everything_Offset; - - _Everything_Unlock(); - - return ret; -} - -HWND EVERYTHINGAPI Everything_GetReplyWindow(VOID) -{ - HWND ret; - - _Everything_Lock(); - - ret = _Everything_ReplyWindow; - - _Everything_Unlock(); - - return ret; -} - -DWORD EVERYTHINGAPI Everything_GetReplyID(VOID) -{ - DWORD ret; - - _Everything_Lock(); - - ret = _Everything_ReplyID; - - _Everything_Unlock(); - - return ret; -} - -// custom window proc -static LRESULT EVERYTHINGAPI _Everything_window_proc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) -{ - switch(msg) - { - case WM_COPYDATA: - { - COPYDATASTRUCT *cds = (COPYDATASTRUCT *)lParam; - - switch(cds->dwData) - { - case _EVERYTHING_COPYDATA_QUERYCOMPLETEA: - - if (!_Everything_IsUnicodeQuery) - { - if (_Everything_List) HeapFree(GetProcessHeap(),0,_Everything_List); - - _Everything_List = (EVERYTHING_IPC_LISTW *)HeapAlloc(GetProcessHeap(),0,cds->cbData); - - if (_Everything_List) - { - CopyMemory(_Everything_List,cds->lpData,cds->cbData); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_MEMORY; - } - - PostQuitMessage(0); - - return TRUE; - } - - break; - - case _EVERYTHING_COPYDATA_QUERYCOMPLETEW: - - if (_Everything_IsUnicodeQuery) - { - if (_Everything_List) HeapFree(GetProcessHeap(),0,_Everything_List); - - _Everything_List = (EVERYTHING_IPC_LISTW *)HeapAlloc(GetProcessHeap(),0,cds->cbData); - - if (_Everything_List) - { - CopyMemory(_Everything_List,cds->lpData,cds->cbData); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_MEMORY; - } - - PostQuitMessage(0); - - return TRUE; - } - - break; - } - - break; - } - } - - return DefWindowProc(hwnd,msg,wParam,lParam); -} - -// get the search length -static int _Everything_GetSearchLengthW(VOID) -{ - if (_Everything_Search) - { - if (_Everything_IsUnicodeSearch) - { - return _Everything_StringLengthW((LPCWSTR )_Everything_Search); - } - else - { - return MultiByteToWideChar(CP_ACP,0,(LPCSTR )_Everything_Search,-1,0,0); - } - } - - return 0; -} - -// get the search length -static int _Everything_GetSearchLengthA(VOID) -{ - if (_Everything_Search) - { - if (_Everything_IsUnicodeSearch) - { - return WideCharToMultiByte(CP_ACP,0,(LPCWSTR )_Everything_Search,-1,0,0,0,0); - } - else - { - return _Everything_StringLengthA((LPCSTR )_Everything_Search); - } - } - - return 0; -} - -// get the search length -static VOID _Everything_GetSearchTextW(LPWSTR wbuf) -{ - int wlen; - - if (_Everything_Search) - { - wlen = _Everything_GetSearchLengthW(); - - if (_Everything_IsUnicodeSearch) - { - CopyMemory(wbuf,_Everything_Search,(wlen+1) * sizeof(wchar_t)); - - return; - } - else - { - MultiByteToWideChar(CP_ACP,0,(LPCSTR )_Everything_Search,-1,wbuf,wlen+1); - - return; - } - } - - *wbuf = 0; -} - -// get the search length -static VOID _Everything_GetSearchTextA(LPSTR buf) -{ - int len; - - if (_Everything_Search) - { - len = _Everything_GetSearchLengthW(); - - if (_Everything_IsUnicodeSearch) - { - WideCharToMultiByte(CP_ACP,0,(LPCWSTR )_Everything_Search,-1,buf,len+1,0,0); - - return; - } - else - { - CopyMemory(buf,_Everything_Search,len+1); - - return; - } - } - - *buf = 0; -} - -static DWORD EVERYTHINGAPI _Everything_thread_proc(VOID *param) -{ - HWND everything_hwnd; - COPYDATASTRUCT cds; - WNDCLASSEX wcex; - HWND hwnd; - MSG msg; - int ret; - int len; - int size; - union - { - EVERYTHING_IPC_QUERYA *queryA; - EVERYTHING_IPC_QUERYW *queryW; - VOID *query; - }q; - - ZeroMemory(&wcex,sizeof(wcex)); - wcex.cbSize = sizeof(wcex); - - if (!GetClassInfoEx(GetModuleHandle(0),TEXT("EVERYTHING_DLL"),&wcex)) - { - ZeroMemory(&wcex,sizeof(wcex)); - wcex.cbSize = sizeof(wcex); - wcex.hInstance = GetModuleHandle(0); - wcex.lpfnWndProc = _Everything_window_proc; - wcex.lpszClassName = TEXT("EVERYTHING_DLL"); - - if (!RegisterClassEx(&wcex)) - { - _Everything_LastError = EVERYTHING_ERROR_REGISTERCLASSEX; - - return 0; - } - } - - hwnd = CreateWindow( - TEXT("EVERYTHING_DLL"), - TEXT(""), - 0, - 0,0,0,0, - 0,0,GetModuleHandle(0),0); - - if (hwnd) - { - everything_hwnd = FindWindow(EVERYTHING_IPC_WNDCLASS,0); - if (everything_hwnd) - { - LPVOID a; - - if (param) - { - // unicode - len = _Everything_GetSearchLengthW(); - - size = sizeof(EVERYTHING_IPC_QUERYW) - sizeof(wchar_t) + len*sizeof(wchar_t) + sizeof(wchar_t); - } - else - { - // ansi - len = _Everything_GetSearchLengthA(); - - size = sizeof(EVERYTHING_IPC_QUERYA) - sizeof(char) + (len*sizeof(char)) + sizeof(char); - } - - // alloc - a = HeapAlloc(GetProcessHeap(),0,size); - q.query = (EVERYTHING_IPC_QUERYW *)a; - - if (q.query) - { - if (param) - { - q.queryW->max_results = _Everything_Max; - q.queryW->offset = _Everything_Offset; - q.queryW->reply_copydata_message = _EVERYTHING_COPYDATA_QUERYCOMPLETEW; - q.queryW->search_flags = (_Everything_Regex?EVERYTHING_IPC_REGEX:0) | (_Everything_MatchCase?EVERYTHING_IPC_MATCHCASE:0) | (_Everything_MatchWholeWord?EVERYTHING_IPC_MATCHWHOLEWORD:0) | (_Everything_MatchPath?EVERYTHING_IPC_MATCHPATH:0); - q.queryW->reply_hwnd = (INT32) hwnd; - - _Everything_GetSearchTextW((LPWSTR) q.queryW->search_string); - } - else - { - q.queryA->max_results = _Everything_Max; - q.queryA->offset = _Everything_Offset; - q.queryA->reply_copydata_message = _EVERYTHING_COPYDATA_QUERYCOMPLETEA; - q.queryA->search_flags = (_Everything_Regex?EVERYTHING_IPC_REGEX:0) | (_Everything_MatchCase?EVERYTHING_IPC_MATCHCASE:0) | (_Everything_MatchWholeWord?EVERYTHING_IPC_MATCHWHOLEWORD:0) | (_Everything_MatchPath?EVERYTHING_IPC_MATCHPATH:0); - q.queryA->reply_hwnd = (INT32)hwnd; - - _Everything_GetSearchTextA((LPSTR) q.queryA->search_string); - } - - cds.cbData = size; - cds.dwData = param?EVERYTHING_IPC_COPYDATAQUERYW:EVERYTHING_IPC_COPYDATAQUERYA; - cds.lpData = q.query; - - if (SendMessage(everything_hwnd,WM_COPYDATA,(WPARAM)hwnd,(LPARAM)&cds) == TRUE) - { - // message pump - loop: - - WaitMessage(); - - // update windows - while(PeekMessage(&msg,NULL,0,0,0)) - { - ret = (int)GetMessage(&msg,0,0,0); - if (ret == -1) goto exit; - if (!ret) goto exit; - - // let windows handle it. - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - goto loop; - - exit: - - // get result from window. - DestroyWindow(hwnd); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_IPC; - } - - // get result from window. - HeapFree(GetProcessHeap(),0,q.query); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_MEMORY; - } - } - else - { - // the everything window was not found. - // we can optionally RegisterWindowMessage("EVERYTHING_IPC_CREATED") and - // wait for Everything to post this message to all top level windows when its up and running. - _Everything_LastError = EVERYTHING_ERROR_IPC; - } - } - else - { - _Everything_LastError = EVERYTHING_ERROR_CREATEWINDOW; - } - - return 0; -} - -static BOOL EVERYTHINGAPI _Everything_Query(BOOL bUnicode) -{ - HANDLE hthread; - DWORD threadid; - VOID *param; - - // reset the error flag. - _Everything_LastError = 0; - - if (bUnicode) - { - param = (VOID *)1; - } - else - { - param = 0; - } - - _Everything_IsUnicodeQuery = bUnicode; - - hthread = CreateThread(0,0,_Everything_thread_proc,param,0,&threadid); - - if (hthread) - { - WaitForSingleObject(hthread,INFINITE); - - CloseHandle(hthread); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_CREATETHREAD; - } - - return (_Everything_LastError == 0)?TRUE:FALSE; -} - - -BOOL _Everything_SendIPCQuery(BOOL bUnicode) -{ - HWND everything_hwnd; - COPYDATASTRUCT cds; - int ret; - int len; - int size; - union - { - EVERYTHING_IPC_QUERYA *queryA; - EVERYTHING_IPC_QUERYW *queryW; - VOID *query; - }q; - - _Everything_IsUnicodeQuery = bUnicode; - - // find the everything ipc window. - everything_hwnd = FindWindow(EVERYTHING_IPC_WNDCLASS,0); - if (everything_hwnd) - { - if (bUnicode) - { - // unicode - len = _Everything_GetSearchLengthW(); - - size = sizeof(EVERYTHING_IPC_QUERYW) - sizeof(wchar_t) + len*sizeof(wchar_t) + sizeof(wchar_t); - } - else - { - // ansi - len = _Everything_GetSearchLengthA(); - - size = sizeof(EVERYTHING_IPC_QUERYA) - sizeof(char) + (len*sizeof(char)) + sizeof(char); - } - - // alloc - q.query = (EVERYTHING_IPC_QUERYW *)HeapAlloc(GetProcessHeap(),0,size); - - if (q.query) - { - if (bUnicode) - { - q.queryW->max_results = _Everything_Max; - q.queryW->offset = _Everything_Offset; - q.queryW->reply_copydata_message = _Everything_ReplyID; - q.queryW->search_flags = (_Everything_Regex?EVERYTHING_IPC_REGEX:0) | (_Everything_MatchCase?EVERYTHING_IPC_MATCHCASE:0) | (_Everything_MatchWholeWord?EVERYTHING_IPC_MATCHWHOLEWORD:0) | (_Everything_MatchPath?EVERYTHING_IPC_MATCHPATH:0); - q.queryW->reply_hwnd = (INT32) _Everything_ReplyWindow; - - _Everything_GetSearchTextW((LPWSTR) q.queryW->search_string); - } - else - { - q.queryA->max_results = _Everything_Max; - q.queryA->offset = _Everything_Offset; - q.queryA->reply_copydata_message = _Everything_ReplyID; - q.queryA->search_flags = (_Everything_Regex?EVERYTHING_IPC_REGEX:0) | (_Everything_MatchCase?EVERYTHING_IPC_MATCHCASE:0) | (_Everything_MatchWholeWord?EVERYTHING_IPC_MATCHWHOLEWORD:0) | (_Everything_MatchPath?EVERYTHING_IPC_MATCHPATH:0); - q.queryA->reply_hwnd = (INT32) _Everything_ReplyWindow; - - _Everything_GetSearchTextA((LPSTR) q.queryA->search_string); - } - - cds.cbData = size; - cds.dwData = bUnicode?EVERYTHING_IPC_COPYDATAQUERYW:EVERYTHING_IPC_COPYDATAQUERYA; - cds.lpData = q.query; - - if (SendMessage(everything_hwnd,WM_COPYDATA,(WPARAM)_Everything_ReplyWindow,(LPARAM)&cds)) - { - // sucessful. - ret = TRUE; - } - else - { - // no ipc - _Everything_LastError = EVERYTHING_ERROR_IPC; - - ret = FALSE; - } - - // get result from window. - HeapFree(GetProcessHeap(),0,q.query); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_MEMORY; - - ret = FALSE; - } - } - else - { - _Everything_LastError = EVERYTHING_ERROR_IPC; - - ret = FALSE; - } - - return ret; -} - -BOOL EVERYTHINGAPI Everything_QueryA(BOOL bWait) -{ - BOOL ret; - - _Everything_Lock(); - - if (bWait) - { - ret = _Everything_Query(FALSE); - } - else - { - ret = _Everything_SendIPCQuery(FALSE); - } - - _Everything_Unlock(); - - return ret; -} - -BOOL EVERYTHINGAPI Everything_QueryW(BOOL bWait) -{ - BOOL ret; - - _Everything_Lock(); - - if (bWait) - { - ret = _Everything_Query(TRUE); - } - else - { - ret = _Everything_SendIPCQuery(TRUE); - } - - _Everything_Unlock(); - - return ret; -} - -static int _Everything_CompareA(const VOID *a,const VOID *b) -{ - int i; - - i = stricmp(EVERYTHING_IPC_ITEMPATH(_Everything_List,a),EVERYTHING_IPC_ITEMPATH(_Everything_List,b)); - - if (!i) - { - return stricmp(EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,a),EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,b)); - } - else - if (i > 0) - { - return 1; - } - else - { - return -1; - } -} - -static int _Everything_CompareW(const VOID *a,const VOID *b) -{ - int i; - - i = stricmp(EVERYTHING_IPC_ITEMPATH(_Everything_List,a),EVERYTHING_IPC_ITEMPATH(_Everything_List,b)); - - if (!i) - { - return wcsicmp(EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,a),EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,b)); - } - else - if (i > 0) - { - return 1; - } - else - { - return -1; - } -} - -VOID EVERYTHINGAPI Everything_SortResultsByPath(VOID) -{ - _Everything_Lock(); - - if (_Everything_List) - { - if (_Everything_IsUnicodeQuery) - { - qsort(((EVERYTHING_IPC_LISTW *)_Everything_List)->items,((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems,sizeof(EVERYTHING_IPC_ITEMW),_Everything_CompareW); - } - else - { - qsort(((EVERYTHING_IPC_LISTA *)_Everything_List)->items,((EVERYTHING_IPC_LISTA *)_Everything_List)->numitems,sizeof(EVERYTHING_IPC_ITEMA),_Everything_CompareA); - } - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - } - - _Everything_Unlock(); -} - -DWORD EVERYTHINGAPI Everything_GetLastError(VOID) -{ - DWORD ret; - - _Everything_Lock(); - - ret = _Everything_LastError; - - _Everything_Unlock(); - - return ret; -} - -int EVERYTHINGAPI Everything_GetNumFileResults(VOID) -{ - int ret; - - _Everything_Lock(); - - if (_Everything_List) - { - if (_Everything_IsUnicodeQuery) - { - ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->numfiles; - } - else - { - ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->numfiles; - } - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = 0; - } - - _Everything_Unlock(); - - return ret; -} - -int EVERYTHINGAPI Everything_GetNumFolderResults(VOID) -{ - int ret; - - _Everything_Lock(); - - if (_Everything_List) - { - if (_Everything_IsUnicodeQuery) - { - ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->numfolders; - } - else - { - ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->numfolders; - } - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = 0; - } - - _Everything_Unlock(); - - return ret; -} - -int EVERYTHINGAPI Everything_GetNumResults(VOID) -{ - int ret; - - _Everything_Lock(); - - if (_Everything_List) - { - if (_Everything_IsUnicodeQuery) - { - ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems; - } - else - { - ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->numitems; - } - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = 0; - } - - _Everything_Unlock(); - - return ret; -} - -int EVERYTHINGAPI Everything_GetTotFileResults(VOID) -{ - int ret; - - _Everything_Lock(); - - if (_Everything_List) - { - if (_Everything_IsUnicodeQuery) - { - ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->totfiles; - } - else - { - ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->totfiles; - } - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = 0; - } - - _Everything_Unlock(); - - return ret; -} - -int EVERYTHINGAPI Everything_GetTotFolderResults(VOID) -{ - int ret; - - _Everything_Lock(); - - if (_Everything_List) - { - if (_Everything_IsUnicodeQuery) - { - ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->totfolders; - } - else - { - ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->totfolders; - } - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = 0; - } - - _Everything_Unlock(); - - return ret; -} - -int EVERYTHINGAPI Everything_GetTotResults(VOID) -{ - int ret; - - _Everything_Lock(); - - if (_Everything_List) - { - if (_Everything_IsUnicodeQuery) - { - ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->totitems; - } - else - { - ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->totitems; - } - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = 0; - } - - _Everything_Unlock(); - - return ret; -} - -BOOL EVERYTHINGAPI Everything_IsVolumeResult(int nIndex) -{ - BOOL ret; - - _Everything_Lock(); - - if (_Everything_List) - { - if (nIndex < 0) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = FALSE; - - goto exit; - } - - if (nIndex >= Everything_GetNumResults()) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = FALSE; - - goto exit; - } - - if (_Everything_IsUnicodeQuery) - { - ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex].flags & EVERYTHING_IPC_DRIVE; - } - else - { - ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex].flags & EVERYTHING_IPC_DRIVE; - } - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = FALSE; - } - -exit: - - _Everything_Unlock(); - - return ret; -} - -BOOL EVERYTHINGAPI Everything_IsFolderResult(int nIndex) -{ - BOOL ret; - - _Everything_Lock(); - - if (_Everything_List) - { - if (nIndex < 0) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = FALSE; - - goto exit; - } - - if (nIndex >= Everything_GetNumResults()) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = FALSE; - - goto exit; - } - - if (_Everything_IsUnicodeQuery) - { - ret = ((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex].flags & (EVERYTHING_IPC_DRIVE|EVERYTHING_IPC_FOLDER); - } - else - { - ret = ((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex].flags & (EVERYTHING_IPC_DRIVE|EVERYTHING_IPC_FOLDER); - } - } - else - { - ret = FALSE; - } - -exit: - - _Everything_Unlock(); - - return ret; -} - -BOOL EVERYTHINGAPI Everything_IsFileResult(int nIndex) -{ - BOOL ret; - - _Everything_Lock(); - - if (_Everything_List) - { - if (nIndex < 0) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = FALSE; - - goto exit; - } - - if (nIndex >= Everything_GetNumResults()) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = FALSE; - - goto exit; - } - - if (_Everything_IsUnicodeQuery) - { - ret = !(((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex].flags & (EVERYTHING_IPC_DRIVE|EVERYTHING_IPC_FOLDER)); - } - else - { - ret = !(((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex].flags & (EVERYTHING_IPC_DRIVE|EVERYTHING_IPC_FOLDER)); - } - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = FALSE; - } - -exit: - - _Everything_Unlock(); - - return ret; -} - -LPCWSTR EVERYTHINGAPI Everything_GetResultFileNameW(int nIndex) -{ - LPCWSTR ret; - - _Everything_Lock(); - - if ((_Everything_List) && (_Everything_IsUnicodeQuery)) - { - if (nIndex < 0) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = NULL; - - goto exit; - } - - if (nIndex >= (int)((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = NULL; - - goto exit; - } - - ret = EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex]); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = NULL; - } - -exit: - - _Everything_Unlock(); - - return ret; -} - -LPCSTR EVERYTHINGAPI Everything_GetResultFileNameA(int nIndex) -{ - LPCSTR ret; - - _Everything_Lock(); - - if ((_Everything_List) && (!_Everything_IsUnicodeQuery)) - { - if (nIndex < 0) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = NULL; - - goto exit; - } - - if (nIndex >= (int)((EVERYTHING_IPC_LISTA *)_Everything_List)->numitems) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = NULL; - - goto exit; - } - - ret = EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex]); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = NULL; - } - -exit: - - _Everything_Unlock(); - - return ret; -} - -LPCWSTR EVERYTHINGAPI Everything_GetResultPathW(int nIndex) -{ - LPCWSTR ret; - - _Everything_Lock(); - - if ((_Everything_List) && (_Everything_IsUnicodeQuery)) - { - if (nIndex < 0) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = NULL; - - goto exit; - } - - if (nIndex >= (int)((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = NULL; - - goto exit; - } - - ret = EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex]); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = NULL; - } - -exit: - - _Everything_Unlock(); - - return ret; -} - -LPCSTR EVERYTHINGAPI Everything_GetResultPathA(int nIndex) -{ - LPCSTR ret; - - _Everything_Lock(); - - if (_Everything_List) - { - if (nIndex < 0) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = NULL; - - goto exit; - } - - if (nIndex >= (int)((EVERYTHING_IPC_LISTA *)_Everything_List)->numitems) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - ret = NULL; - - goto exit; - } - - ret = EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex]); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - ret = NULL; - } - -exit: - - _Everything_Unlock(); - - return ret; -} - -// max is in chars -static int _Everything_CopyW(LPWSTR buf,int bufmax,int catlen,LPCWSTR s) -{ - int wlen; - - if (buf) - { - buf += catlen; - bufmax -= catlen; - } - - wlen = _Everything_StringLengthW(s); - if (!wlen) - { - if (buf) - { - buf[wlen] = 0; - } - - return catlen; - } - - // terminate - if (wlen > bufmax-1) wlen = bufmax-1; - - if (buf) - { - CopyMemory(buf,s,wlen*sizeof(wchar_t)); - - buf[wlen] = 0; - } - - return wlen + catlen; -} - -static int _Everything_CopyA(LPSTR buf,int max,int catlen,LPCSTR s) -{ - int len; - - if (buf) - { - buf += catlen; - max -= catlen; - } - - len = _Everything_StringLengthA(s); - if (!len) - { - if (buf) - { - buf[len] = 0; - } - - return catlen; - } - - // terminate - if (len > max-1) len = max-1; - - if (buf) - { - CopyMemory(buf,s,len*sizeof(char)); - - buf[len] = 0; - } - - return len + catlen; - -} - -// max is in chars -static int _Everything_CopyWFromA(LPWSTR buf,int bufmax,int catlen,LPCSTR s) -{ - int wlen; - - if (buf) - { - buf += catlen; - bufmax -= catlen; - } - - wlen = MultiByteToWideChar(CP_ACP,0,s,_Everything_StringLengthA(s),0,0); - if (!wlen) - { - if (buf) - { - buf[wlen] = 0; - } - - return catlen; - } - - // terminate - if (wlen > bufmax-1) wlen = bufmax-1; - - if (buf) - { - MultiByteToWideChar(CP_ACP,0,s,_Everything_StringLengthA(s),buf,wlen); - - buf[wlen] = 0; - } - - return wlen + catlen; -} - -static int _Everything_CopyAFromW(LPSTR buf,int max,int catlen,LPCWSTR s) -{ - int len; - - if (buf) - { - buf += catlen; - max -= catlen; - } - - len = WideCharToMultiByte(CP_ACP,0,s,_Everything_StringLengthW(s),0,0,0,0); - if (!len) - { - if (buf) - { - buf[len] = 0; - } - - return catlen; - } - - // terminate - if (len > max-1) len = max-1; - - if (buf) - { - WideCharToMultiByte(CP_ACP,0,s,_Everything_StringLengthW(s),buf,len,0,0); - - buf[len] = 0; - } - - return len + catlen; - -} - -int EVERYTHINGUSERAPI Everything_GetResultFullPathNameW(int nIndex,LPWSTR wbuf,int wbuf_size_in_wchars) -{ - int len; - - _Everything_Lock(); - - if (_Everything_List) - { - if (nIndex < 0) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L""); - - goto exit; - } - - if (nIndex >= (int)((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L""); - - goto exit; - } - - len = 0; - - if (_Everything_IsUnicodeQuery) - { - len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex])); - } - else - { - len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex])); - } - - if (len) - { - len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,L"\\"); - } - - if (_Everything_IsUnicodeQuery) - { - len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex])); - } - else - { - len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex])); - } - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L""); - } - -exit: - - _Everything_Unlock(); - - return len; -} - -int EVERYTHINGUSERAPI Everything_GetResultFullPathNameA(int nIndex,LPSTR buf,int bufsize) -{ - int len; - - _Everything_Lock(); - - if (_Everything_List) - { - if (nIndex < 0) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - len = _Everything_CopyA(buf,bufsize,0,""); - - goto exit; - } - - if (nIndex >= (int)((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems) - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; - - len = _Everything_CopyA(buf,bufsize,0,""); - - goto exit; - } - - len = 0; - - if (_Everything_IsUnicodeQuery) - { - len = _Everything_CopyAFromW(buf,bufsize,len,EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex])); - } - else - { - len = _Everything_CopyA(buf,bufsize,len,EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex])); - } - - if (len) - { - len = _Everything_CopyA(buf,bufsize,len,"\\"); - } - - if (_Everything_IsUnicodeQuery) - { - len = _Everything_CopyAFromW(buf,bufsize,len,EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex])); - } - else - { - len = _Everything_CopyA(buf,bufsize,len,EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex])); - } - } - else - { - _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; - - len = _Everything_CopyA(buf,bufsize,0,""); - } - -exit: - - _Everything_Unlock(); - - return len; -} - -BOOL EVERYTHINGAPI Everything_IsQueryReply(UINT message,WPARAM wParam,LPARAM lParam,DWORD nId) -{ - if (message == WM_COPYDATA) - { - COPYDATASTRUCT *cds = (COPYDATASTRUCT *)lParam; - - if (cds) - { - if (cds->dwData == _Everything_ReplyID) - { - if (_Everything_IsUnicodeQuery) - { - if (_Everything_List) HeapFree(GetProcessHeap(),0,_Everything_List); - - _Everything_List = (EVERYTHING_IPC_LISTW *)HeapAlloc(GetProcessHeap(),0,cds->cbData); - - if (_Everything_List) - { - CopyMemory(_Everything_List,cds->lpData,cds->cbData); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_MEMORY; - } - - return TRUE; - } - else - { - if (_Everything_List) HeapFree(GetProcessHeap(),0,_Everything_List); - - _Everything_List = (EVERYTHING_IPC_LISTW *)HeapAlloc(GetProcessHeap(),0,cds->cbData); - - if (_Everything_List) - { - CopyMemory(_Everything_List,cds->lpData,cds->cbData); - } - else - { - _Everything_LastError = EVERYTHING_ERROR_MEMORY; - } - - return TRUE; - } - } - } - } - - return FALSE; -} - -VOID EVERYTHINGUSERAPI Everything_Reset(VOID) -{ - _Everything_Lock(); - - if (_Everything_Search) - { - HeapFree(GetProcessHeap(),0,_Everything_Search); - - _Everything_Search = 0; - } - - if (_Everything_List) - { - HeapFree(GetProcessHeap(),0,_Everything_List); - - _Everything_List = 0; - } - - // reset state - _Everything_MatchPath = FALSE; - _Everything_MatchCase = FALSE; - _Everything_MatchWholeWord = FALSE; - _Everything_Regex = FALSE; - _Everything_LastError = FALSE; - _Everything_Max = EVERYTHING_IPC_ALLRESULTS; - _Everything_Offset = 0; - _Everything_IsUnicodeQuery = FALSE; - _Everything_IsUnicodeSearch = FALSE; - - _Everything_Unlock(); -} - -//VOID DestroyResultArray(VOID *) - -// testing -/* -int main(int argc,char **argv) -{ - char buf[MAX_PATH]; - wchar_t wbuf[MAX_PATH]; - - // set search -// Everything_SetSearchA("sonic"); - Everything_SetSearchW(L"sonic"); - -// Everything_QueryA(); - Everything_QueryW(TRUE); - -// Everything_GetResultFullPathNameA(0,buf,sizeof(buf)); - Everything_GetResultFullPathNameW(0,wbuf,sizeof(wbuf)/sizeof(wchar_t)); - -// MessageBoxA(0,buf,"result 1",MB_OK); - MessageBoxW(0,wbuf,L"result 1",MB_OK); - -// MessageBoxA(0,resultA.cFileName,"result 1",MB_OK); -// MessageBoxW(0,resultW.cFileName,L"result 1",MB_OK); -} -*/ \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Everything/nativesrc/Everything.def b/Plugins/Wox.Plugin.Everything/nativesrc/Everything.def deleted file mode 100644 index 389f868855..0000000000 --- a/Plugins/Wox.Plugin.Everything/nativesrc/Everything.def +++ /dev/null @@ -1,51 +0,0 @@ -LIBRARY Everything - -EXPORTS - - Everything_GetLastError - - Everything_SetSearchA - Everything_SetSearchW - Everything_SetMatchPath - Everything_SetMatchCase - Everything_SetMatchWholeWord - Everything_SetRegex - Everything_SetMax - Everything_SetOffset - - Everything_GetSearchA - Everything_GetSearchW - Everything_GetMatchPath - Everything_GetMatchCase - Everything_GetMatchWholeWord - Everything_GetRegex - Everything_GetMax - Everything_GetOffset - - Everything_QueryA - Everything_QueryW - - Everything_IsQueryReply - - Everything_SortResultsByPath - - Everything_GetNumFileResults - Everything_GetNumFolderResults - Everything_GetNumResults - Everything_GetTotFileResults - Everything_GetTotFolderResults - Everything_GetTotResults - - Everything_IsVolumeResult - Everything_IsFolderResult - Everything_IsFileResult - - Everything_GetResultFileNameA - Everything_GetResultFileNameW - Everything_GetResultPathA - Everything_GetResultPathW - Everything_GetResultFullPathNameA - Everything_GetResultFullPathNameW - - Everything_Reset - \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Everything/nativesrc/Everything.h b/Plugins/Wox.Plugin.Everything/nativesrc/Everything.h deleted file mode 100644 index 1a1770ba57..0000000000 --- a/Plugins/Wox.Plugin.Everything/nativesrc/Everything.h +++ /dev/null @@ -1,95 +0,0 @@ - -#ifndef _EVERYTHING_DLL_ -#define _EVERYTHING_DLL_ - -#ifndef _INC_WINDOWS -#include -#endif - -#define EVERYTHING_OK 0 -#define EVERYTHING_ERROR_MEMORY 1 -#define EVERYTHING_ERROR_IPC 2 -#define EVERYTHING_ERROR_REGISTERCLASSEX 3 -#define EVERYTHING_ERROR_CREATEWINDOW 4 -#define EVERYTHING_ERROR_CREATETHREAD 5 -#define EVERYTHING_ERROR_INVALIDINDEX 6 -#define EVERYTHING_ERROR_INVALIDCALL 7 - -#ifndef EVERYTHINGAPI -#define EVERYTHINGAPI __stdcall -#endif - -#ifndef EVERYTHINGUSERAPI -#define EVERYTHINGUSERAPI __declspec(dllimport) -#endif - -// write search state -EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetSearchW(LPCWSTR lpString); -EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetSearchA(LPCSTR lpString); -EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetMatchPath(BOOL bEnable); -EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetMatchCase(BOOL bEnable); -EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetMatchWholeWord(BOOL bEnable); -EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetRegex(BOOL bEnable); -EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetMax(DWORD dwMax); -EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetOffset(DWORD dwOffset); -EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetReplyWindow(HWND hWnd); -EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SetReplyID(DWORD nId); - -// read search state -EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetMatchPath(VOID); -EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetMatchCase(VOID); -EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetMatchWholeWord(VOID); -EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetRegex(VOID); -EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetMax(VOID); -EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetOffset(VOID); -EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetSearchA(VOID); -EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetSearchW(VOID); -EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetLastError(VOID); -EVERYTHINGUSERAPI HWND EVERYTHINGAPI Everything_GetReplyWindow(VOID); -EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetReplyID(VOID); - -// execute query -EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_QueryA(BOOL bWait); -EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_QueryW(BOOL bWait); - -// query reply -BOOL EVERYTHINGAPI Everything_IsQueryReply(UINT message,WPARAM wParam,LPARAM lParam,DWORD nId); - -// write result state -EVERYTHINGUSERAPI VOID EVERYTHINGAPI Everything_SortResultsByPath(VOID); - -// read result state -EVERYTHINGUSERAPI int EVERYTHINGAPI Everything_GetNumFileResults(VOID); -EVERYTHINGUSERAPI int EVERYTHINGAPI Everything_GetNumFolderResults(VOID); -EVERYTHINGUSERAPI int EVERYTHINGAPI Everything_GetNumResults(VOID); -EVERYTHINGUSERAPI int EVERYTHINGAPI Everything_GetTotFileResults(VOID); -EVERYTHINGUSERAPI int EVERYTHINGAPI Everything_GetTotFolderResults(VOID); -EVERYTHINGUSERAPI int EVERYTHINGAPI Everything_GetTotResults(VOID); -EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsVolumeResult(int nIndex); -EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsFolderResult(int nIndex); -EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsFileResult(int nIndex); -EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultFileNameW(int nIndex); -EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultFileNameA(int nIndex); -EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultPathW(int nIndex); -EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultPathA(int nIndex); -EVERYTHINGUSERAPI int Everything_GetResultFullPathNameW(int nIndex,LPWSTR wbuf,int wbuf_size_in_wchars); -EVERYTHINGUSERAPI int Everything_GetResultFullPathNameA(int nIndex,LPSTR buf,int bufsize); -EVERYTHINGUSERAPI VOID Everything_Reset(VOID); - -#ifdef UNICODE -#define Everything_SetSearch Everything_SetSearchW -#define Everything_GetSearch Everything_GetSearchW -#define Everything_Query Everything_QueryW -#define Everything_GetResultFileName Everything_GetResultFileNameW -#define Everything_GetResultPath Everything_GetResultPathW -#else -#define Everything_SetSearch Everything_SetSearchA -#define Everything_GetSearch Everything_GetSearchA -#define Everything_Query Everything_QueryA -#define Everything_GetResultFileName Everything_GetResultFileNameA -#define Everything_GetResultPath Everything_GetResultPathA -#endif - - -#endif - diff --git a/Plugins/Wox.Plugin.Everything/nativesrc/Everything_IPC.h b/Plugins/Wox.Plugin.Everything/nativesrc/Everything_IPC.h deleted file mode 100644 index 3c2af015e9..0000000000 --- a/Plugins/Wox.Plugin.Everything/nativesrc/Everything_IPC.h +++ /dev/null @@ -1,287 +0,0 @@ - -// Everything IPC - -#ifndef _EVERYTHING_IPC_H_ -#define _EVERYTHING_IPC_H_ - -// C -#ifdef __cplusplus -extern "C" { -#endif - -// 1 byte packing for our varible sized structs -#pragma pack(push, 1) - -// WM_USER (send to the taskbar notification window) -// SendMessage(FindWindow(EVERYTHING_IPC_WNDCLASS,0),WM_USER,EVERYTHING_IPC_*,lParam) -// version format: major.minor.revision.build -// example: 1.1.4.309 -#define EVERYTHING_IPC_GET_MAJOR_VERSION 0 // int major_version = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_GET_MAJOR_VERSION,0); -#define EVERYTHING_IPC_GET_MINOR_VERSION 1 // int minor_version = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_GET_MINOR_VERSION,0); -#define EVERYTHING_IPC_GET_REVISION 2 // int revision = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_GET_REVISION,0); -#define EVERYTHING_IPC_GET_BUILD_NUMBER 3 // int build = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_GET_BUILD,0); - -// uninstall options -#define EVERYTHING_IPC_DELETE_START_MENU_SHORTCUTS 100 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_START_MENU_SHORTCUTS,0); -#define EVERYTHING_IPC_DELETE_QUICK_LAUNCH_SHORTCUT 101 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_QUICK_LAUNCH_SHORTCUT,0); -#define EVERYTHING_IPC_DELETE_DESKTOP_SHORTCUT 102 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_DESKTOP_SHORTCUT,0); -#define EVERYTHING_IPC_DELETE_FOLDER_CONTEXT_MENU 103 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_FOLDER_CONTEXT_MENU,0); -#define EVERYTHING_IPC_DELETE_RUN_ON_SYSTEM_STARTUP 104 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_DELETE_RUN_ON_SYSTEM_STARTUP,0); - -// install options -#define EVERYTHING_IPC_CREATE_START_MENU_SHORTCUTS 200 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_START_MENU_SHORTCUTS,0); -#define EVERYTHING_IPC_CREATE_QUICK_LAUNCH_SHORTCUT 201 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_QUICK_LAUNCH_SHORTCUT,0); -#define EVERYTHING_IPC_CREATE_DESKTOP_SHORTCUT 202 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_DESKTOP_SHORTCUT,0); -#define EVERYTHING_IPC_CREATE_FOLDER_CONTEXT_MENU 203 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_FOLDER_CONTEXT_MENU,0); -#define EVERYTHING_IPC_CREATE_RUN_ON_SYSTEM_STARTUP 204 // SendMessage(hwnd,WM_USER,EVERYTHING_IPC_CREATE_RUN_ON_SYSTEM_STARTUP,0); - -// get option status; 0 = no, 1 = yes, 2 = indeterminate (partially installed) -#define EVERYTHING_IPC_IS_START_MENU_SHORTCUTS 300 // int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_START_MENU_SHORTCUTS,0); -#define EVERYTHING_IPC_IS_QUICK_LAUNCH_SHORTCUT 301 // int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_QUICK_LAUNCH_SHORTCUT,0); -#define EVERYTHING_IPC_IS_DESKTOP_SHORTCUT 302 // int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_DESKTOP_SHORTCUT,0); -#define EVERYTHING_IPC_IS_FOLDER_CONTEXT_MENU 303 // int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_FOLDER_CONTEXT_MENU,0); -#define EVERYTHING_IPC_IS_RUN_ON_SYSTEM_STARTUP 304 // int ret = (int)SendMessage(hwnd,WM_USER,EVERYTHING_IPC_IS_RUN_ON_SYSTEM_STARTUP,0); - -// find the everything window -#define EVERYTHING_IPC_WNDCLASS TEXT("EVERYTHING_TASKBAR_NOTIFICATION") - -// find a everything search window -#define EVERYTHING_IPC_SEARCH_WNDCLASS TEXT("EVERYTHING") - -// this global window message is sent to all top level windows when everything starts. -#define EVERYTHING_IPC_CREATED TEXT("EVERYTHING_IPC_CREATED") - -// search flags for querys -#define EVERYTHING_IPC_MATCHCASE 0x00000001 // match case -#define EVERYTHING_IPC_MATCHWHOLEWORD 0x00000002 // match whole word -#define EVERYTHING_IPC_MATCHPATH 0x00000004 // include paths in search -#define EVERYTHING_IPC_REGEX 0x00000008 // enable regex - -// item flags -#define EVERYTHING_IPC_FOLDER 0x00000001 // The item is a folder. (its a file if not set) -#define EVERYTHING_IPC_DRIVE 0x00000002 // The folder is a drive. Path will be an empty string. - // (will also have the folder bit set) - -// the WM_COPYDATA message for a query. -#define EVERYTHING_IPC_COPYDATAQUERYA 1 -#define EVERYTHING_IPC_COPYDATAQUERYW 2 - -// all results -#define EVERYTHING_IPC_ALLRESULTS 0xFFFFFFFF // all results - -// macro to get the filename of an item -#define EVERYTHING_IPC_ITEMFILENAMEA(list,item) (CHAR *)((CHAR *)(list) + ((EVERYTHING_IPC_ITEMA *)(item))->filename_offset) -#define EVERYTHING_IPC_ITEMFILENAMEW(list,item) (WCHAR *)((CHAR *)(list) + ((EVERYTHING_IPC_ITEMW *)(item))->filename_offset) - -// macro to get the path of an item -#define EVERYTHING_IPC_ITEMPATHA(list,item) (CHAR *)((CHAR *)(list) + ((EVERYTHING_IPC_ITEMW *)(item))->path_offset) -#define EVERYTHING_IPC_ITEMPATHW(list,item) (WCHAR *)((CHAR *)(list) + ((EVERYTHING_IPC_ITEMW *)(item))->path_offset) - -// -// Varible sized query struct sent to everything. -// -// sent in the form of a WM_COPYDAYA message with EVERYTHING_IPC_COPYDATAQUERY as the -// dwData member in the COPYDATASTRUCT struct. -// set the lpData member of the COPYDATASTRUCT struct to point to your EVERYTHING_IPC_QUERY struct. -// set the cbData member of the COPYDATASTRUCT struct to the size of the -// EVERYTHING_IPC_QUERY struct minus the size of a CHAR plus the length of the search string in bytes plus -// one CHAR for the null terminator. -// -// NOTE: to determine the size of this structure use -// ASCII: sizeof(EVERYTHING_IPC_QUERYA) - sizeof(CHAR) + strlen(search_string)*sizeof(CHAR) + sizeof(CHAR) -// UNICODE: sizeof(EVERYTHING_IPC_QUERYW) - sizeof(WCHAR) + unicode_length_in_wchars(search_string)*sizeof(WCHAR) + sizeof(WCHAR) -// -// NOTE: Everything will only do one query per window. -// Sending another query when a query has not completed -// will cancel the old query and start the new one. -// -// Everything will send the results to the reply_hwnd in the form of a -// WM_COPYDAYA message with the dwData value you specify. -// -// Everything will return TRUE if successful. -// returns FALSE if not supported. -// -// If you query with EVERYTHING_IPC_COPYDATAQUERYW, the results sent from Everything will be Unicode. -// - -typedef struct EVERYTHING_IPC_QUERYW -{ - // the window that will receive the new results. - INT32 reply_hwnd; - - // the value to set the dwData member in the COPYDATASTRUCT struct - // sent by Everything when the query is complete. - INT32 reply_copydata_message; - - // search flags (see EVERYTHING_MATCHCASE | EVERYTHING_MATCHWHOLEWORD | EVERYTHING_MATCHPATH) - INT32 search_flags; - - // only return results after 'offset' results (0 to return the first result) - // useful for scrollable lists - INT32 offset; - - // the number of results to return - // zero to return no results - // EVERYTHING_IPC_ALLRESULTS to return ALL results - INT32 max_results; - - // null terminated string. arbitrary sized search_string buffer. - INT32 search_string[1]; - -}EVERYTHING_IPC_QUERYW; - -// ASCII version -typedef struct EVERYTHING_IPC_QUERYA -{ - // the window that will receive the new results. - INT32 reply_hwnd; - - // the value to set the dwData member in the COPYDATASTRUCT struct - // sent by Everything when the query is complete. - INT32 reply_copydata_message; - - // search flags (see EVERYTHING_MATCHCASE | EVERYTHING_MATCHWHOLEWORD | EVERYTHING_MATCHPATH) - INT32 search_flags; - - // only return results after 'offset' results (0 to return the first result) - // useful for scrollable lists - INT32 offset; - - // the number of results to return - // zero to return no results - // EVERYTHING_IPC_ALLRESULTS to return ALL results - INT32 max_results; - - // null terminated string. arbitrary sized search_string buffer. - INT32 search_string[1]; - -}EVERYTHING_IPC_QUERYA; - -// -// Varible sized result list struct received from Everything. -// -// Sent in the form of a WM_COPYDATA message to the hwnd specifed in the -// EVERYTHING_IPC_QUERY struct. -// the dwData member of the COPYDATASTRUCT struct will match the sent -// reply_copydata_message member in the EVERYTHING_IPC_QUERY struct. -// -// make a copy of the data before returning. -// -// return TRUE if you processed the WM_COPYDATA message. -// - -typedef struct EVERYTHING_IPC_ITEMW -{ - // item flags - DWORD flags; - - // The offset of the filename from the beginning of the list structure. - // (wchar_t *)((char *)everything_list + everythinglist->name_offset) - DWORD filename_offset; - - // The offset of the filename from the beginning of the list structure. - // (wchar_t *)((char *)everything_list + everythinglist->path_offset) - DWORD path_offset; - -}EVERYTHING_IPC_ITEMW; - -typedef struct EVERYTHING_IPC_ITEMA -{ - // item flags - DWORD flags; - - // The offset of the filename from the beginning of the list structure. - // (char *)((char *)everything_list + everythinglist->name_offset) - DWORD filename_offset; - - // The offset of the filename from the beginning of the list structure. - // (char *)((char *)everything_list + everythinglist->path_offset) - DWORD path_offset; - -}EVERYTHING_IPC_ITEMA; - -typedef struct EVERYTHING_IPC_LISTW -{ - // the total number of folders found. - DWORD totfolders; - - // the total number of files found. - DWORD totfiles; - - // totfolders + totfiles - DWORD totitems; - - // the number of folders available. - DWORD numfolders; - - // the number of files available. - DWORD numfiles; - - // the number of items available. - DWORD numitems; - - // index offset of the first result in the item list. - DWORD offset; - - // arbitrary sized item list. - // use numitems to determine the actual number of items available. - EVERYTHING_IPC_ITEMW items[1]; - -}EVERYTHING_IPC_LISTW; - -typedef struct EVERYTHING_IPC_LISTA -{ - // the total number of folders found. - DWORD totfolders; - - // the total number of files found. - DWORD totfiles; - - // totfolders + totfiles - DWORD totitems; - - // the number of folders available. - DWORD numfolders; - - // the number of files available. - DWORD numfiles; - - // the number of items available. - DWORD numitems; - - // index offset of the first result in the item list. - DWORD offset; - - // arbitrary sized item list. - // use numitems to determine the actual number of items available. - EVERYTHING_IPC_ITEMA items[1]; - -}EVERYTHING_IPC_LISTA; - -#ifdef UNICODE -#define EVERYTHING_IPC_COPYDATAQUERY EVERYTHING_IPC_COPYDATAQUERYW -#define EVERYTHING_IPC_ITEMFILENAME EVERYTHING_IPC_ITEMFILENAMEW -#define EVERYTHING_IPC_ITEMPATH EVERYTHING_IPC_ITEMPATHW -#define EVERYTHING_IPC_QUERY EVERYTHING_IPC_QUERYW -#define EVERYTHING_IPC_ITEM EVERYTHING_IPC_ITEMW -#define EVERYTHING_IPC_LIST EVERYTHING_IPC_LISTW -#else -#define EVERYTHING_IPC_COPYDATAQUERY EVERYTHING_IPC_COPYDATAQUERYA -#define EVERYTHING_IPC_ITEMFILENAME EVERYTHING_IPC_ITEMFILENAMEA -#define EVERYTHING_IPC_ITEMPATH EVERYTHING_IPC_ITEMPATHA -#define EVERYTHING_IPC_QUERY EVERYTHING_IPC_QUERYA -#define EVERYTHING_IPC_ITEM EVERYTHING_IPC_ITEMA -#define EVERYTHING_IPC_LIST EVERYTHING_IPC_LISTA -#endif - - -// restore packing -#pragma pack(pop) - -// end extern C -#ifdef __cplusplus -} -#endif - -#endif // _EVERYTHING_H_ - diff --git a/Plugins/Wox.Plugin.Everything/nativesrc/dll.sln b/Plugins/Wox.Plugin.Everything/nativesrc/dll.sln deleted file mode 100644 index 5f394cb794..0000000000 --- a/Plugins/Wox.Plugin.Everything/nativesrc/dll.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll", "dll.vcxproj", "{7C90030E-6EDB-445E-A61B-5540B7355C59}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7C90030E-6EDB-445E-A61B-5540B7355C59}.Debug|Win32.ActiveCfg = Debug|x64 - {7C90030E-6EDB-445E-A61B-5540B7355C59}.Debug|Win32.Build.0 = Debug|x64 - {7C90030E-6EDB-445E-A61B-5540B7355C59}.Debug|x64.ActiveCfg = Debug|x64 - {7C90030E-6EDB-445E-A61B-5540B7355C59}.Debug|x64.Build.0 = Debug|x64 - {7C90030E-6EDB-445E-A61B-5540B7355C59}.Release|Win32.ActiveCfg = Release|Win32 - {7C90030E-6EDB-445E-A61B-5540B7355C59}.Release|Win32.Build.0 = Release|Win32 - {7C90030E-6EDB-445E-A61B-5540B7355C59}.Release|x64.ActiveCfg = Release|x64 - {7C90030E-6EDB-445E-A61B-5540B7355C59}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Plugins/Wox.Plugin.Everything/nativesrc/dll.vcxproj b/Plugins/Wox.Plugin.Everything/nativesrc/dll.vcxproj deleted file mode 100644 index ebc74b25e3..0000000000 --- a/Plugins/Wox.Plugin.Everything/nativesrc/dll.vcxproj +++ /dev/null @@ -1,291 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {7C90030E-6EDB-445E-A61B-5540B7355C59} - dll - Win32Proj - - - - DynamicLibrary - false - MultiByte - v90 - - - DynamicLibrary - MultiByte - v90 - - - DynamicLibrary - false - MultiByte - v90 - - - DynamicLibrary - MultiByte - v90 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - Debug\ - Debug\ - true - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - Release\ - Release\ - false - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - false - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - - Disabled - %(AdditionalIncludeDirectories) - BZ_NO_STDIO;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - $(OutDir)Everything.dll - - - true - true - Console - 0 - true - true - false - - - MachineX86 - - - %(AdditionalManifestFiles) - - - - - X64 - - - Disabled - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - CompileAsC - - - ComCtl32.lib;UxTheme.lib;Ws2_32.lib;shlwapi.lib;ole32.lib;htmlhelp.lib;%(AdditionalDependencies) - $(OutDir)Everything.dll - true - $(OutDir)dll.pdb - Console - false - - - MachineX64 - - - %(AdditionalManifestFiles) - - - - - - - - - MaxSpeed - AnySuitable - true - Speed - false - false - %(AdditionalIncludeDirectories) - BZ_NO_STDIO;%(PreprocessorDefinitions) - true - Sync - Default - MultiThreaded - true - Fast - - - Level3 - - - Cdecl - CompileAsC - - - - - - - true - - - NotSet - $(OutDir)Everything.dll - %(AdditionalManifestDependencies) - false - everything.def - false - true - Windows - 0 - true - true - - - false - - - MachineX86 - - - %(AdditionalManifestFiles) - false - false - - - - - - - - - X64 - - - MaxSpeed - AnySuitable - true - Speed - false - false - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - - - Default - MultiThreaded - true - Fast - - - Level3 - - - CompileAsC - - - true - - - comctl32.lib;UxTheme.lib;Ws2_32.lib;HTMLHelp.lib;msimg32.lib;%(AdditionalDependencies) - NotSet - $(OutDir)Everything.dll - %(AdditionalManifestDependencies) - false - true - Windows - true - true - - - false - - - MachineX64 - - - %(AdditionalManifestFiles) - false - false - - - - - - - - - - - - - - - - diff --git a/Plugins/Wox.Plugin.Everything/nativesrc/dll.vcxproj.filters b/Plugins/Wox.Plugin.Everything/nativesrc/dll.vcxproj.filters deleted file mode 100644 index 93496a8d7d..0000000000 --- a/Plugins/Wox.Plugin.Everything/nativesrc/dll.vcxproj.filters +++ /dev/null @@ -1,27 +0,0 @@ - - - - - {072e536f-0b4e-4b52-bbf4-45486ca2a90b} - cpp;c;cxx;def;odl;idl;hpj;bat;asm - - - - - src - - - - - src - - - - - src - - - src - - - \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Everything/plugin.json b/Plugins/Wox.Plugin.Everything/plugin.json deleted file mode 100644 index f2548edfb0..0000000000 --- a/Plugins/Wox.Plugin.Everything/plugin.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "ID":"D2D2C23B084D411DB66FE0C79D6C2A6E", - "ActionKeyword":"ev", - "Name":"Wox.Plugin.Everything", - "Description":"Search Everything", - "Author":"orzfly", - "Version":"1.0", - "Language":"csharp", - "Website":"http://www.getwox.com", - "ExecuteFileName":"Wox.Plugin.Everything.dll" -} diff --git a/Plugins/Wox.Plugin.Everything/x64/Everything.dll b/Plugins/Wox.Plugin.Everything/x64/Everything.dll deleted file mode 100644 index 2b7abd03cb..0000000000 Binary files a/Plugins/Wox.Plugin.Everything/x64/Everything.dll and /dev/null differ diff --git a/Plugins/Wox.Plugin.Everything/x86/Everything.dll b/Plugins/Wox.Plugin.Everything/x86/Everything.dll deleted file mode 100644 index c0c1fe792b..0000000000 Binary files a/Plugins/Wox.Plugin.Everything/x86/Everything.dll and /dev/null differ diff --git a/Plugins/Wox.Plugin.Youdao/HttpRequest.cs b/Plugins/Wox.Plugin.Youdao/HttpRequest.cs deleted file mode 100644 index 8d0939e1ed..0000000000 --- a/Plugins/Wox.Plugin.Youdao/HttpRequest.cs +++ /dev/null @@ -1,135 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Security; -using System.Security.Cryptography.X509Certificates; -using System.Text; - -//From:http://blog.csdn.net/zhoufoxcn/article/details/6404236 -namespace Wox.Plugin.Fanyi -{ - /// - /// 有关HTTP请求的辅助类 - /// - public class HttpRequest - { - private static readonly string DefaultUserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"; - /// - /// 创建GET方式的HTTP请求 - /// - /// 请求的URL - /// 请求的超时时间 - /// 请求的客户端浏览器信息,可以为空 - /// 随同HTTP请求发送的Cookie信息,如果不需要身份验证可以为空 - /// - public static HttpWebResponse CreateGetHttpResponse(string url, int? timeout, string userAgent, CookieCollection cookies) - { - if (string.IsNullOrEmpty(url)) - { - throw new ArgumentNullException("url"); - } - HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; - request.Method = "GET"; - request.UserAgent = DefaultUserAgent; - if (!string.IsNullOrEmpty(userAgent)) - { - request.UserAgent = userAgent; - } - if (timeout.HasValue) - { - request.Timeout = timeout.Value; - } - if (cookies != null) - { - request.CookieContainer = new CookieContainer(); - request.CookieContainer.Add(cookies); - } - return request.GetResponse() as HttpWebResponse; - } - /// - /// 创建POST方式的HTTP请求 - /// - /// 请求的URL - /// 随同请求POST的参数名称及参数值字典 - /// 请求的超时时间 - /// 请求的客户端浏览器信息,可以为空 - /// 发送HTTP请求时所用的编码 - /// 随同HTTP请求发送的Cookie信息,如果不需要身份验证可以为空 - /// - public static HttpWebResponse CreatePostHttpResponse(string url, IDictionary parameters, int? timeout, string userAgent, Encoding requestEncoding, CookieCollection cookies) - { - if (string.IsNullOrEmpty(url)) - { - throw new ArgumentNullException("url"); - } - if (requestEncoding == null) - { - throw new ArgumentNullException("requestEncoding"); - } - HttpWebRequest request = null; - //如果是发送HTTPS请求 - if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase)) - { - ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult); - request = WebRequest.Create(url) as HttpWebRequest; - request.ProtocolVersion = HttpVersion.Version10; - } - else - { - request = WebRequest.Create(url) as HttpWebRequest; - } - request.Method = "POST"; - request.ContentType = "application/x-www-form-urlencoded"; - - if (!string.IsNullOrEmpty(userAgent)) - { - request.UserAgent = userAgent; - } - else - { - request.UserAgent = DefaultUserAgent; - } - - if (timeout.HasValue) - { - request.Timeout = timeout.Value; - } - if (cookies != null) - { - request.CookieContainer = new CookieContainer(); - request.CookieContainer.Add(cookies); - } - //如果需要POST数据 - if (!(parameters == null || parameters.Count == 0)) - { - StringBuilder buffer = new StringBuilder(); - int i = 0; - foreach (string key in parameters.Keys) - { - if (i > 0) - { - buffer.AppendFormat("&{0}={1}", key, parameters[key]); - } - else - { - buffer.AppendFormat("{0}={1}", key, parameters[key]); - } - i++; - } - byte[] data = requestEncoding.GetBytes(buffer.ToString()); - using (Stream stream = request.GetRequestStream()) - { - stream.Write(data, 0, data.Length); - } - } - return request.GetResponse() as HttpWebResponse; - } - - private static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) - { - return true; //总是接受 - } - } -} diff --git a/Plugins/Wox.Plugin.Youdao/Images/youdao.ico b/Plugins/Wox.Plugin.Youdao/Images/youdao.ico deleted file mode 100644 index 833009ae0d..0000000000 Binary files a/Plugins/Wox.Plugin.Youdao/Images/youdao.ico and /dev/null differ diff --git a/Plugins/Wox.Plugin.Youdao/Main.cs b/Plugins/Wox.Plugin.Youdao/Main.cs deleted file mode 100644 index 8ad7bb19f9..0000000000 --- a/Plugins/Wox.Plugin.Youdao/Main.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Text; -using Newtonsoft.Json; -using Wox.Plugin.Fanyi; - -namespace Wox.Plugin.Youdao -{ - public class TranslateResult - { - public int errorCode { get; set; } - public List translation { get; set; } - public BasicTranslation basic { get; set; } - public List web { get; set; } - } - - // 有道词典-基本词典 - public class BasicTranslation - { - public string phonetic { get; set; } - public List explains { get; set; } - } - - public class WebTranslation - { - public string key { get; set; } - public List value { get; set; } - } - - public class Main : IPlugin - { - private string translateURL = "http://fanyi.youdao.com/openapi.do?keyfrom=WoxLauncher&key=1247918016&type=data&doctype=json&version=1.1&q="; - - public List Query(Query query) - { - List results = new List(); - if (query.ActionParameters.Count == 0) - { - results.Add(new Result() - { - Title = "Start to translate between Chinese and English", - SubTitle = "Powered by youdao api", - IcoPath = "Images\\youdao.ico" - }); - return results; - } - - HttpWebResponse response = HttpRequest.CreatePostHttpResponse(translateURL + query.GetAllRemainingParameter(), null, null, null, Encoding.UTF8, null); - Stream s = response.GetResponseStream(); - if (s != null) - { - StreamReader reader = new StreamReader(s, Encoding.UTF8); - string json = reader.ReadToEnd(); - TranslateResult o = JsonConvert.DeserializeObject(json); - if (o.errorCode == 0) - { - if (o.basic != null && o.basic.phonetic != null) - { - results.Add(new Result() - { - Title = o.basic.phonetic, - SubTitle = string.Join(",", o.basic.explains.ToArray()), - IcoPath = "Images\\youdao.ico", - }); - } - foreach (string t in o.translation) - { - results.Add(new Result() - { - Title = t, - IcoPath = "Images\\youdao.ico", - }); - } - if (o.web != null) - { - foreach (WebTranslation t in o.web) - { - results.Add(new Result() - { - Title = t.key, - SubTitle = string.Join(",", t.value.ToArray()), - IcoPath = "Images\\youdao.ico", - }); - } - } - } - else - { - string error = string.Empty; - switch (o.errorCode) - { - case 20: - error = "要翻译的文本过长"; - break; - - case 30: - error = "无法进行有效的翻译"; - break; - - case 40: - error = "不支持的语言类型"; - break; - - case 50: - error = "无效的key"; - break; - } - - results.Add(new Result() - { - Title = error, - IcoPath = "Images\\youdao.ico", - }); - } - } - - return results; - } - - public void Init(PluginInitContext context) - { - - } - } -} diff --git a/Plugins/Wox.Plugin.Youdao/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Youdao/Properties/AssemblyInfo.cs deleted file mode 100644 index 0b6242ff8e..0000000000 --- a/Plugins/Wox.Plugin.Youdao/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// 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("Wox.Plugin.Youdao")] -[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.Youdao")] -[assembly: AssemblyCopyright("The MIT License (MIT)")] -[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("e42a24ab-7eff-46e8-ae37-f85bc08de1b8")] - -// 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")] diff --git a/Plugins/Wox.Plugin.Youdao/Wox.Plugin.Youdao.csproj b/Plugins/Wox.Plugin.Youdao/Wox.Plugin.Youdao.csproj deleted file mode 100644 index 38e9db6541..0000000000 --- a/Plugins/Wox.Plugin.Youdao/Wox.Plugin.Youdao.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - - Debug - AnyCPU - {AE02E18E-2134-472B-9282-32CDE36B5F0C} - Library - Properties - Wox.Plugin.Youdao - Wox.Plugin.Youdao - v3.5 - 512 - ..\..\ - true - - - true - full - false - ..\..\Output\Debug\Plugins\Wox.Plugin.Youdao\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - ..\..\Output\Release\Plugins\Wox.Plugin.Youdao\ - TRACE - prompt - 4 - - - - ..\..\packages\Newtonsoft.Json.5.0.8\lib\net35\Newtonsoft.Json.dll - - - - - - - - - - - - - - - - - PreserveNewest - - - - - PreserveNewest - - - - - {8451ECDD-2EA4-4966-BB0A-7BBC40138E80} - Wox.Plugin - - - - - - - - - - - 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 - - - - - \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Youdao/packages.config b/Plugins/Wox.Plugin.Youdao/packages.config deleted file mode 100644 index 9520f36d83..0000000000 --- a/Plugins/Wox.Plugin.Youdao/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Youdao/plugin.json b/Plugins/Wox.Plugin.Youdao/plugin.json deleted file mode 100644 index b7cd112211..0000000000 --- a/Plugins/Wox.Plugin.Youdao/plugin.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "ID":"095A6AE3A254432EBBD78F05A71D4981", - "ActionKeyword":"yd", - "Name":"Youdao Translator", - "Description":"Translate Chinese and English", - "Author":"qianlifeng", - "Version":"1.0", - "Language":"csharp", - "Website":"http://www.getwox.com", - "ExecuteFileName":"Wox.Plugin.Youdao.dll" -} diff --git a/Wox.sln b/Wox.sln index 3225533184..6367f1e6fa 100644 --- a/Wox.sln +++ b/Wox.sln @@ -13,22 +13,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox", "Wox\Wox.csproj", "{D EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.System", "Wox.Plugin.System\Wox.Plugin.System.csproj", "{69CE0206-CB41-453D-88AF-DF86092EF9B8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Fanyi", "Plugins\Wox.Plugin.Fanyi\Wox.Plugin.Fanyi.csproj", "{353769D3-D11C-4D86-BD06-AC8C1D68642B}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Python.Runtime", "Pythonnet.Runtime\Python.Runtime.csproj", "{097B4AC0-74E9-4C58-BCF8-C69746EC8271}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Infrastructure", "Wox.Infrastructure\Wox.Infrastructure.csproj", "{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Everything", "Plugins\Wox.Plugin.Everything\Wox.Plugin.Everything.csproj", "{230AE83F-E92E-4E69-8355-426B305DA9C0}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.UAC", "Wox.UAC\Wox.UAC.csproj", "{C9BC17A0-C2BC-4185-AC1F-32E3352C1233}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Clipboard", "Plugins\Wox.Plugin.Clipboard\Wox.Plugin.Clipboard.csproj", "{8C14DC11-2737-4DCB-A121-5D7BDD57FEA2}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.PluginManagement", "Plugins\Wox.Plugin.PluginManagement\Wox.Plugin.PluginManagement.csproj", "{049490F0-ECD2-4148-9B39-2135EC346EBE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Youdao", "Plugins\Wox.Plugin.Youdao\Wox.Plugin.Youdao.csproj", "{AE02E18E-2134-472B-9282-32CDE36B5F0C}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -51,10 +43,6 @@ Global {69CE0206-CB41-453D-88AF-DF86092EF9B8}.Debug|Any CPU.Build.0 = Debug|Any CPU {69CE0206-CB41-453D-88AF-DF86092EF9B8}.Release|Any CPU.ActiveCfg = Release|Any CPU {69CE0206-CB41-453D-88AF-DF86092EF9B8}.Release|Any CPU.Build.0 = Release|Any CPU - {353769D3-D11C-4D86-BD06-AC8C1D68642B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {353769D3-D11C-4D86-BD06-AC8C1D68642B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {353769D3-D11C-4D86-BD06-AC8C1D68642B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {353769D3-D11C-4D86-BD06-AC8C1D68642B}.Release|Any CPU.Build.0 = Release|Any CPU {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Debug|Any CPU.Build.0 = Debug|Any CPU {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -63,35 +51,19 @@ Global {4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Debug|Any CPU.Build.0 = Debug|Any CPU {4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Release|Any CPU.ActiveCfg = Release|Any CPU {4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Release|Any CPU.Build.0 = Release|Any CPU - {230AE83F-E92E-4E69-8355-426B305DA9C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {230AE83F-E92E-4E69-8355-426B305DA9C0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {230AE83F-E92E-4E69-8355-426B305DA9C0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {230AE83F-E92E-4E69-8355-426B305DA9C0}.Release|Any CPU.Build.0 = Release|Any CPU {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Debug|Any CPU.Build.0 = Debug|Any CPU {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Release|Any CPU.ActiveCfg = Release|Any CPU {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Release|Any CPU.Build.0 = Release|Any CPU - {8C14DC11-2737-4DCB-A121-5D7BDD57FEA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8C14DC11-2737-4DCB-A121-5D7BDD57FEA2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8C14DC11-2737-4DCB-A121-5D7BDD57FEA2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8C14DC11-2737-4DCB-A121-5D7BDD57FEA2}.Release|Any CPU.Build.0 = Release|Any CPU {049490F0-ECD2-4148-9B39-2135EC346EBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {049490F0-ECD2-4148-9B39-2135EC346EBE}.Debug|Any CPU.Build.0 = Debug|Any CPU {049490F0-ECD2-4148-9B39-2135EC346EBE}.Release|Any CPU.ActiveCfg = Release|Any CPU {049490F0-ECD2-4148-9B39-2135EC346EBE}.Release|Any CPU.Build.0 = Release|Any CPU - {AE02E18E-2134-472B-9282-32CDE36B5F0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AE02E18E-2134-472B-9282-32CDE36B5F0C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AE02E18E-2134-472B-9282-32CDE36B5F0C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AE02E18E-2134-472B-9282-32CDE36B5F0C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {353769D3-D11C-4D86-BD06-AC8C1D68642B} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} - {230AE83F-E92E-4E69-8355-426B305DA9C0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} - {8C14DC11-2737-4DCB-A121-5D7BDD57FEA2} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {049490F0-ECD2-4148-9B39-2135EC346EBE} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} - {AE02E18E-2134-472B-9282-32CDE36B5F0C} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} EndGlobalSection EndGlobal