├── .gitignore ├── Build.cmd ├── CMakeLists.txt ├── README.md ├── bin ├── ALMRun.ini ├── LuaEx │ ├── ALMRun.lua │ └── base.lua ├── ShortCutList.txt ├── config │ ├── plugins │ │ ├── Docset.lua │ │ ├── everything.lua │ │ └── sample.lua │ └── sample │ │ ├── common.lua │ │ ├── my_conf.lua │ │ └── plugins.lua ├── lua51.dll └── skin │ ├── altrun.jpg │ ├── altrun.skn │ ├── altrun_demo.png │ ├── medium_camo_demo.png │ ├── medium_silver_short_demo.png │ ├── merry.png │ ├── merry.skn │ ├── merry_demo.png │ ├── merry_selection.png │ ├── merryl.png │ ├── merryl.skn │ ├── skin.txt │ └── small_windowsish_demo.png ├── copyright ├── doc ├── CSIDL.TXT ├── config_api.md ├── key_string.txt └── update.log ├── readme ├── resource ├── asc.ico ├── desc.ico ├── merry.rc ├── merry.xcf ├── merry_icon.ico ├── merry_icon.png └── merry_selection.xcf ├── src ├── ALMRunCommon.cpp ├── ALMRunCommon.h ├── ALMRunConfig.cpp ├── ALMRunConfig.h ├── ALMRunVersion.h ├── Dialog │ ├── DlgAddNewCmd.cpp │ ├── DlgAddNewCmd.h │ ├── DlgAddNewDir.cpp │ ├── DlgAddNewDir.h │ ├── DlgConfig.cpp │ ├── DlgConfig.h │ ├── DlgParam.cpp │ ├── DlgParam.h │ ├── HotkeyCtrl.cpp │ ├── HotkeyCtrl.h │ ├── cmdListCtrl.cpp │ ├── cmdListCtrl.h │ ├── cmdmgr.cpp │ ├── cmdmgr.h │ ├── cut.xpm │ ├── find.xpm │ ├── folder.xpm │ ├── import.xpm │ ├── open.xpm │ └── paste.xpm ├── MerryApp.cpp ├── MerryApp.h ├── MerryCommand.cpp ├── MerryCommand.h ├── MerryCommandManager.cpp ├── MerryCommandManager.h ├── MerryController.cpp ├── MerryController.h ├── MerryControllerLinux.cpp ├── MerryControllerMac.mm ├── MerryControllerWindows.cpp ├── MerryError.cpp ├── MerryError.h ├── MerryFrame.cpp ├── MerryFrame.h ├── MerryHelper.cpp ├── MerryHelper.h ├── MerryHotkey.cpp ├── MerryHotkey.h ├── MerryHotkeyWx.cpp ├── MerryHotkeyWx.h ├── MerryHotkeyX.cpp ├── MerryHotkeyX.h ├── MerryIcon.xpm ├── MerryInformationDialog.cpp ├── MerryInformationDialog.h ├── MerryKey.cpp ├── MerryKey.h ├── MerryListBoxPanel.cpp ├── MerryListBoxPanel.h ├── MerryLua.cpp ├── MerryLua.h ├── MerryLuaExport.h ├── MerryMacHelper.h ├── MerryMacHelper.mm ├── MerryMainPanel.cpp ├── MerryMainPanel.h ├── MerryTaskBarIcon.cpp ├── MerryTaskBarIcon.h ├── MerryTextCtrl.cpp ├── MerryTextCtrl.h ├── MerryTimer.cpp ├── MerryTimer.h ├── MerryTimerManager.cpp ├── MerryTimerManager.h ├── MerryWx.h ├── MyTextCompleter.cpp ├── MyTextCompleter.h ├── SkinConfig.cpp ├── SkinConfig.h ├── stServer.cpp └── stServer.h └── third_party ├── Everything-SDK ├── dll │ ├── Everything32.dll │ └── Everything64.dll ├── example │ ├── CSharp │ │ ├── Form1.Designer.cs │ │ ├── Form1.cs │ │ ├── Form1.resx │ │ ├── Program.cs │ │ ├── Properties │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ ├── Settings.Designer.cs │ │ │ └── Settings.settings │ │ ├── WindowsApplication1.csproj │ │ └── WindowsApplication1.suo │ ├── dll.test.c │ └── dll.test.cpp ├── include │ └── Everything.h ├── ipc │ └── everything_ipc.h ├── lib │ └── Everything.lib ├── src │ ├── Everything.c │ └── Everything.def └── vs │ ├── sdk.dll.test.c.vcproj │ ├── sdk.dll.test.cpp.vcproj │ └── sdk.dll.vcproj ├── lua ├── linux64 │ └── include │ │ ├── lauxlib.h │ │ ├── lua.h │ │ ├── lua.hpp │ │ ├── luaconf.h │ │ ├── luajit.h │ │ └── lualib.h ├── macos │ └── include │ │ ├── lauxlib.h │ │ ├── lua.h │ │ ├── lua.hpp │ │ ├── luaconf.h │ │ ├── luajit.h │ │ └── lualib.h └── win32 │ ├── debug │ └── lua51.lib │ ├── include │ ├── lauxlib.h │ ├── lua.h │ ├── lua.hpp │ ├── luaconf.h │ ├── luajit.h │ └── lualib.h │ ├── release │ └── lua51.lib │ └── static │ └── lua51.lib └── vld ├── include ├── vld.h └── vld_def.h ├── win32 └── debug │ └── vld.lib └── win64 └── debug └── vld.lib /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | 15 | build/ -------------------------------------------------------------------------------- /Build.cmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/Build.cmd -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/CMakeLists.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ALMRun 2 | ======= 3 | ******* 4 | [ALMRun]是一个快速启动软件,小巧绿色,简单易用,随用随忘,只要开启了它,完全不用在意到它的存在,你需要的时候随叫随到。 5 | 6 | 基本功能: 快速启动,热键管理. 7 | 扩展功能: 使用LUA脚本来进行功能扩展,程序内置一些常用的API可直接调用(比如模拟键盘或鼠标输入、窗口管理、自动登录等),使用[luajit]作为LUA引擎,功能强大。 8 | 出生日期: 2013-03-31 9 | 10 | 源自[Merry],结合了[ALTRun]的优点,经过多次改进增强,现在基本上[ALTRun]上面可以实现的功能,使用`ALMRun`都可以实现了,并且`ALMRun`直接支持`ALTRun`的配置文件,并保持和`ALTRun`一样的使用使用习惯,很容易就可以直接上手。 11 | 12 | * [基本功能](#ALMRUN_BASE) 13 | * [扩展功能](#ALMRun_Advanced) 14 | * [相关资源](#ALMRun_resource) 15 | * [更新记录] 16 | * [API 参考](https://github.com/chenall/ALMRun/blob/master/doc/config_api.md) 17 | * [程序下载](https://github.com/chenall/ALMRun/releases) 18 | 19 |

20 | ALMRun Base 基本功能 21 | ==================== 22 | ******************** 23 | * 程序相关快捷键 24 | * `ALT+R`(全局)    隐藏激活程序(可在参数配置中修改) 25 | * `ALT+L`(全局)    运行上一个命令(可改) 26 | * `Alt+C`       打开参数配置界面 27 | * `Alt+S`       打开命令管理器 28 | * `Alt+X`       退出程序 29 | * `Tab`        选定条目,并且进入输入参数模式。 30 | * `Ctrl+N/Alt+N`   N=0-9,启动列表中对应的条目 31 | * `Insert`      添加新的命令 (菜单: **添加**) 32 | * `F2`        编辑当前项目 (菜单: **编辑**) 33 | * `CTRL+D`      自动定位所选条目的文件位置,方便查找(菜单: **定位**) 34 | * `Shift+Enter`   以其它户用运行当前项目(菜单: **运行为**) 35 | * `Enter`      启动程序 36 | * `F1`        显示关于窗口 37 | * 基本操作 38 | 39 | 输入要启动的程序名(支持任意位置匹配和中文首字母识别),筛选过虑列表清单。然后根据列表框选择要启动的程序,如果需要输入参数可按`Tab`键,否则直接启动程序。如果在配置中勾选了“允许数字快捷键“,还支持直接按数字键0-9来启动,或按空格键来启动当前选择条目。 40 | * 其它操作 41 | * 程序主窗口(图标): 右键可以进行参数配置、命令管理、退出,刷新命令等操作。 42 | * 列表框:右键可以对命令进行管添加、修改、删除、定位。 43 | * 命令管理窗口:列表框右键,编辑、删除指定命令,按`Insert`键添加命令,按`Delete`键删除当前选择命令,双击某个条目可以修改,支持拖放方式。暂不支持管理自动扫描目录。 44 | * 支持拖放或右键发送到 45 | 如果选择了多个文件或目录,则不弹出窗口,自动批量添加。 46 | 47 | * 在命令中可以使用的一些特殊参数: 这些执行时会替换为相应的内容 48 | * **{%p}/{%p+}**  用户输入的参数*{%p+}*是强制型参数,有*{%p+}*的命令执行时一定要输入参数。 49 | * **{%c}**      剪贴板内容 50 | * **{%wt}**     当前窗口的标题 51 | * **{%wd}**     当前窗口的句柄(>1.2.0.59) 52 | * **'@'/'>'/'+'**    在命令中前置时有效 53 | >前置'@' 隐藏执行, 54 | 前置'>' 请求管理员权限有(NT6或以上有效) 55 | 前置`+` 必需输入参数 56 | 也可以组合使用 57 | 例子(以管理员权限隐藏执行notepad.exe): ">@notepad.exe“ 58 | 59 | * 内置环境变量 60 | * `%ALMRUN_SYS%` 操作系统类型,值为x86或x64 61 | * `%ALMRUN_HOME%` (ALMRUN程序所在目录) 62 | * `%ALMRUN_DRIVE%` (ALMRUN程序所在磁盘比如C:) 63 | * `%ALMRUN_ROOT%` (ALMRUN默认根目录,可用config和ROOT参数修改) 64 | * `%ALMRUN_EXPLORER%` (默认文件管理器,使用了config的Explorer参数之后有效) 65 | * `%Desktop%` 当前用户桌面文件夹路径 66 | * `%Programs%` 当前用户程序文件夹路径 67 | * `%CommonDesktop%` 所有用户(All Users)桌面文件夹路径 68 | * `%CommonPrograms%` 所有用户(All Users)程序文件夹路径 69 | 70 | * ALTRun 用户 71 | `ALMRun` 可以直接调用`ALTRun`的配置文件(只需要把`ALTRun`的`ShortCutList.txt`复制到ALMRun目录下即可),所以ALTRun用户可以直接转换过来,但是ALMRun无法管理ALTRun的配置文件,所以如果你经过一段时间的使用,习惯了ALMRun的操作,这时可以把ALTRun的配置导入ALMRun中,快速导入方法如下: 72 | 73 | 在命令列表或命令管理器添加一个新的命令,然后在命令中使用浏览操作选择ALTRun的配置文件(`ShortCutList.txt`),再点确定就会弹出一个提示,根据提示进行转换即可,如果你之前已经把`ShortCutList.txt`复制到ALMRun目录下,则需要删除该文件,否则会导致命令重复。 74 | 75 | 76 | * 常用配置直接使用参数配置功能即可,需要一些高级配置打开[bin/ALMRun.ini](https://github.com/chenall/ALMRun/blob/master/bin/ALMRun.ini)里面有更详细的配置介绍. 77 | 78 | 79 | * 主题界面预览 80 | * 仿 ALTRun 主题 81 | 82 | ![altrun](https://raw.githubusercontent.com/chenall/ALMRun/master/bin/skin/altrun_demo.png) 83 | 84 | * Merry 原生界面 85 | 86 | ![merry](https://raw.githubusercontent.com/chenall/ALMRun/master/bin/skin/merry_demo.png) 87 | 88 | * 直接使用Executor 主题效果 89 | 90 | ![medium_silver_short](https://raw.githubusercontent.com/chenall/ALMRun/master/bin/skin/medium_silver_short_demo.png) 91 | 92 | ![medium_camo](https://raw.githubusercontent.com/chenall/ALMRun/master/bin/skin/medium_camo_demo.png) 93 | 94 | ![small_windowsish](https://raw.githubusercontent.com/chenall/ALMRun/master/bin/skin/small_windowsish_demo.png) 95 | 96 |

97 | ALMRun Advanced 扩展功能 98 | ======================== 99 | ************************ 100 | ALMRUN使用[luajit]引擎支持使用LUA脚本进行功能扩展,只需要把你的扩展脚本放在`config`目录下即可,不限文件名,不限子目录(以"_"开头的文件或目录除外) 101 | 扩展能请参考[API 介绍](https://github.com/chenall/ALMRun/blob/master/doc/config_api.md) 102 | 103 | * 使用LUA扩展时需注意: 104 | * Lua脚本有区分大小写,调用API时需要注意大小写 105 | * 对于文件路径的正确写法如下: 详细请考config_api尾部的内容 106 | 1. `"c:/windows/notepad.exe"` 107 | 2. `“c:\\windows\\notepad.exe"` 108 | 3. `[[c:\windows\notepad.exe]]` 109 | * 调用API时建议使用xpcall调用,可以防止由于出现错误导致后续的脚本无法运行 110 | 例子:添加命令,使用了xpcall如果失败时不会中止脚本运行,否则后面的脚本不会执行 111 | 112 | ```lua 113 | --语法xpcall(API,error_hook,API参数) 114 | --其中API就是你要调用的函数,error_hook,是固定的错误提示函数在ALMRun.lua中 115 | xpcall(addCommand,error_hook,{ name = "test",cmd = "cmd.exe /k echo test" }) 116 | ``` 117 | 118 |

119 | Resource 相关资源 120 | ================ 121 | **************** 122 | * 原版: 123 | * 源码: 124 | * 博客: 125 | * 主页: 126 | * Executor: ALMrun 使用了Excutor的主题格式. 127 | * altrun介绍: 可以参考一下,使用方法基本上都是差不多的。 128 | 129 | [Merry]:http://code.google.com/p/name5566-merry/ 130 | [ALTRUN]:https://code.google.com/p/altrun/ 131 | [ALMRUN]:http://almrun.chenall.net/ 132 | [luajit]:http://luajit.org/ 133 | [更新记录]:update_log.html 134 | Requirement(编译环境) 135 | ====================== 136 | vs2012 137 | cmake >= 2.8 138 | wxWidgets >=2.9.5 139 | 140 | Build 编译方法 141 | =================== 142 | 1. 先用下载[wxWidget源码](https://www.wxwidgets.org/downloads/) 143 | 144 | 需要**2.9.5**以上的版本,建议用**3.0.1**版的源码,直接解压到`d:\dev`目录下, 145 | 然后打开`D:\dev\wxWidgets-3.0.1\build\msw\wx_vc11.sln`文件编译 **Release** 和 **Debug** 两个版本,直接编译就行了. 146 | 147 | 2. 下载[cmake](http://www.cmake.org/cmake/resources/software.html)(2.8以上的版本),直接安装. 148 | 149 | 3. 打开命令管理器(CMD.EXE)进入ALMRUN源码目录 150 | ``` 151 | cd Build 152 | cmake .. 153 | ALMRun.sln 154 | ``` 155 | 156 | 以后可以直接打开**ALMRun.sln**修改编译. 157 | 158 | Download 程序下载 159 | =================== 160 | 161 | ALMRUN最新版本下载: 162 | 163 | 其它版本请从 [更新记录] 下载 164 | -------------------------------------------------------------------------------- /bin/ALMRun.ini: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | #### 请把本文件复制到config目录下,以防软件更新时配置被覆盖 3 | #### 4 | [Config] 5 | #配置文件版本 6 | Version = 2 7 | ;设置程序显示隐藏热键,值为空时默认Alt+R 8 | ; 注: 可以通过LUA脚本设置多个辅助热键. 9 | ; 在my_conf.lua中添加以下命令即可. 10 | ; 例子添加显隐热键为"`",一行一个,想加几个就加几行.只要改一下key的值就行了. 11 | ; addCommand{ key = '`', func = toggleMerry } 12 | HotKey = Alt+R 13 | ; 14 | ;直接执行上一个命令,值为空时禁用 15 | LastItemHotKey = Alt+L 16 | 17 | ;手工重新加载配置的热键,值为空时禁用 18 | ;设为Ctrl+Shift+R 19 | ;HotKeyReLoad=C-S-R 20 | ;空值禁用该功能 21 | HotKeyReLoad = 22 | 23 | ;是否显示托盘图标 24 | ShowTrayIcon=1 25 | 26 | ;是否允许数字键快捷键(类似ALTRUN那样的) 27 | NumberKey=0 28 | 29 | ;仅显示前10项 30 | ShowTopTen=1 31 | 32 | ;当仅剩一项匹配项时立即执行 33 | ExecuteIfOnlyOne = 0 34 | 35 | ;数字索引(列表的数字),可根据习惯设置 36 | ;0: 1..9,0 37 | ;1: 0..9 38 | IndexFrom0to9 = 1 39 | 40 | ;;命令匹配模式 0,任意位置匹配;1,匹配开头;2,自定义Lua函数HookCompre 41 | CompareMode=0 42 | 43 | ;;前辍匹配优先,如果为0则order值优先. 44 | OrderByPre=1 45 | 46 | ;;是否让窗口保持置顶 47 | ;StayOnTop=0 48 | StayOnTop=0 49 | 50 | ;记录使用过的参数,默认最近50条,改为0禁用 51 | ;ParamHistoryLimit=50 52 | ParamHistoryLimit=50 53 | 54 | ;;禁用64位系统的文件注册表重定向 55 | DisableWow64FsRedirection = 1 56 | ;;设置默认的文件管理器(按Ctrl+D定位文件时) 57 | ;;Explorer= C:\totalcmd\totalcmd.exe 58 | Explorer= 59 | ;设置默认相对根目录,不清楚的不要改动 60 | Root= 61 | 62 | ;设置主题 63 | skin=merry 64 | ##命令格式 65 | ; [cmds/ID] 66 | ; cmd=命令 67 | ; desc=备注信息(可选,在选定命令时会显示) 68 | ; name=显示名称(可选,若为空则不会显示在列表中,适用于使用热键的情况) 69 | ; key=热键(可选) 70 | ; 71 | #其中ID,为0-1000不重复的数字(当前命令限制最多1000条) 72 | #例子: 73 | [cmds/1] 74 | ;命令(必须) 75 | cmd=cmd.exe 76 | ;名称(可选) 77 | name=cmdTest 78 | ;热键(可选) 79 | key= 80 | ;备注(可选) 81 | desc=ALMRun.ini测试命令1的备注信息 82 | 83 | [cmds/2] 84 | cmd=regedit.exe 85 | name=test.regedit 86 | ;;热键 87 | key=Alt + Ctrl + Y 88 | desc=注册表 89 | 90 | [cmds/0] 91 | cmd=--LUAMessageBox("参数:"..args.."\\nID:"..cmdID,"测试脚本") 92 | name=LUATest 93 | desc=Lua脚本命令测试 94 | 95 | ##自动扫描目录默认参数 96 | [dirs] 97 | ## 扫描目录级别,这里默认是0,只扫描当前目录 98 | sub=0 99 | ## 过滤文件(包含,即要添加到命令列表中的必须符合该条件) 100 | include=*.exe|*.lnk 101 | ## 过滤文件(排除,在命令列表中排除符合条件的条目) 102 | exclude= 103 | 104 | ## 过滤,比如所有的exe文件就是*.exe,或j*.exe,所有以j开头的exe文件. 105 | ## 扫描级别(子目录层数),-1: 无限,0:不扫描子目录,N:只扫描N层. 106 | ##扫描目录格式 107 | ; [dirs/ID] 108 | ; path=扫描路径 109 | ; include=包含条件(可选) 110 | ; exclude=排除条件(可选) 111 | ; sub=扫描级别(可选) 112 | ## ID 可以是任意数字,只用于区分. 113 | ## 注: 文件路径不可以用"\",可以使用"\\"或Linux风格"/",像c:\\boot或c:/boot 114 | ## include/exclude/path 都可以用'|'分隔开来,指定多个 115 | 116 | #例子:以下是自动扫描%Desktop%(桌面)|%CommonPrograms%(所有用户程序)|%Programs%(本用户程序)三个地方的快捷方式 117 | [dirs/0] 118 | path=%Desktop%|%CommonPrograms%|%Programs% 119 | ;只添加.lnk类型 120 | include=*.lnk 121 | ;过滤包含"Uninstall"和"卸载"字符的条目 122 | exclude=*Uninstall*|*卸载* 123 | ;扫描所有子目录 124 | sub=-1 125 | 126 | ## 自定义绿色软件目录 127 | [dirs/1] 128 | path=e:\绿色软件 129 | sub=-1 130 | 131 | -------------------------------------------------------------------------------- /bin/LuaEx/ALMRun.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/LuaEx/ALMRun.lua -------------------------------------------------------------------------------- /bin/LuaEx/base.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/LuaEx/base.lua -------------------------------------------------------------------------------- /bin/ShortCutList.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/ShortCutList.txt -------------------------------------------------------------------------------- /bin/config/plugins/Docset.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/config/plugins/Docset.lua -------------------------------------------------------------------------------- /bin/config/plugins/everything.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/config/plugins/everything.lua -------------------------------------------------------------------------------- /bin/config/plugins/sample.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/config/plugins/sample.lua -------------------------------------------------------------------------------- /bin/config/sample/common.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/config/sample/common.lua -------------------------------------------------------------------------------- /bin/config/sample/my_conf.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/config/sample/my_conf.lua -------------------------------------------------------------------------------- /bin/config/sample/plugins.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/config/sample/plugins.lua -------------------------------------------------------------------------------- /bin/lua51.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/lua51.dll -------------------------------------------------------------------------------- /bin/skin/altrun.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/skin/altrun.jpg -------------------------------------------------------------------------------- /bin/skin/altrun.skn: -------------------------------------------------------------------------------- 1 | [skinvalues] 2 | ;;面板设置 3 | editleft=10 4 | edittop=30 5 | editwidth=420 6 | editheight=20 7 | fontsize=10 8 | listtop=55 9 | listmargin=5 10 | ;主界面背景图片会自动使用这些图片skin_name.png/jpg/bmp,也可以自己指定 11 | ;skinpicture=merry.png 12 | ;列表框背景图片,默认skin_name_listbg.png/jpg/bmp 13 | listpicture=altrun.jpg 14 | 15 | listfmt= $$|$n|$d 16 | ;listfmt列表格式,可以自己随意组合. 17 | ;; $$ 当前显示序号(0-9) num 18 | ;; $i 命令的ID号(唯一),正常情况下不需要使用,只作内部识别或调试使用. id 19 | ;; $n 命令名次(快捷方式名称) name 20 | ;; $d 命令备注信息 desc 21 | ;; $c 命令行,要执行的命令. cmd 22 | ;; $k 对应命令的热键. key 23 | 24 | ;listfmt_xxxx_max 设置限制对应信息的长度默认右对齐,前面加负号"-"左对齐(和C语言的语法一样),其它设置参考上面说面的说明. 25 | listfmt_num_max=2 26 | listfmt_key_max=5 27 | listfmt_name_max=-25 28 | listfmt_desc_max=-50 29 | 30 | ;颜色设置 31 | windowcolor=#0 32 | textcolor=#FF0000 33 | textbackcolor=#C0DCC0 34 | listtextcolor=#000080 35 | listfocusbgcolor=#3399FF 36 | listbackcolor=#112233 37 | 38 | listfontsize=15 39 | 40 | titleenabled=1 41 | titlealign=center 42 | titletop=15 43 | titlewidth=420 44 | titlefontsize=12 45 | titletextcolor=#ffff00 -------------------------------------------------------------------------------- /bin/skin/altrun_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/skin/altrun_demo.png -------------------------------------------------------------------------------- /bin/skin/medium_camo_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/skin/medium_camo_demo.png -------------------------------------------------------------------------------- /bin/skin/medium_silver_short_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/skin/medium_silver_short_demo.png -------------------------------------------------------------------------------- /bin/skin/merry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/skin/merry.png -------------------------------------------------------------------------------- /bin/skin/merry.skn: -------------------------------------------------------------------------------- 1 | [skinvalues] 2 | mainheight=36 3 | ;;面板设置 4 | editleft=80 5 | edittop=10 6 | editwidth=259 7 | editheight=17 8 | fontsize=14 9 | listmargin=5 10 | ;主界面背景图片会自动使用这些图片skin_name.png/jpg/bmp,也可以自己指定 11 | ;skinpicture=merry.png 12 | ;列表框背景图片,默认skin_name_listbg.png/jpg/bmp 13 | ;listpicture= 14 | listtop=36 15 | 16 | listfmt=$K($$| $n 17 | ;listfmt列表格式,可以自己随意组合. 18 | ;; $$ 当前显示序号(0-9) num 19 | ;; $i 命令的ID号(唯一),正常情况下不需要使用,只作内部识别或调试使用. id 20 | ;; $n 命令名次(快捷方式名称) name 21 | ;; $d 命令备注信息 desc 22 | ;; $c 命令行,要执行的命令. cmd 23 | ;; $k 对应命令的热键. key 24 | 25 | ;listfmt_xxxx_max 设置限制对应信息的长度默认右对齐,前面加负号"-"左对齐(和C语言的语法一样),其它设置参考上面说面的说明. 26 | listfmt_num_max=1 27 | listfmt_key_max=5 28 | listfmt_name_max=-50 29 | 30 | ;颜色设置 31 | windowcolor=#d2d2d2 32 | textcolor=#323232 33 | textbackcolor=#fafafa 34 | listtextcolor=#323232 35 | listfocusbgcolor=#7d98af 36 | -------------------------------------------------------------------------------- /bin/skin/merry_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/skin/merry_demo.png -------------------------------------------------------------------------------- /bin/skin/merry_selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/skin/merry_selection.png -------------------------------------------------------------------------------- /bin/skin/merryl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/skin/merryl.png -------------------------------------------------------------------------------- /bin/skin/merryl.skn: -------------------------------------------------------------------------------- 1 | [skinvalues] 2 | ;;面板设置 3 | editleft=29 4 | edittop=10 5 | editwidth=259 6 | editheight=17 7 | fontsize=12 8 | fontname=新宋体 9 | ;主界面背景图片会自动使用这些图片skin_name.png/jpg/bmp,也可以自己指定 10 | ;skinpicture=merry.png 11 | ;列表框背景图片,默认skin_name_listbg.png/jpg/bmp 12 | ;listpicture= 13 | listtop=36 14 | 15 | listfmt= $$.| $n |$d 16 | ;listfmt列表格式,可以自己随意组合. 17 | ;; $$ 当前显示序号(0-9) num 18 | ;; $i 命令的ID号(唯一),正常情况下不需要使用,只作内部识别或调试使用. id 19 | ;; $n 命令名次(快捷方式名称) name 20 | ;; $d 命令备注信息 desc 21 | ;; $c 命令行,要执行的命令. cmd 22 | ;; $k 对应命令的热键. key 23 | 24 | ;listfmt_xxxx_max 设置限制对应信息的长度默认右对齐,前面加负号"-"左对齐(和C语言的语法一样),其它设置参考上面说面的说明. 25 | listfmt_num_max=2 26 | listfmt_key_max=5 27 | listfmt_name_max=-33 28 | listfmt_desc_max=-50 29 | 30 | ;颜色设置 31 | windowcolor=#d2d2d2 32 | textcolor=#323232 33 | textbackcolor=#fafafa 34 | listtextcolor=#323232 35 | listfocusbgcolor=#7d98af 36 | -------------------------------------------------------------------------------- /bin/skin/skin.txt: -------------------------------------------------------------------------------- 1 | [skinvalues] 2 | ;;该文件需要使用UTF-8编码 3 | ;;;almrun 主题模板. 4 | ;; 兼容部份 executor 的主题 可以自己从 http://executor.dk/ 下载exceutor提取skins目录里面的文件复制到almrun/skin目录下.通过主界面的右键菜单切换主题功能切换. 5 | ;;;颜色设置可以使用web颜 #RRGGBB 或使用数字形式,比如255 65535之类的. 6 | 7 | showwindow=0 ;是否显示WINDOWS窗口栏(显示关闭按钮标题栏) 8 | fontsize=10 ;主界面字体大小 主要是输入窗口的字体大小 9 | fontbold=0 ;是否对字体加粗. 10 | fontname=宋体 ; 默认字体 11 | ;;;主界面文字颜色设置(输入框文字) 12 | textcolor=0 13 | textbackcolor=0 14 | 15 | ;;边框颜色(可能无效) 16 | windowcolor=0 17 | 18 | ;主界面背景图片会自动使用这些图片skin_name.png/jpg/bmp,也可以自己指定 19 | skinpicture=skin.bmp 20 | ;;编辑输入框设置 21 | editleft=10 22 | edittop=10 23 | editwidth=260 24 | editheight=20 25 | 26 | ;;列表框设置 27 | listleft=0 28 | listtop=20 ;;top是相对整个界面的. 29 | 30 | ;;以下非必须的,一般情况下不需要设置,若需要设置直接去掉前面的";"再修改为相应的值就行了. 31 | ;listwidth=260 ;;列表框宽度(一般情况下不用设置) 32 | ;listfontname ;;列表框字体(参考fontname) 33 | ;listfontsize ;;列表框字号 34 | ;listmargin ;;列表框每一行的间隔 35 | ;列表框背景图片,默认skin_name_listbg.png/jpg/bmp 36 | ;listpicture ;;列表框的背景图片,如果有设置了listbackcolor则无效. 37 | 38 | LIST_BORDER_STYLE=0 //列表框边框样式设置 39 | LIST_BORDER_WIDTH=1 //列表框边框宽度 40 | 41 | listbackcolor=#ff0000 ;;列表文字的背景色 42 | listtextcolor=#ff0000 ;;列表文字的前景色 43 | listfocusbgcolor=#ff0000 ;;当前选中项的背景颜色 44 | listfocustextcolor=#ff0000 ;;当前选中项的前景色 45 | 46 | 47 | ;;;列表格式设置 48 | ;listfmt列表格式,可以自己随意组合. 49 | ;; $$ 当前显示序号(0-9) num 50 | ;; $i 命令的ID号(唯一),正常情况下不需要使用,只作内部识别或调试使用. id 51 | ;; $n 命令名次(快捷方式名称) name 52 | ;; $d 命令备注信息 desc 53 | ;; $c 命令行,要执行的命令. cmd 54 | ;; $k 对应命令的热键. key 55 | 56 | ;listfmt_xxxx_max 设置对应信息的长度默认右对齐,前面加负号"-"左对齐(和C语言的语法一样),其它设置参考上面说面的说明. 57 | listfmt=$$|$n|d 58 | listfmt_name_max=-25 59 | listfmt_desc_max=-50 60 | listfmt_key_max=5 61 | listfmt_cmd_max=10 62 | listfmt_id_max=5 63 | listfmt_num_max=2 64 | 65 | ;; 标题设置 用于显示对应项目的备注信息 66 | titleenabled = 0 ;0不显示,1显示,为1时以下信息有效 67 | 68 | ;;标题位置大小设置 69 | ;titleleft= 70 | ;titletop= 71 | ;titlewidth= 72 | ;titleheight= 73 | 74 | ;; 标题对齐设置 left right top bottom center center_vertical center_horizontal 75 | ;titlealign 76 | 77 | ;;标题文字颜色 78 | titletextcolor=0 79 | 80 | -------------------------------------------------------------------------------- /bin/skin/small_windowsish_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/bin/skin/small_windowsish_demo.png -------------------------------------------------------------------------------- /copyright: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/copyright -------------------------------------------------------------------------------- /doc/CSIDL.TXT: -------------------------------------------------------------------------------- 1 | #define CSIDL_DESKTOP 0x0000 // 2 | #define CSIDL_INTERNET 0x0001 // Internet Explorer (icon on desktop) 3 | #define CSIDL_PROGRAMS 0x0002 // Start Menu\Programs 4 | #define CSIDL_CONTROLS 0x0003 // My Computer\Control Panel 5 | #define CSIDL_PRINTERS 0x0004 // My Computer\Printers 6 | #define CSIDL_PERSONAL 0x0005 // My Documents 7 | #define CSIDL_FAVORITES 0x0006 // \Favorites 8 | #define CSIDL_STARTUP 0x0007 // Start Menu\Programs\Startup 9 | #define CSIDL_RECENT 0x0008 // \Recent 10 | #define CSIDL_SENDTO 0x0009 // \SendTo 11 | #define CSIDL_BITBUCKET 0x000a // \Recycle Bin 12 | #define CSIDL_STARTMENU 0x000b // \Start Menu 13 | #define CSIDL_MYDOCUMENTS CSIDL_PERSONAL // Personal was just a silly name for My Documents 14 | #define CSIDL_MYMUSIC 0x000d // "My Music" folder 15 | #define CSIDL_MYVIDEO 0x000e // "My Videos" folder 16 | #define CSIDL_DESKTOPDIRECTORY 0x0010 // \Desktop 17 | #define CSIDL_DRIVES 0x0011 // My Computer 18 | #define CSIDL_NETWORK 0x0012 // Network Neighborhood (My Network Places) 19 | #define CSIDL_NETHOOD 0x0013 // \nethood 20 | #define CSIDL_FONTS 0x0014 // windows\fonts 21 | #define CSIDL_TEMPLATES 0x0015 22 | #define CSIDL_COMMON_STARTMENU 0x0016 // All Users\Start Menu 23 | #define CSIDL_COMMON_PROGRAMS 0X0017 // All Users\Start Menu\Programs 24 | #define CSIDL_COMMON_STARTUP 0x0018 // All Users\Startup 25 | #define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019 // All Users\Desktop 26 | #define CSIDL_APPDATA 0x001a // \Application Data 27 | #define CSIDL_PRINTHOOD 0x001b // \PrintHood 28 | #define CSIDL_LOCAL_APPDATA 0x001c // \Local Settings\Applicaiton Data (non roaming) 29 | #define CSIDL_ALTSTARTUP 0x001d // non localized startup 30 | #define CSIDL_COMMON_ALTSTARTUP 0x001e // non localized common startup 31 | #define CSIDL_COMMON_FAVORITES 0x001f 32 | #define CSIDL_INTERNET_CACHE 0x0020 33 | #define CSIDL_COOKIES 0x0021 34 | #define CSIDL_HISTORY 0x0022 35 | #define CSIDL_COMMON_APPDATA 0x0023 // All Users\Application Data 36 | #define CSIDL_WINDOWS 0x0024 // GetWindowsDirectory() 37 | #define CSIDL_SYSTEM 0x0025 // GetSystemDirectory() 38 | #define CSIDL_PROGRAM_FILES 0x0026 // C:\Program Files 39 | #define CSIDL_MYPICTURES 0x0027 // C:\Program Files\My Pictures 40 | #define CSIDL_PROFILE 0x0028 // USERPROFILE 41 | #define CSIDL_SYSTEMX86 0x0029 // x86 system directory on RISC 42 | #define CSIDL_PROGRAM_FILESX86 0x002a // x86 C:\Program Files on RISC 43 | #define CSIDL_PROGRAM_FILES_COMMON 0x002b // C:\Program Files\Common 44 | #define CSIDL_PROGRAM_FILES_COMMONX86 0x002c // x86 Program Files\Common on RISC 45 | #define CSIDL_COMMON_TEMPLATES 0x002d // All Users\Templates 46 | #define CSIDL_COMMON_DOCUMENTS 0x002e // All Users\Documents 47 | #define CSIDL_COMMON_ADMINTOOLS 0x002f // All Users\Start Menu\Programs\Administrative Tools 48 | #define CSIDL_ADMINTOOLS 0x0030 // \Start Menu\Programs\Administrative Tools 49 | #define CSIDL_CONNECTIONS 0x0031 // Network and Dial-up Connections 50 | #define CSIDL_COMMON_MUSIC 0x0035 // All Users\My Music 51 | #define CSIDL_COMMON_PICTURES 0x0036 // All Users\My Pictures 52 | #define CSIDL_COMMON_VIDEO 0x0037 // All Users\My Video 53 | #define CSIDL_RESOURCES 0x0038 // Resource Direcotry -------------------------------------------------------------------------------- /doc/key_string.txt: -------------------------------------------------------------------------------- 1 | BACK 2 | TAB 3 | RETURN 4 | ESCAPE 5 | SPACE 6 | DELETE 7 | LBUTTON 8 | RBUTTON 9 | CANCEL 10 | MBUTTON 11 | CLEAR 12 | SHIFT 13 | ALT 14 | CONTROL 15 | MENU 16 | PAUSE 17 | CAPITAL 18 | END 19 | HOME 20 | LEFT 21 | UP 22 | RIGHT 23 | DOWN 24 | SELECT 25 | PRINT 26 | EXECUTE 27 | SNAPSHOT 28 | INSERT 29 | HELP 30 | NUMPAD0 31 | NUMPAD1 32 | NUMPAD2 33 | NUMPAD3 34 | NUMPAD4 35 | NUMPAD5 36 | NUMPAD6 37 | NUMPAD7 38 | NUMPAD8 39 | NUMPAD9 40 | MULTIPLY 41 | ADD 42 | SEPARATOR 43 | SUBTRACT 44 | DECIMAL 45 | DIVIDE 46 | F1 47 | F2 48 | F3 49 | F4 50 | F5 51 | F6 52 | F7 53 | F8 54 | F9 55 | F10 56 | F11 57 | F12 58 | F13 59 | F14 60 | F15 61 | F16 62 | F17 63 | F18 64 | F19 65 | F20 66 | F21 67 | F22 68 | F23 69 | F24 70 | NUMLOCK 71 | SCROLL 72 | PAGEUP 73 | PAGEDOWN 74 | NUMPAD_SPACE 75 | NUMPAD_TAB 76 | NUMPAD_ENTER 77 | NUMPAD_F1 78 | NUMPAD_F2 79 | NUMPAD_F3 80 | NUMPAD_F4 81 | NUMPAD_HOME 82 | NUMPAD_LEFT 83 | NUMPAD_UP 84 | NUMPAD_RIGHT 85 | NUMPAD_DOWN 86 | NUMPAD_PAGEUP 87 | NUMPAD_PAGEDOWN 88 | NUMPAD_END 89 | NUMPAD_BEGIN 90 | NUMPAD_INSERT 91 | NUMPAD_DELETE 92 | NUMPAD_EQUAL 93 | NUMPAD_MULTIPLY 94 | NUMPAD_ADD 95 | NUMPAD_SEPARATOR 96 | NUMPAD_SUBTRACT 97 | NUMPAD_DECIMAL 98 | NUMPAD_DIVIDE 99 | -------------------------------------------------------------------------------- /readme: -------------------------------------------------------------------------------- 1 | Build Merry 2 | =========== 3 | cd Build 4 | cmake .. 5 | 6 | Requirement 7 | =========== 8 | Mac OS >= 10.7 9 | 10 | Resource 11 | ======== 12 | ICON: 13 | http://dakirby309.deviantart.com/art/Metro-UI-Dock-Icon-Set-RELEASED-436-Icons-280724102 14 | -------------------------------------------------------------------------------- /resource/asc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/resource/asc.ico -------------------------------------------------------------------------------- /resource/desc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/resource/desc.ico -------------------------------------------------------------------------------- /resource/merry.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/resource/merry.rc -------------------------------------------------------------------------------- /resource/merry.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/resource/merry.xcf -------------------------------------------------------------------------------- /resource/merry_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/resource/merry_icon.ico -------------------------------------------------------------------------------- /resource/merry_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/resource/merry_icon.png -------------------------------------------------------------------------------- /resource/merry_selection.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/resource/merry_selection.xcf -------------------------------------------------------------------------------- /src/ALMRunCommon.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/ALMRunCommon.cpp -------------------------------------------------------------------------------- /src/ALMRunCommon.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef _ALMRUN_COMMON_H_ 3 | #define _ALMRUN_COMMON_H_ 4 | #include 5 | #include 6 | #include "MerryWx.h" 7 | #include "MerryLua.h" 8 | #include "wx/sstream.h" 9 | #include "wx/url.h" 10 | 11 | class ALMRunCMDBase 12 | { 13 | public: 14 | ALMRunCMDBase(const wxString& commandName = wxEmptyString,const wxString& commandDesc = wxEmptyString,const wxString& commandLine = wxEmptyString,const wxString& commandworkDir = wxEmptyString, int funcRef = 0, const wxString& triggerKey = wxEmptyString,const int order = 0) 15 | { 16 | this->Name = commandName; 17 | this->Desc = commandDesc; 18 | this->cmdLine = commandLine; 19 | this->WorkDir = commandworkDir; 20 | this->Key = triggerKey; 21 | this->FuncRef = funcRef; 22 | this->Order = order; 23 | } 24 | 25 | wxString Name; 26 | wxString Desc; 27 | wxString cmdLine; 28 | wxString Key; 29 | wxString WorkDir; 30 | int FuncRef; 31 | int Order; 32 | int Flags; 33 | }; 34 | 35 | const char CMDFLAG_STRS[]="?@+>*| "; 36 | void ListFiles(const wxString& dirname,wxArrayString *files,const wxArrayString& filespec,const int sub = -1); 37 | void ListFiles(const wxString& dirname,wxArrayString *files,const wxString& filespec,const wxString& exclude = wxEmptyString,const int sub = -1); 38 | ALMRunCMDBase* lua_GetCommand(lua_State* L, int flags = 0); 39 | wxString GetPinYin(const wxString& source); 40 | wxString GetClipboardText(); 41 | int importCMD(wxString& filename); 42 | wxString GetCMDPath(const wxString& commandLine,const wxString& workingDir = wxEmptyString); 43 | wxString UnEscapeString(const wxString& str); 44 | wxString EscapeString(const wxString& str); 45 | void setWinHelpText(wxWindowBase* win,const wxString& text,bool ShowToolTips = true); 46 | wxString wxURL_GET(const wxString &uri,const wxString& proxy = wxEmptyString); 47 | 48 | #ifdef __WXMSW__ 49 | BOOL IsX64(); 50 | BOOL ActiveWindow(HWND hwnd); 51 | BOOL CheckActiveProg(DWORD PID); 52 | static wxString _GetCMDPath(const wxString& commandLine); 53 | wxString ParseCmd(const wxString& cmdLine,wxString* const cmdArg = NULL,const wxString& workDir = wxEmptyString); 54 | DWORD RunCMD(const wxString& cmdLine,const wxString& cmdArg,const wxString& workDir = wxEmptyString); 55 | BOOL CreateFileShortcut(LPCWSTR lpszFileName, LPCWSTR lpszLnkFilePath, LPCWSTR lpszWorkDir, WORD wHotkey = 0, LPCTSTR lpszDescription = NULL, int iShowCmd = SW_SHOWNORMAL); 56 | BOOL ReadShortcut(LPCWSTR lpwLnkFile, ALMRunCMDBase *cmd); 57 | #endif 58 | 59 | #endif -------------------------------------------------------------------------------- /src/ALMRunConfig.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/ALMRunConfig.cpp -------------------------------------------------------------------------------- /src/ALMRunConfig.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/ALMRunConfig.h -------------------------------------------------------------------------------- /src/ALMRunVersion.h: -------------------------------------------------------------------------------- 1 | #ifndef _ALMRUN_VERSION_H_ 2 | #define _ALMRUN_VERSION_H_ 3 | #define VERSION_INT 1,2,0,74 4 | #define VERSION_STR "1,2,0,74" 5 | #define VERSION_DATE "2016/03/09" 6 | #endif 7 | -------------------------------------------------------------------------------- /src/Dialog/DlgAddNewCmd.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/Dialog/DlgAddNewCmd.cpp -------------------------------------------------------------------------------- /src/Dialog/DlgAddNewCmd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/Dialog/DlgAddNewCmd.h -------------------------------------------------------------------------------- /src/Dialog/DlgAddNewDir.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/Dialog/DlgAddNewDir.cpp -------------------------------------------------------------------------------- /src/Dialog/DlgAddNewDir.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/Dialog/DlgAddNewDir.h -------------------------------------------------------------------------------- /src/Dialog/DlgConfig.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/Dialog/DlgConfig.cpp -------------------------------------------------------------------------------- /src/Dialog/DlgConfig.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Name: DlgConfig.h 3 | // Purpose: 4 | // Author: test 5 | // Modified by: 6 | // Created: 12/06/2013 09:14:07 7 | // RCS-ID: 8 | // Copyright: test 9 | // Licence: 10 | ///////////////////////////////////////////////////////////////////////////// 11 | 12 | #ifndef _DLGCONFIG_H_ 13 | #define _DLGCONFIG_H_ 14 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) 16 | #pragma interface "DlgConfig.h" 17 | #endif 18 | 19 | /*! 20 | * Includes 21 | */ 22 | 23 | ////@begin includes 24 | #include "HotkeyCtrl.h" 25 | ////@end includes 26 | 27 | /*! 28 | * Forward declarations 29 | */ 30 | 31 | ////@begin forward declarations 32 | ////@end forward declarations 33 | 34 | /*! 35 | * Control identifiers 36 | */ 37 | 38 | ////@begin control identifiers 39 | #define ID_DLGCONFIG 10017 40 | #define ID_CHECKLISTBOX 10018 41 | #define ID_TEXTCTRL 10008 42 | #define SYMBOL_DLGCONFIG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL 43 | #define SYMBOL_DLGCONFIG_TITLE wxGetTranslation(wxString(wxT("ALMRun ")) + (wxChar) 0x53C2 + (wxChar) 0x6570 + (wxChar) 0x914D + (wxChar) 0x7F6E) 44 | #define SYMBOL_DLGCONFIG_IDNAME ID_DLGCONFIG 45 | #define SYMBOL_DLGCONFIG_SIZE wxSize(400, 300) 46 | #define SYMBOL_DLGCONFIG_POSITION wxDefaultPosition 47 | ////@end control identifiers 48 | 49 | 50 | /*! 51 | * DlgConfig class declaration 52 | */ 53 | 54 | class DlgConfig: public wxDialog 55 | { 56 | DECLARE_DYNAMIC_CLASS( DlgConfig ) 57 | DECLARE_EVENT_TABLE() 58 | 59 | public: 60 | /// Constructors 61 | DlgConfig(); 62 | DlgConfig( wxWindow* parent, wxWindowID id = SYMBOL_DLGCONFIG_IDNAME, const wxString& caption = SYMBOL_DLGCONFIG_TITLE, const wxPoint& pos = SYMBOL_DLGCONFIG_POSITION, const wxSize& size = SYMBOL_DLGCONFIG_SIZE, long style = SYMBOL_DLGCONFIG_STYLE ); 63 | 64 | /// Creation 65 | bool Create( wxWindow* parent, wxWindowID id = SYMBOL_DLGCONFIG_IDNAME, const wxString& caption = SYMBOL_DLGCONFIG_TITLE, const wxPoint& pos = SYMBOL_DLGCONFIG_POSITION, const wxSize& size = SYMBOL_DLGCONFIG_SIZE, long style = SYMBOL_DLGCONFIG_STYLE ); 66 | 67 | /// Destructor 68 | ~DlgConfig(); 69 | 70 | /// Initialises member variables 71 | void Init(); 72 | 73 | /// Creates the controls and sizers 74 | void CreateControls(); 75 | 76 | ////@begin DlgConfig event handler declarations 77 | void OnConfigCheck(wxCommandEvent& e); 78 | void OnCheck(wxCommandEvent& e); 79 | void OnMouseEvent(wxMouseEvent& e); 80 | ////@end DlgConfig event handler declarations 81 | 82 | ////@begin DlgConfig member function declarations 83 | 84 | /// Retrieves bitmap resources 85 | wxBitmap GetBitmapResource( const wxString& name ); 86 | 87 | /// Retrieves icon resources 88 | wxIcon GetIconResource( const wxString& name ); 89 | ////@end DlgConfig member function declarations 90 | 91 | /// Should we show tooltips? 92 | static bool ShowToolTips(); 93 | 94 | ////@begin DlgConfig member variables 95 | wxCheckListBox* config; 96 | HotkeyCtrl* config_hotkey; 97 | wxStaticText* config_tip; 98 | ////@end DlgConfig member variables 99 | }; 100 | 101 | #endif 102 | // _DLGCONFIG_H_ 103 | -------------------------------------------------------------------------------- /src/Dialog/DlgParam.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/Dialog/DlgParam.cpp -------------------------------------------------------------------------------- /src/Dialog/DlgParam.h: -------------------------------------------------------------------------------- 1 | #ifndef __ALMRUN_DlgParam__ 2 | #define __ALMRUN_DlgParam__ 3 | #include "MerryWx.h" 4 | #include 5 | 6 | #define PARAMHISTORY_FILE wxT("config/ParamHistory.txt") 7 | 8 | class DlgParam : public wxDialog 9 | { 10 | private: 11 | DECLARE_EVENT_TABLE(); 12 | 13 | protected: 14 | void OnKey(wxKeyEvent& event); 15 | wxComboBox* comboBox; 16 | wxTextFile tfile; 17 | wxString Param_file; 18 | private: 19 | wxArrayString m_array; 20 | wxString m_last_str; 21 | public: 22 | 23 | DlgParam(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(400,70), long style = wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP); 24 | ~DlgParam(); 25 | void OnOKClick(wxCommandEvent& e); 26 | //void OnCancelClick(wxCommandEvent& e); 27 | void OnShow(wxShowEvent& e); 28 | //void OnFocus(wxFocusEvent& e); 29 | //void OnActivate(wxActivateEvent& e); 30 | void SetValue(const wxString& str); 31 | wxString getvalue(); 32 | }; 33 | 34 | #endif //__ALMRUN_DlgParam__ 35 | -------------------------------------------------------------------------------- /src/Dialog/HotkeyCtrl.cpp: -------------------------------------------------------------------------------- 1 | #include "HotkeyCtrl.h" 2 | #include "MerryKey.h" 3 | 4 | BEGIN_EVENT_TABLE(HotkeyCtrl, wxTextCtrl) 5 | EVT_KEY_DOWN(HotkeyCtrl::OnKeyDownEvent) 6 | EVT_KEY_UP(HotkeyCtrl::OnKeyUpEvent) 7 | EVT_SET_FOCUS(HotkeyCtrl::OnFocus) 8 | END_EVENT_TABLE() 9 | 10 | HotkeyCtrl::HotkeyCtrl(wxWindow *parent, 11 | wxWindowID id, 12 | const wxString& value, 13 | const wxPoint& pos, 14 | const wxSize& size, 15 | long style, 16 | const wxValidator& validator, 17 | const wxString& name): 18 | wxTextCtrl(parent,id,value,pos,size,style,validator,name) 19 | { 20 | WinDown = false; 21 | } 22 | 23 | HotkeyCtrl::~HotkeyCtrl() 24 | { 25 | __DEBUG_BEGIN("") 26 | __DEBUG_END("") 27 | } 28 | 29 | void HotkeyCtrl::onContextMenu(wxContextMenuEvent& e) 30 | { 31 | e.Skip(); 32 | } 33 | 34 | void HotkeyCtrl::OnKeyUpEvent(wxKeyEvent& e) 35 | { 36 | switch(e.GetKeyCode()) 37 | { 38 | case WXK_WINDOWS_LEFT: 39 | case WXK_WINDOWS_RIGHT: 40 | WinDown = false; 41 | e.StopPropagation(); 42 | return; 43 | } 44 | e.Skip(); 45 | } 46 | 47 | void HotkeyCtrl::OnKeyDownEvent(wxKeyEvent& e) 48 | { 49 | e.StopPropagation(); 50 | int code = e.GetKeyCode(); 51 | if (code == WXK_WINDOWS_LEFT || code == WXK_WINDOWS_RIGHT) 52 | { 53 | WinDown = true; 54 | return; 55 | } 56 | if (code == WXK_NONE || code == WXK_SHIFT || code == WXK_ALT || code == WXK_CONTROL) 57 | return; 58 | if (code == WXK_DELETE) 59 | { 60 | this->Clear(); 61 | return; 62 | } 63 | wxString key; 64 | if (code > 32 && code < 127) 65 | key.Append(e.GetUnicodeKey()); 66 | else 67 | key = g_keys.GetKeyString(code); 68 | if (key.empty()) 69 | return; 70 | if (e.HasModifiers()) 71 | { 72 | int Modifers = e.GetModifiers(); 73 | if (Modifers & wxMOD_ALT) 74 | key.insert(0,"Alt+"); 75 | if (Modifers & wxMOD_CONTROL) 76 | key.insert(0,"Ctrl+"); 77 | if (Modifers & wxMOD_SHIFT) 78 | key.insert(0,"Shift+"); 79 | } 80 | if (WinDown) 81 | key.insert(0,"Win+"); 82 | this->SetValue(key); 83 | } -------------------------------------------------------------------------------- /src/Dialog/HotkeyCtrl.h: -------------------------------------------------------------------------------- 1 | #ifndef _HOTKEYCTRL_H_ 2 | #define _HOTKEYCTRL_H_ 3 | 4 | #include "MerryWx.h" 5 | 6 | class HotkeyCtrl : public wxTextCtrl 7 | { 8 | public: 9 | HotkeyCtrl(wxWindow *parent, 10 | wxWindowID id, 11 | const wxString& value = wxEmptyString, 12 | const wxPoint& pos = wxDefaultPosition, 13 | const wxSize& size = wxSize(110,-1), 14 | long style = wxTE_CHARWRAP|wxWANTS_CHARS, 15 | const wxValidator& validator = wxDefaultValidator, 16 | const wxString& name = wxTextCtrlNameStr); 17 | ~HotkeyCtrl(); 18 | 19 | private: 20 | void onContextMenu(wxContextMenuEvent& e); 21 | void OnKeyDownEvent(wxKeyEvent& e); 22 | void OnKeyUpEvent(wxKeyEvent& e); 23 | virtual void OnFocus( wxFocusEvent& event ) { WinDown = false;event.Skip(); } 24 | bool WinDown; 25 | private: 26 | DECLARE_EVENT_TABLE() 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/Dialog/cmdListCtrl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/Dialog/cmdListCtrl.cpp -------------------------------------------------------------------------------- /src/Dialog/cmdListCtrl.h: -------------------------------------------------------------------------------- 1 | #ifndef __MY_LIST_CTRL_H__ 2 | #define __MY_LIST_CTRL_H__ 3 | 4 | #include "wx/listctrl.h" 5 | #include "ALMRunConfig.h" 6 | #ifdef _ALMRUN_CONFIG_H_ 7 | #define DIRLIST_MODE 1 8 | #define CMDLIST_MODE 0 9 | 10 | class ListSortInfo 11 | { 12 | public: 13 | ListSortInfo() 14 | { 15 | SortAscending = false; 16 | Column = -1; 17 | } 18 | wxString filter; 19 | bool SortAscending; 20 | int Column; 21 | class cmdListCtrl *ListCtrl; 22 | }; 23 | 24 | class cmdListCtrl : public wxListCtrl 25 | { 26 | public: 27 | cmdListCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, 28 | const wxSize& size = wxDefaultSize, long style = wxLC_REPORT|wxLC_HRULES|wxLC_VRULES);// | wxLC_LIST | wxLC_VIRTUAL); 29 | static void RunMenu(const int id,cmdListCtrl* t); 30 | static bool onDelete(const wxString& item); 31 | void SortFilter(const wxString& filter); 32 | void ReLoadCmds(); 33 | ~cmdListCtrl(); 34 | 35 | protected: 36 | // void OnColClick(wxListEvent& event); 37 | void OnSelected(wxListEvent& event); 38 | void onKeyDown(wxListEvent& e); 39 | void onRightClick(wxListEvent& event); 40 | void onDclick(wxMouseEvent& e); 41 | void onPopMenu(wxCommandEvent& e); 42 | wxImageList *m_imageListSmall; 43 | 44 | private: 45 | // void SetColumnImage(int col, int image); 46 | void OnColClick(wxListEvent& event); 47 | int mode; 48 | ListSortInfo SortInfo; 49 | 50 | private: 51 | DECLARE_NO_COPY_CLASS(cmdListCtrl) 52 | DECLARE_EVENT_TABLE() 53 | }; 54 | 55 | enum 56 | { 57 | CMDLIST_COL_NAME = 0, 58 | CMDLIST_COL_CMD, 59 | CMDLIST_COL_KEY, 60 | CMDLIST_COL_DESC, 61 | CMDLIST_COL_ID, 62 | CMDLIST_COL_WORKDIR, 63 | COL_MAX, 64 | }; 65 | 66 | enum 67 | { 68 | DIRLIST_COL_NAME = 0, 69 | DIRLIST_COL_PATH, 70 | DIRLIST_COL_INCLUDE, 71 | DIRLIST_COL_EXCLUDE, 72 | DIRLIST_COL_ID, 73 | DIRLIST_COL_SUB, 74 | }; 75 | 76 | #endif 77 | #endif // __MY_LIST_CTRL_H__ 78 | -------------------------------------------------------------------------------- /src/Dialog/cmdmgr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/Dialog/cmdmgr.cpp -------------------------------------------------------------------------------- /src/Dialog/cmdmgr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/Dialog/cmdmgr.h -------------------------------------------------------------------------------- /src/Dialog/cut.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *cut_xpm[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "16 15 3 1", 5 | " c None", 6 | ". c Black", 7 | "X c #000080", 8 | /* pixels */ 9 | " ", 10 | " . . ", 11 | " . . ", 12 | " . . ", 13 | " .. .. ", 14 | " . . ", 15 | " ... ", 16 | " . ", 17 | " X.X ", 18 | " X XXX ", 19 | " XXX X X ", 20 | " X X X X ", 21 | " X X X X ", 22 | " X X XX ", 23 | " XX " 24 | }; 25 | -------------------------------------------------------------------------------- /src/Dialog/find.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *find_xpm[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "16 15 41 1", 5 | "y c #A06959", 6 | "9 c #A7DAF2", 7 | "$ c #B5CAD7", 8 | "> c #35B4E1", 9 | "t c #6B98B8", 10 | "w c #B6E0F4", 11 | "q c #AEC9D7", 12 | "1 c #5A89A6", 13 | "+ c #98B3C6", 14 | "4 c #EAF6FC", 15 | "3 c #DEF1FA", 16 | "= c #4CBCE3", 17 | "d c #DB916B", 18 | "X c #85A7BC", 19 | "s c #D8BCA4", 20 | "o c #749BB4", 21 | "e c #BCD9EF", 22 | "* c #62B4DD", 23 | "< c #91D2EF", 24 | "a c #E6DED2", 25 | "0 c #E9F4FB", 26 | " c None", 27 | "@ c #A0BACB", 28 | "O c #AABFCD", 29 | "i c #6591AE", 30 | ": c #B9CBD5", 31 | "- c #71C5E7", 32 | "5 c #D3ECF8", 33 | "% c #81A3B9", 34 | "6 c #8AD0EE", 35 | "8 c #FDFDFE", 36 | "p c #8EA9BC", 37 | "r c #B6D5EE", 38 | ", c #81CCEB", 39 | ". c #ACC4D3", 40 | "; c #AFD1DE", 41 | "7 c #EFF8FC", 42 | "u c #C2CBDB", 43 | "# c #C0D1DC", 44 | "2 c #CAD6E1", 45 | "& c #8FB0C3", 46 | /* pixels */ 47 | " .XooXO ", 48 | " +@###$+% ", 49 | " .&#*==-;@@ ", 50 | " o:*>,<--:X ", 51 | " 12>-345-#% ", 52 | " 12>678392% ", 53 | " %$*,3059q& ", 54 | " @Oq,wwer@@ ", 55 | " t@q22q&+ ", 56 | " yyui+%o%p ", 57 | " yasy ", 58 | " yasdy ", 59 | " yasdy ", 60 | " ysdy ", 61 | " yy " 62 | }; 63 | -------------------------------------------------------------------------------- /src/Dialog/folder.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char *const folder_xpm[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "32 32 41 1", 5 | "6 c #EDF2FB", 6 | "- c #AAC1E8", 7 | ": c #B9CDED", 8 | "X c #295193", 9 | ", c #C6D6F0", 10 | "a c #4A7CCE", 11 | "u c #779DDB", 12 | "y c #7FA2DD", 13 | "$ c #3263B4", 14 | "5 c #EAF0FA", 15 | ". c #2D59A3", 16 | "o c #6E96D8", 17 | "* c #356AC1", 18 | "r c #F7F9FD", 19 | "> c #BED0EE", 20 | "3 c #E1E9F7", 21 | "7 c #F0F5FC", 22 | "< c #CBD9F1", 23 | "2 c #DAE5F6", 24 | "# c #3161B1", 25 | " c None", 26 | "0 c #FDFEFF", 27 | "= c #9FB9E5", 28 | "e c #AEC5EA", 29 | "t c #89A9DF", 30 | "q c #98B5E4", 31 | "p c #5584D1", 32 | "d c #3A70CA", 33 | "@ c #305FAC", 34 | "i c #5D89D3", 35 | "1 c #D2DFF4", 36 | "% c #3366B9", 37 | "9 c #FAFCFE", 38 | "8 c #F5F8FD", 39 | "s c #4075CC", 40 | "O c #638ED5", 41 | "w c #90AFE2", 42 | "& c #3467BC", 43 | "+ c #2F5DA9", 44 | "; c #B3C8EB", 45 | "4 c #E5EDF9", 46 | /* pixels */ 47 | " ", 48 | " ", 49 | " ", 50 | " ", 51 | " ", 52 | " ", 53 | " ......X ", 54 | " .oooooO+ ", 55 | " .ooooooo. ", 56 | " .+@@@##$%%&&&&&****. ", 57 | " .=-;:>,<12345678900. ", 58 | " .q=-;:>,<1234567890. ", 59 | " .wq=-e:>,<12345678r. ", 60 | " .twq=-e:>,<12345678. ", 61 | " .ytwq=-e:>,<1234567. ", 62 | " .uytwq=-e:>,<123456. ", 63 | " .ouytwq=-e:>,<12345. ", 64 | " .Oouytwq=-e;>,<1234. ", 65 | " .iOouytwq=-e;>,<123. ", 66 | " .piOouytwq=-e;>,<12. ", 67 | " .apiOouytwq=-e;>,<1. ", 68 | " .sapiOouytwq=-e;>,<. ", 69 | " .dsapiOouytwq=-e;>,. ", 70 | " ...................# ", 71 | " ", 72 | " ", 73 | " ", 74 | " ", 75 | " ", 76 | " ", 77 | " ", 78 | " " 79 | }; 80 | -------------------------------------------------------------------------------- /src/Dialog/import.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char *import_xpm[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "16 16 137 2", 5 | "=. c #FD3A3E", 6 | "R c #CACACA", 7 | "$. c #D9D9D9", 8 | "m c #FB4046", 9 | "~ c #F94950", 10 | ">. c #A12149", 11 | "h c #C2112B", 12 | "+. c #C3C3C3", 13 | "4 c #C40B31", 14 | "H c #AB264A", 15 | "- c #FFFFFF", 16 | "8. c #BA99A4", 17 | "z c #E83D51", 18 | "5 c #C2113C", 19 | "u. c #AA7184", 20 | "L c #FF1C1D", 21 | "U c #B55D79", 22 | "i c #9E9EA1", 23 | "d. c #BCBCBC", 24 | "j c #FE0000", 25 | "' c #88888D", 26 | "j. c #B5B5B5", 27 | "e c #FC0000", 28 | "B c #FF0D0B", 29 | "Q c #E2E2E2", 30 | "k c #F50209", 31 | "| c #FE292C", 32 | ";. c #FF3C3B", 33 | "= c #A9AAAB", 34 | "w. c #BDBDBD", 35 | "f c #A71A41", 36 | "] c #DBDBDB", 37 | "V c #FF0101", 38 | ": c #D6A2B3", 39 | "4. c #EC7480", 40 | "8 c #F1E5E9", 41 | "X c #61ADDC", 42 | "n c #A01942", 43 | "3 c #B31338", 44 | "i. c #C5C5C5", 45 | "2. c #D4D4D4", 46 | "_ c #E8E7E7", 47 | " c #5877A6", 48 | "g c #B14867", 49 | "} c #FB3C41", 50 | "; c #F4E6EB", 51 | "D c #919195", 52 | "g. c #BEBEBE", 53 | "S c #CDCDCD", 54 | "O. c #DCDCDC", 55 | "Y c #EBEBEB", 56 | "1 c #DFB7C4", 57 | "a c #FAFAFA", 58 | "/ c #FF2122", 59 | ") c #EB0E16", 60 | ":. c #E63F49", 61 | "@. c #85868B", 62 | "( c #FF1817", 63 | "q. c #D5D5D5", 64 | "#. c #E4E4E4", 65 | "[ c #B32D4F", 66 | "%. c #B83151", 67 | "N c #FF1514", 68 | "r c #F2000A", 69 | "I c #FF1210", 70 | "E c #8D8E92", 71 | "6 c #A1A1A4", 72 | "0. c #DDDDDD", 73 | "o. c #950937", 74 | "W c #ECECEC", 75 | "p c #FBFBFB", 76 | "+ c #6BC0EB", 77 | "Z c #AC2347", 78 | "t. c #A13759", 79 | "6. c #98103C", 80 | "C c #F72A2D", 81 | "% c #7086A7", 82 | "o c #4168A1", 83 | "a. c #D6D6D6", 84 | "T c #E5E5E5", 85 | "& c #466CA6", 86 | "-. c #FF3839", 87 | "9 c #B03D60", 88 | "7. c #A43859", 89 | "r. c #CFCFCF", 90 | "1. c #DEDEDE", 91 | "w c #AE3D5E", 92 | "y c #E11732", 93 | "X. c #F52126", 94 | ". c #5FA9D8", 95 | "f. c #78797F", 96 | "K c #FD2F33", 97 | "y. c #9C1B45", 98 | "` c #C8C8C8", 99 | "2 c #9E123D", 100 | "9. c #D7D7D7", 101 | "G c #E6E6E6", 102 | " . c #FF2021", 103 | "3. c #AE3154", 104 | "<. c #808186", 105 | ",. c #C1C1C1", 106 | "s. c #D0D0D0", 107 | ".. c #FF1715", 108 | "> c #AF4164", 109 | "b c #EEEEEE", 110 | "$ c #0077C3", 111 | "! c #AE284B", 112 | "7 c #FDFDFD", 113 | "l c #F00B18", 114 | "5. c #BB3D5A", 115 | "P c #FF1413", 116 | "&. c #F8515A", 117 | "O c #68BBE7", 118 | "c c #97989B", 119 | "J c #FA454C", 120 | "< c #A6A7A9", 121 | "e. c #7E7E84", 122 | "d c #E12E3E", 123 | "{ c #F84E57", 124 | "0 c #C57790", 125 | "*. c #FA4249", 126 | "v c #F6F6F6", 127 | "^ c #FC3338", 128 | "# c #0879C2", 129 | "M c #FE2729", 130 | "s c #A83156", 131 | "p. c #D1D1D1", 132 | "@ c #4167A1", 133 | "F c #EFEFEF", 134 | "x c #A01D47", 135 | ", c #A32A51", 136 | "u c #DB3D5D", 137 | "q c #F4F0F2", 138 | "A c #D6CFD2", 139 | "t c #EC0213", 140 | "h. c #BBBBBB", 141 | "* c #3A63A0", 142 | /* pixels */ 143 | " . X X X X X X X X X X X X X X ", 144 | "o O + + + + + + + + + + + + + + ", 145 | "@ # $ $ $ $ $ $ $ $ $ $ $ $ $ $ ", 146 | "% & * * * * * * * * * * * * * * ", 147 | "= - - - - - - - - - - - ; : > , ", 148 | "< - - - - - - - - - - 1 2 3 4 5 ", 149 | "6 7 7 7 7 7 8 9 0 q w e r t y u ", 150 | "i p p p p a s d f g h j k l z x ", 151 | "c v v v v b n m M N B V C Z A S ", 152 | "D F F F F G H J K L P I U Y T R ", 153 | "E W W W W Q ! ~ ^ / ( ) _ W Q ` ", 154 | "' G G G G ] [ { } | ...X.o.O.+.", 155 | "@.#.#.#.#.$.%.&.*.=.-.;.:.>.] ,.", 156 | "<.1.1.1.1.2.3.4.5.6.7.8.9.0.q.w.", 157 | "e.9.9.9.9.r.t.y.u.i.R p.a.9.s.d.", 158 | "f.g.g.g.g.w.h.d.g.g.g.g.g.g.d.j." 159 | }; 160 | -------------------------------------------------------------------------------- /src/Dialog/open.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *open_xpm[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "16 15 5 1", 5 | " c None", 6 | ". c Black", 7 | "X c Yellow", 8 | "o c Gray100", 9 | "O c #bfbf00", 10 | /* pixels */ 11 | " ", 12 | " ... ", 13 | " . . .", 14 | " ..", 15 | " ... ...", 16 | " .XoX....... ", 17 | " .oXoXoXoXo. ", 18 | " .XoXoXoXoX. ", 19 | " .oXoX..........", 20 | " .XoX.OOOOOOOOO.", 21 | " .oo.OOOOOOOOO. ", 22 | " .X.OOOOOOOOO. ", 23 | " ..OOOOOOOOO. ", 24 | " ........... ", 25 | " " 26 | }; 27 | -------------------------------------------------------------------------------- /src/Dialog/paste.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *paste_xpm[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "16 15 6 1", 5 | " c None", 6 | ". c Black", 7 | "X c Yellow", 8 | "o c #808080", 9 | "O c #000080", 10 | "+ c Gray100", 11 | /* pixels */ 12 | " ", 13 | " .... ", 14 | " .....XX..... ", 15 | ".ooo.X..X.ooo. ", 16 | ".oo. .oo. ", 17 | ".oo........oo. ", 18 | ".oooooooooooo. ", 19 | ".oooooOOOOOOO. ", 20 | ".oooooO+++++OO ", 21 | ".oooooO+++++O+O ", 22 | ".oooooO+OOO+OOO ", 23 | ".oooooO+++++++O ", 24 | ".oooooO+OOOOO+O ", 25 | " .....O+++++++O ", 26 | " OOOOOOOOO " 27 | }; 28 | -------------------------------------------------------------------------------- /src/MerryApp.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MerryApp.cpp -------------------------------------------------------------------------------- /src/MerryApp.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_APP_H_ 2 | #define _MERRY_APP_H_ 3 | 4 | #include "MerryFrame.h" 5 | #include "ALMRunConfig.h" 6 | #include "stServer.h" 7 | #include 8 | class MerryApp : public wxApp 9 | { 10 | public: 11 | virtual int OnExit(); 12 | virtual bool OnInit(); 13 | void NewFrame(); 14 | void stServerDisconnect(); 15 | void Execute_IPC_CMD(wxConnectionBase* conn); 16 | MerryFrame& GetFrame(); 17 | void EvtActive(wxActivateEvent& e); 18 | private: 19 | MerryFrame* m_frame; 20 | stServer *m_server; 21 | wxSingleInstanceChecker *m_checker; 22 | #if _DEBUG_LOG 23 | FILE *m_pLogFile; 24 | #endif 25 | }; 26 | 27 | DECLARE_APP(MerryApp) 28 | 29 | #endif -------------------------------------------------------------------------------- /src/MerryCommand.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MerryCommand.cpp -------------------------------------------------------------------------------- /src/MerryCommand.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_COMMAND_H_ 2 | #define _MERRY_COMMAND_H_ 3 | #include "MerryWx.h" 4 | #include "ALMRunCommon.h" 5 | 6 | #define CMDS_FLAG_CMDS 1 7 | #define CMDS_FLAG_DIRS 2 8 | #define CMDS_FLAG_LUA 4 9 | #define CMDS_FLAG_ALTRUN 8 10 | #define CMDS_FLAG_PLUGIN -1 11 | 12 | 13 | class MerryCommand 14 | { 15 | public: 16 | MerryCommand(int commandID, const ALMRunCMDBase* cmd); 17 | MerryCommand(int commandID, const wxString& commandName,const wxString& commandDesc = wxEmptyString,const wxString& commandLine = wxEmptyString,const wxString& workDir = wxEmptyString, int funcRef = 0, const wxString& triggerKey = wxEmptyString,const int order = 0); 18 | ~MerryCommand(); 19 | 20 | int GetCommandID() const { return m_commandID; } 21 | int GetFlags() const { return m_flags; } 22 | const wxString& GetCommandName() const { return m_commandName; } 23 | const wxString& GetCommandName(const int) const { return m_commandFName; } 24 | const wxString& GetTriggerKey() const { return m_triggerKey; } 25 | const wxString& GetCommandDesc() const { return m_commandDesc; } 26 | const wxString& GetWorkDir() const{ return m_commandWorkDir;} 27 | wxString GetCmd() const; 28 | int GetOrder() const; 29 | int SetOrder(); 30 | wxString GetDetails() const; 31 | void Execute(const wxString& commandArg) const; 32 | int m_compare; 33 | private: 34 | void conf_cmd(); 35 | DWORD PID; 36 | int m_order; 37 | int m_commandID; 38 | wxString m_commandName; 39 | wxString m_commandDesc; 40 | wxString m_commandLine; 41 | wxString m_commandFName; 42 | wxString m_commandWorkDir; 43 | int m_commandFunc; 44 | int m_flags; 45 | wxString m_triggerKey; 46 | 47 | }; 48 | extern const MerryCommand* LastCmd; 49 | #endif 50 | -------------------------------------------------------------------------------- /src/MerryCommandManager.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MerryCommandManager.cpp -------------------------------------------------------------------------------- /src/MerryCommandManager.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_COMMAND_MANAGER_H_ 2 | #define _MERRY_COMMAND_MANAGER_H_ 3 | 4 | #include "MerryCommand.h" 5 | #include "ALMRunConfig.h" 6 | #include "MerryLua.h" 7 | #include 8 | 9 | typedef std::vector MerryCommandArray; 10 | 11 | class MerryCommandManager 12 | { 13 | public: 14 | ~MerryCommandManager(); 15 | const void AddFiles(const wxArrayString& files); 16 | const void AddFiles(const wxArrayString& files,const wxArrayString& excludes); 17 | const int AddCommand(const ALMRunCMDBase* cmd); 18 | const int AddCommand(const wxString& file); 19 | const int AddCommand(const wxString& commandName,const wxString& commandDesc,const wxString& commandLine = wxEmptyString,const wxString& commandWorkDir = wxEmptyString, int funcRef = 0, const wxString& triggerKey = wxEmptyString,int flags = 0); 20 | const MerryCommand* GetCommand(int commandID) const; 21 | bool DelCommand(int commandID); 22 | MerryCommandArray Collect(const wxString& commandPrefix); 23 | void GetPluginCmd(const wxString& name,MerryCommandArray& commands); 24 | void clearCmds(MerryCommandArray& cmds); 25 | private: 26 | // void AddPluginCmd(lua_State* L); 27 | MerryCommandArray plugin_commands; 28 | MerryCommandArray m_commands; 29 | }; 30 | 31 | extern MerryCommandManager* g_commands; 32 | #endif 33 | -------------------------------------------------------------------------------- /src/MerryController.cpp: -------------------------------------------------------------------------------- 1 | #include "MerryController.h" 2 | 3 | MerryController* g_controller = NULL; 4 | 5 | void MerryController::GetMousePosition(int& x, int& y) const 6 | { 7 | wxPoint mousePoint = ::wxGetMousePosition(); 8 | x = mousePoint.x; 9 | y = mousePoint.y; 10 | } 11 | 12 | void MerryController::SetMousePosition(int x, int y) 13 | { 14 | m_simulator.MouseMove(x, y); 15 | } 16 | 17 | void MerryController::EnterText(const wxString& text) 18 | { 19 | m_simulator.Text(text); 20 | } 21 | -------------------------------------------------------------------------------- /src/MerryController.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_CONTROLLER_H_ 2 | #define _MERRY_CONTROLLER_H_ 3 | 4 | #include "MerryWx.h" 5 | #include 6 | #include 7 | #ifdef __WXGTK__ 8 | #include 9 | #endif 10 | 11 | class MerryController 12 | { 13 | public: 14 | MerryController(); 15 | ~MerryController(); 16 | 17 | void* GetForegroundWindow() const; 18 | void SetForegroundWindow(void* window) const; 19 | // show = normal, hide, min, max, restore 20 | void ShowWindow(void* window, const wxString& show) const; 21 | void CloseWindow(void* window) const; 22 | bool IsWindowMax(void* window) const; 23 | bool IsWindowMin(void* window) const; 24 | bool IsWindowShown(void* window) const; 25 | wxString GetWindowText(void* window) const; 26 | void SetWindowText(void* window, const wxString& text) const; 27 | void GetWindowSize(void* window, int& width, int& height) const; 28 | void SetWindowSize(void* window, int width, int height) const; 29 | void GetWindowPosition(void* window, int& x, int& y) const; 30 | void SetWindowPosition(void* window, int x, int y) const; 31 | void* FindWindow(const wxString& ClassName,const wxString& WindowName) const; 32 | void* FindWindowEx(void* Parent,void *Child,const wxString& ClassName,const wxString& WindowName) const; 33 | BOOL SetWindowPos(void *hWnd,void *hWndInsertAfter,int X,int Y,int cx,int cy,UINT uFlags) const; 34 | wxString GetClipboardData(void) const; 35 | void SetClipboardData(const wxString& text) const; 36 | void GetMousePosition(int& x, int& y) const; 37 | void SetMousePosition(int x, int y); 38 | 39 | void EnterKey(const wxArrayString& keys); 40 | void EnterText(const wxString& text); 41 | 42 | #ifdef __WXMSW__ 43 | DWORD ShellExecute(const wxString& commandName, 44 | const wxString& commandArg = wxEmptyString, 45 | const wxString& workingDir = wxEmptyString, 46 | const wxString& show = wxEmptyString) const; 47 | #else 48 | // show = normal, hide, min, max 49 | bool ShellExecute(const wxString& commandName, 50 | const wxString& commandArg = wxEmptyString, 51 | const wxString& workingDir = wxEmptyString, 52 | const wxString& show = wxEmptyString) const; 53 | #endif 54 | private: 55 | wxUIActionSimulator m_simulator; 56 | 57 | private: 58 | #ifdef __WXMSW__ 59 | void AddInputKey(std::vector& input, int keyCode, bool isDown = true) const; 60 | #endif 61 | 62 | #ifdef __WXGTK__ 63 | bool IsFeatureSupported(const char* feature) const; 64 | unsigned char* GetWindowPropertyByAtom(Window window, Atom atom, 65 | long* nitems, Atom* type, int* size) const; 66 | long GetDesktopForWindow(Window window) const; 67 | bool SetCurrentDesktop(long desktop) const; 68 | #endif 69 | 70 | private: 71 | #ifdef __WXGTK__ 72 | Display* m_display; 73 | #endif 74 | }; 75 | 76 | #ifdef __WXMSW__ 77 | bool Wow64Revert(PVOID old); 78 | bool Wow64Disable(PVOID *old); 79 | #endif 80 | extern MerryController* g_controller; 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /src/MerryControllerLinux.cpp: -------------------------------------------------------------------------------- 1 | // xdotool 2 | 3 | #include "MerryController.h" 4 | 5 | #ifdef __WXGTK__ 6 | 7 | MerryController::MerryController() 8 | { 9 | m_display = XOpenDisplay(NULL); 10 | } 11 | 12 | MerryController::~MerryController() 13 | { 14 | XCloseDisplay(m_display); 15 | } 16 | 17 | bool MerryController::IsFeatureSupported(const char* feature) const 18 | { 19 | Atom request = XInternAtom(m_display, "_NET_SUPPORTED", False); 20 | Atom featureAtom = XInternAtom(m_display, feature, False); 21 | Window root = XDefaultRootWindow(m_display); 22 | 23 | Atom type = 0; 24 | long nitems = 0L; 25 | int size = 0; 26 | Atom* results = (Atom*)this->GetWindowPropertyByAtom(root, request, &nitems, &type, &size); 27 | for (int i=0; iIsFeatureSupported("_NET_WM_DESKTOP")); 67 | if (!this->IsFeatureSupported("_NET_WM_DESKTOP")) 68 | return -1; 69 | 70 | Atom request = XInternAtom(m_display, "_NET_WM_DESKTOP", False); 71 | Atom type; 72 | int size; 73 | long nitems; 74 | unsigned char* data = this->GetWindowPropertyByAtom(window, request, &nitems, &type, &size); 75 | 76 | long desktop = -1; 77 | if (nitems > 0) 78 | desktop = *((long*)data); 79 | free(data); 80 | 81 | return desktop; 82 | } 83 | 84 | bool MerryController::SetCurrentDesktop(long desktop) const 85 | { 86 | assert(this->IsFeatureSupported("_NET_CURRENT_DESKTOP")); 87 | if (!this->IsFeatureSupported("_NET_CURRENT_DESKTOP")) 88 | return false; 89 | 90 | Window root = RootWindow(m_display, 0); 91 | XEvent xev; 92 | memset(&xev, 0, sizeof(xev)); 93 | xev.type = ClientMessage; 94 | xev.xclient.display = m_display; 95 | xev.xclient.window = root; 96 | xev.xclient.message_type = XInternAtom(m_display, "_NET_CURRENT_DESKTOP", False); 97 | xev.xclient.format = 32; 98 | xev.xclient.data.l[0] = desktop; 99 | xev.xclient.data.l[1] = CurrentTime; 100 | 101 | return XSendEvent(m_display, root, False, 102 | SubstructureNotifyMask | SubstructureRedirectMask, 103 | &xev) == 0; 104 | } 105 | 106 | void* MerryController::GetForegroundWindow() const 107 | { 108 | assert(this->IsFeatureSupported("_NET_ACTIVE_WINDOW")); 109 | if (!this->IsFeatureSupported("_NET_ACTIVE_WINDOW")) 110 | return 0; 111 | 112 | Atom request = XInternAtom(m_display, "_NET_ACTIVE_WINDOW", False); 113 | Window root = XDefaultRootWindow(m_display); 114 | Atom type; 115 | int size; 116 | long nitems; 117 | unsigned char* data = this->GetWindowPropertyByAtom(root, request, &nitems, &type, &size); 118 | 119 | Window foregroundWindow = 0; 120 | if (nitems > 0) 121 | foregroundWindow = *((Window*)data); 122 | free(data); 123 | 124 | return (void*)foregroundWindow; 125 | } 126 | 127 | void MerryController::SetForegroundWindow(void* window) const 128 | { 129 | 130 | } 131 | 132 | void MerryController::ShowWindow(void* _window, const wxString& show) const 133 | { 134 | Window window = (Window)_window; 135 | 136 | assert(this->IsFeatureSupported("_NET_ACTIVE_WINDOW")); 137 | if (!this->IsFeatureSupported("_NET_ACTIVE_WINDOW")) 138 | return; 139 | 140 | if (this->IsFeatureSupported("_NET_WM_DESKTOP") && this->IsFeatureSupported("_NET_CURRENT_DESKTOP")) 141 | { 142 | long desktop = this->GetDesktopForWindow(window); 143 | this->SetCurrentDesktop(desktop); 144 | } 145 | 146 | XEvent xev; 147 | memset(&xev, 0, sizeof(xev)); 148 | xev.type = ClientMessage; 149 | xev.xclient.display = m_display; 150 | xev.xclient.window = window; 151 | xev.xclient.message_type = XInternAtom(m_display, "_NET_ACTIVE_WINDOW", False); 152 | xev.xclient.format = 32; 153 | xev.xclient.data.l[0] = 2L; /* 2 == Message from a window pager */ 154 | xev.xclient.data.l[1] = CurrentTime; 155 | 156 | XWindowAttributes wattr; 157 | XGetWindowAttributes(m_display, window, &wattr); 158 | XSendEvent(m_display, wattr.screen->root, False, 159 | SubstructureNotifyMask | SubstructureRedirectMask, 160 | &xev); 161 | } 162 | 163 | void MerryController::CloseWindow(void* window) const 164 | { 165 | 166 | } 167 | 168 | bool MerryController::IsWindowMax(void* window) const 169 | { 170 | return false; 171 | } 172 | 173 | bool MerryController::IsWindowMin(void* window) const 174 | { 175 | return false; 176 | } 177 | 178 | bool MerryController::IsWindowShown(void* window) const 179 | { 180 | return false; 181 | } 182 | 183 | wxString MerryController::GetWindowText(void* window) const 184 | { 185 | return wxT(""); 186 | } 187 | 188 | void MerryController::SetWindowText(void* window, const wxString& text) const 189 | { 190 | 191 | } 192 | 193 | void MerryController::GetWindowSize(void* window, int& width, int& height) const 194 | { 195 | 196 | } 197 | 198 | void MerryController::SetWindowSize(void* window, int width, int height) const 199 | { 200 | 201 | } 202 | 203 | void MerryController::GetWindowPosition(void* window, int& x, int& y) const 204 | { 205 | 206 | } 207 | 208 | void MerryController::SetWindowPosition(void* window, int x, int y) const 209 | { 210 | 211 | } 212 | 213 | void* MerryController::FindWindow(const wxString& ClassName,const wxString& WindowName) const 214 | { 215 | return NULL; 216 | } 217 | 218 | void* MerryController::FindWindowEx(void* Parent,void *Child,const wxString& ClassName,const wxString& WindowName) const 219 | { 220 | return NULL; 221 | } 222 | 223 | BOOL MerryController::SetWindowPos(void *hWnd,void *hWndInsertAfter,int X,int Y,int cx,int cy,UINT uFlags) const 224 | { 225 | return False; 226 | } 227 | 228 | void MerryController::EnterKey(const wxArrayString& keys) 229 | { 230 | 231 | } 232 | 233 | bool MerryController::ShellExecute(const wxString& commandName, 234 | const wxString& commandArg, 235 | const wxString& workingDir, 236 | const wxString& show) const 237 | { 238 | return false; 239 | } 240 | 241 | #endif 242 | -------------------------------------------------------------------------------- /src/MerryControllerMac.mm: -------------------------------------------------------------------------------- 1 | #include "MerryController.h" 2 | 3 | #ifdef __WXOSX__ 4 | 5 | #import 6 | 7 | MerryController::MerryController() 8 | { 9 | 10 | } 11 | 12 | MerryController::~MerryController() 13 | { 14 | 15 | } 16 | 17 | void* MerryController::GetForegroundWindow() const 18 | { 19 | return NULL; 20 | } 21 | 22 | void MerryController::SetForegroundWindow(void* window) const 23 | { 24 | 25 | } 26 | 27 | void MerryController::ShowWindow(void* window, const wxString& show) const 28 | { 29 | 30 | } 31 | 32 | void MerryController::CloseWindow(void* window) const 33 | { 34 | 35 | } 36 | 37 | bool MerryController::IsWindowMax(void* window) const 38 | { 39 | return false; 40 | } 41 | 42 | bool MerryController::IsWindowMin(void* window) const 43 | { 44 | return false; 45 | } 46 | 47 | bool MerryController::IsWindowShown(void* window) const 48 | { 49 | return false; 50 | } 51 | 52 | wxString MerryController::GetWindowText(void* window) const 53 | { 54 | return ""; 55 | } 56 | 57 | void MerryController::SetWindowText(void* window, const wxString& text) const 58 | { 59 | 60 | } 61 | 62 | void MerryController::GetWindowSize(void* window, int& width, int& height) const 63 | { 64 | 65 | } 66 | 67 | void MerryController::SetWindowSize(void* window, int width, int height) const 68 | { 69 | 70 | } 71 | 72 | void MerryController::GetWindowPosition(void* window, int& x, int& y) const 73 | { 74 | 75 | } 76 | 77 | void MerryController::SetWindowPosition(void* window, int x, int y) const 78 | { 79 | 80 | } 81 | 82 | void* MerryController::FindWindow(const wxString& name, void* parentWindow) const 83 | { 84 | return NULL; 85 | } 86 | 87 | void MerryController::EnterKey(const wxArrayString& keys) 88 | { 89 | 90 | } 91 | 92 | bool MerryController::ShellExecute(const wxString& commandName, 93 | const wxString& commandArg, 94 | const wxString& workingDir, 95 | const wxString& show) const 96 | { 97 | wxString cwd = ::wxGetCwd(); 98 | if (!workingDir.IsEmpty()) 99 | ::wxSetWorkingDirectory(workingDir); 100 | 101 | wxString shell = wxT("open \"") + commandName + wxT("\""); 102 | if (!commandArg.IsEmpty()) 103 | shell += wxT(" --args ") + commandArg; 104 | bool isOk = ::wxShell(shell); 105 | 106 | ::wxSetWorkingDirectory(cwd); 107 | 108 | return isOk; 109 | } 110 | 111 | #endif 112 | -------------------------------------------------------------------------------- /src/MerryControllerWindows.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MerryControllerWindows.cpp -------------------------------------------------------------------------------- /src/MerryError.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MerryError.cpp -------------------------------------------------------------------------------- /src/MerryError.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_ERROR_H_ 2 | #define _MERRY_ERROR_H_ 3 | 4 | #include 5 | 6 | const wxString& MerryGetLastError(); 7 | void MerrySetLastError(const wxString& error); 8 | void ShowErrinfo(const int error_type = 0); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/MerryFrame.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MerryFrame.cpp -------------------------------------------------------------------------------- /src/MerryFrame.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_FRAME_H_ 2 | #define _MERRY_FRAME_H_ 3 | 4 | #include "MerryWx.h" 5 | 6 | class MerryMainPanel; 7 | class MerryListBoxPanel; 8 | class MerryTaskBarIcon; 9 | class MerryFrame : public wxFrame 10 | { 11 | public: 12 | MerryFrame(); 13 | ~MerryFrame(); 14 | void OnInit(); 15 | void OnClose(); 16 | void OpenConfigDir(); 17 | void NewConfig(); 18 | void setTitle(const wxString& title); 19 | void ShowTrayIcon(const bool show); 20 | 21 | MerryListBoxPanel* GetListBoxPanel(); 22 | 23 | private: 24 | void onContextMenu(wxContextMenuEvent& e); 25 | void OnCloseEvent(wxCloseEvent& e); 26 | void OnActivateEvent(wxActivateEvent& e); 27 | void OnShowEvent(wxShowEvent& e); 28 | 29 | private: 30 | void CentreOnce(); 31 | 32 | private: 33 | MerryMainPanel* m_mainPanel; 34 | MerryListBoxPanel* m_listBoxPanel; 35 | MerryTaskBarIcon* m_taskBarIcon; 36 | 37 | bool m_isCentred; 38 | 39 | private: 40 | DECLARE_EVENT_TABLE() 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/MerryHelper.cpp: -------------------------------------------------------------------------------- 1 | #include "MerryHelper.h" 2 | #include "MerryKey.h" 3 | /* 4 | void MerryParseCommandStr(const wxString& commandStr, wxString& commandName, wxString& commandArg) 5 | { 6 | bool inQM = false; 7 | bool inText = false; 8 | bool inSpace = false; 9 | 10 | // http://alter.org.ua/docs/win/args/ 11 | size_t i; 12 | for (i=0; i::const_iterator it = m_registerCommands.begin(); 18 | for (; it != m_registerCommands.end(); ++it) 19 | { 20 | int commandID = *it; 21 | this->OnUnregisterHotkey(commandID); 22 | } 23 | std::set().swap(m_registerCommands); 24 | __DEBUG_END("") 25 | } 26 | 27 | bool MerryHotkey::RegisterHotkey(int commandID) 28 | { 29 | if (m_registerCommands.find(commandID) != m_registerCommands.end()) 30 | { 31 | ::MerrySetLastError(wxString::Format(wxT("Command id %d already register"), commandID)); 32 | return false; 33 | } 34 | const MerryCommand* command = g_commands->GetCommand(commandID); 35 | if (!command) 36 | { 37 | ::MerrySetLastError(wxString::Format(wxT("Command id %d not found"), commandID)); 38 | return false; 39 | } 40 | const wxString& triggerKey = command->GetTriggerKey(); 41 | if (triggerKey.IsEmpty()) 42 | return true; 43 | 44 | int modifiers, keyCode; 45 | if (!::MerryParseKeyStr(triggerKey, modifiers, keyCode)) 46 | { 47 | ::MerrySetLastError(wxString::Format(wxT("Parse command key %s failed"), triggerKey)); 48 | return false; 49 | } 50 | if (!this->OnRegisterHotkey(commandID, modifiers, keyCode)) 51 | { 52 | ::MerrySetLastError(wxString::Format(wxT("Register command key %s failed"), triggerKey)); 53 | return false; 54 | } 55 | 56 | bool isOk = m_registerCommands.insert(commandID).second; 57 | assert(isOk); 58 | 59 | return true; 60 | } 61 | 62 | void MerryHotkey::UnregisterHotkey(int commandID) 63 | { 64 | this->OnUnregisterHotkey(commandID); 65 | m_registerCommands.erase(commandID); 66 | } 67 | 68 | void MerryHotkey::OnTriggerKey(int commandID) const 69 | { 70 | const MerryCommand* command = g_commands->GetCommand(commandID); 71 | assert(command); 72 | command->Execute(wxEmptyString); 73 | } 74 | -------------------------------------------------------------------------------- /src/MerryHotkey.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_HOTKEY_H_ 2 | #define _MERRY_HOTKEY_H_ 3 | 4 | #include "MerryWx.h" 5 | #include 6 | 7 | #if defined(__WXMSW__) || defined(__WXOSX__) 8 | # define MERRY_HOTKEY_WX 9 | #elif defined(__WXGTK__) 10 | # define MERRY_HOTKEY_X 11 | #endif 12 | 13 | class MerryHotkey 14 | { 15 | public: 16 | virtual ~MerryHotkey(); 17 | void OnDelete(); 18 | 19 | bool RegisterHotkey(int commandID); 20 | void UnregisterHotkey(int commandID); 21 | 22 | protected: 23 | void OnTriggerKey(int commandID) const; 24 | 25 | virtual bool OnRegisterHotkey(int commandID, int modifiers, int keyCode) = 0; 26 | virtual void OnUnregisterHotkey(int commandID) = 0; 27 | 28 | private: 29 | std::set m_registerCommands; 30 | }; 31 | 32 | extern MerryHotkey* g_hotkey; 33 | extern MerryHotkey* NewMerryHotkey(); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/MerryHotkeyWx.cpp: -------------------------------------------------------------------------------- 1 | #include "MerryHotkeyWx.h" 2 | 3 | #ifdef MERRY_HOTKEY_WX 4 | 5 | MerryHotkey* NewMerryHotkey() 6 | { 7 | return new MerryHotkeyWx(); 8 | } 9 | 10 | MerryHotkeyWx::MerryHotkeyWx(): 11 | wxTopLevelWindow(NULL, wxID_ANY, wxT("MerryHotkey")) 12 | { 13 | 14 | } 15 | 16 | MerryHotkeyWx::~MerryHotkeyWx() 17 | { 18 | __DEBUG_BEGIN("") 19 | this->OnDelete(); 20 | __DEBUG_END("") 21 | } 22 | 23 | bool MerryHotkeyWx::OnRegisterHotkey(int commandID, int modifiers, int keyCode) 24 | { 25 | if (!this->RegisterHotKey(commandID, modifiers, keyCode)) 26 | return false; 27 | this->Connect(commandID, wxEVT_HOTKEY, wxObjectEventFunction(&MerryHotkeyWx::OnTriggerKeyEvent)); 28 | return true; 29 | } 30 | 31 | void MerryHotkeyWx::OnUnregisterHotkey(int commandID) 32 | { 33 | this->Disconnect(commandID); 34 | this->UnregisterHotKey(commandID); 35 | } 36 | 37 | void MerryHotkeyWx::OnTriggerKeyEvent(wxKeyEvent& e) 38 | { 39 | this->OnTriggerKey(e.GetId()); 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/MerryHotkeyWx.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_HOTKEY_WX_H_ 2 | #define _MERRY_HOTKEY_WX_H_ 3 | 4 | #include "MerryHotkey.h" 5 | 6 | #ifdef MERRY_HOTKEY_WX 7 | 8 | class MerryHotkeyWx : public MerryHotkey, private wxTopLevelWindow 9 | { 10 | public: 11 | MerryHotkeyWx(); 12 | virtual ~MerryHotkeyWx(); 13 | 14 | private: 15 | virtual bool OnRegisterHotkey(int commandID, int modifiers, int keyCode); 16 | virtual void OnUnregisterHotkey(int commandID); 17 | 18 | private: 19 | void OnTriggerKeyEvent(wxKeyEvent& e); 20 | }; 21 | 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/MerryHotkeyX.cpp: -------------------------------------------------------------------------------- 1 | #include "MerryHotkeyX.h" 2 | 3 | #ifdef MERRY_HOTKEY_X 4 | 5 | #include 6 | #include 7 | 8 | MerryHotkey* NewMerryHotkey() 9 | { 10 | return new MerryHotkeyX(); 11 | } 12 | 13 | MerryHotkeyX::MerryHotkeyX() 14 | { 15 | m_display = XOpenDisplay(NULL); 16 | m_rootWindow = DefaultRootWindow(m_display); 17 | XSelectInput(m_display, m_rootWindow, KeyPressMask); 18 | 19 | this->Start(50); 20 | } 21 | 22 | MerryHotkeyX::~MerryHotkeyX() 23 | { 24 | XCloseDisplay(m_display); 25 | this->OnDelete(); 26 | } 27 | 28 | bool MerryHotkeyX::OnRegisterHotkey(int commandID, int modifiers, int keyCode) 29 | { 30 | if (keyCode == 0) 31 | return false; 32 | 33 | int xModifiers = 0; 34 | if (modifiers & wxMOD_ALT) 35 | xModifiers |= Mod1Mask; 36 | else if (modifiers & wxMOD_CONTROL) 37 | xModifiers |= ControlMask; 38 | else if (modifiers & wxMOD_SHIFT) 39 | xModifiers |= ShiftMask; 40 | else if (modifiers & wxMOD_WIN) 41 | xModifiers |= 0; 42 | else if (modifiers & wxMOD_META) 43 | xModifiers |= 0; 44 | 45 | int xKeyCode = wxCharCodeWXToX(keyCode); 46 | xKeyCode = XKeysymToKeycode(m_display, xKeyCode); 47 | XGrabKey(m_display, xKeyCode, xModifiers, m_rootWindow, False, GrabModeAsync, GrabModeAsync); 48 | 49 | uint64_t keyCodeAndModifiers = this->MakeKeyCodeAndModifiers(xKeyCode, xModifiers); 50 | m_toCommandID[keyCodeAndModifiers] = commandID; 51 | m_toKeyCodeAndModifiers[commandID] = keyCodeAndModifiers; 52 | 53 | return true; 54 | } 55 | 56 | void MerryHotkeyX::OnUnregisterHotkey(int commandID) 57 | { 58 | if (m_toKeyCodeAndModifiers.find(commandID) == m_toKeyCodeAndModifiers.end()) 59 | return; 60 | 61 | uint64_t keyCodeAndModifiers = m_toKeyCodeAndModifiers[commandID]; 62 | assert(m_toCommandID[keyCodeAndModifiers] == commandID); 63 | int keyCode, modifiers; 64 | this->GetKeyCodeAndModifiers(keyCodeAndModifiers, keyCode, modifiers); 65 | XUngrabKey(m_display, keyCode, modifiers, m_rootWindow); 66 | 67 | m_toCommandID.erase(keyCodeAndModifiers); 68 | m_toKeyCodeAndModifiers.erase(commandID); 69 | } 70 | 71 | void MerryHotkeyX::Notify() 72 | { 73 | XEvent xEvent; 74 | if (XCheckWindowEvent(m_display, m_rootWindow, KeyPressMask, &xEvent)) 75 | { 76 | uint64_t keyCodeAndModifiers = this->MakeKeyCodeAndModifiers(xEvent.xkey.keycode, xEvent.xkey.state); 77 | // assert(m_toCommandID.find(keyCodeAndModifiers) != m_toCommandID.end()); 78 | if (m_toCommandID.find(keyCodeAndModifiers) != m_toCommandID.end()) 79 | this->OnTriggerKey(m_toCommandID[keyCodeAndModifiers]); 80 | } 81 | } 82 | 83 | uint64_t MerryHotkeyX::MakeKeyCodeAndModifiers(int keyCode, int modifiers) const 84 | { 85 | assert(sizeof(int) == 4); 86 | 87 | uint64_t keyCodeAndModifiers = 0; 88 | keyCodeAndModifiers |= (((uint64_t)keyCode & 0x00000000FFFFFFFF) << 32); 89 | keyCodeAndModifiers |= ((uint64_t)modifiers & 0x00000000FFFFFFFF); 90 | return keyCodeAndModifiers; 91 | } 92 | 93 | void MerryHotkeyX::GetKeyCodeAndModifiers(uint64_t keyCodeAndModifiers, int& keyCode, int& modifiers) const 94 | { 95 | keyCode = (keyCodeAndModifiers >> 32); 96 | modifiers = keyCodeAndModifiers; 97 | } 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /src/MerryHotkeyX.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_HOTKEY_X_H_ 2 | #define _MERRY_HOTKEY_X_H_ 3 | 4 | #include "MerryHotkey.h" 5 | 6 | #ifdef MERRY_HOTKEY_X 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | class MerryHotkeyX : public MerryHotkey, private wxTimer 13 | { 14 | public: 15 | MerryHotkeyX(); 16 | ~MerryHotkeyX(); 17 | 18 | private: 19 | virtual bool OnRegisterHotkey(int commandID, int modifiers, int keyCode); 20 | virtual void OnUnregisterHotkey(int commandID); 21 | 22 | virtual void Notify(); 23 | 24 | uint64_t MakeKeyCodeAndModifiers(int keyCode, int modifiers) const; 25 | void GetKeyCodeAndModifiers(uint64_t keyCodeAndModifiers, int& keyCode, int& modifiers) const; 26 | 27 | private: 28 | Display* m_display; 29 | Window m_rootWindow; 30 | std::map m_toCommandID; 31 | std::map m_toKeyCodeAndModifiers; 32 | }; 33 | 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/MerryIcon.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char *MerryIcon_xpm[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "64 64 99 2", 5 | " c gray10", 6 | ". c #1B1B1B", 7 | "X c gray11", 8 | "o c #1D1D1D", 9 | "O c #1E1E1E", 10 | "+ c #202020", 11 | "@ c gray13", 12 | "# c gray14", 13 | "$ c gray16", 14 | "% c #2A2A2A", 15 | "& c gray17", 16 | "* c #2C2C2C", 17 | "= c #2D2D2D", 18 | "- c gray18", 19 | "; c #2F2F2F", 20 | ": c #313131", 21 | "> c #323232", 22 | ", c #343434", 23 | "< c gray21", 24 | "1 c gray22", 25 | "2 c #3C3C3C", 26 | "3 c gray24", 27 | "4 c #414141", 28 | "5 c #444444", 29 | "6 c gray27", 30 | "7 c gray28", 31 | "8 c #484848", 32 | "9 c #4C4C4C", 33 | "0 c #505050", 34 | "q c #515151", 35 | "w c gray33", 36 | "e c #565656", 37 | "r c #585858", 38 | "t c #5A5A5A", 39 | "y c gray36", 40 | "u c #606060", 41 | "i c #646464", 42 | "p c #6A6A6A", 43 | "a c gray43", 44 | "s c gray45", 45 | "d c #777777", 46 | "f c gray47", 47 | "g c #818181", 48 | "h c gray54", 49 | "j c #909090", 50 | "k c #929292", 51 | "l c gray58", 52 | "z c #959595", 53 | "x c #979797", 54 | "c c gray60", 55 | "v c #9B9B9B", 56 | "b c #9D9D9D", 57 | "n c gray62", 58 | "m c #9F9F9F", 59 | "M c #A0A0A0", 60 | "N c #A2A2A2", 61 | "B c #A4A4A4", 62 | "V c #A7A7A7", 63 | "C c #A9A9A9", 64 | "Z c gray68", 65 | "A c #B1B1B1", 66 | "S c gray71", 67 | "D c gray72", 68 | "F c #B9B9B9", 69 | "G c gray73", 70 | "H c #BCBCBC", 71 | "J c gray74", 72 | "K c #C1C1C1", 73 | "L c gray76", 74 | "P c #C5C5C5", 75 | "I c #C6C6C6", 76 | "U c gray79", 77 | "Y c #CBCBCB", 78 | "T c gray80", 79 | "R c gray81", 80 | "E c gray82", 81 | "W c LightGray", 82 | "Q c #D7D7D7", 83 | "! c gray85", 84 | "~ c gainsboro", 85 | "^ c #DFDFDF", 86 | "/ c gray88", 87 | "( c gray89", 88 | ") c gray90", 89 | "_ c #E6E6E6", 90 | "` c gray93", 91 | "' c #F1F1F1", 92 | "] c gray95", 93 | "[ c #F3F3F3", 94 | "{ c gray96", 95 | "} c #F6F6F6", 96 | "| c gray97", 97 | " . c #F8F8F8", 98 | ".. c #F9F9F9", 99 | "X. c gray98", 100 | "o. c #FBFBFB", 101 | "O. c gray99", 102 | "+. c #FDFDFD", 103 | "@. c gray100", 104 | /* pixels */ 105 | " ", 106 | " ", 107 | " ", 108 | " ", 109 | " ", 110 | " ", 111 | " ", 112 | " ", 113 | " ", 114 | " ", 115 | " ", 116 | " ", 117 | " ", 118 | " ", 119 | " ", 120 | " @.@.@.@.@.@.@.@.D j @.@.@.@.@.@.@.@. ", 121 | " @.@.@.@.@.@.@.@.@.7 % ] @.@.@.@.@.@.@.@. ", 122 | " @.@.@.@.@.@.@.@.@.H k @.@.@.@.@.@.@.@.@. ", 123 | " @.@.@.@.@.@.@.@.@.@.9 & [ @.@.@.@.@.@.@.@.@. ", 124 | " @.@.@.@.@.@.@.@.@.@.L z @.@.@.@.@.@.@.@.@.@. ", 125 | " @.@.@.@.@.@.@.@.@.@.@.0 * { @.@.@.@.@.@.@.@.@.@. ", 126 | " @.@.@.@.@.@.@.@.@.@.@.I x @.@.@.@.@.@.@.@.@.@.@. ", 127 | " @.@.@.@.@.@.@.@.@.@.@.@.e = { @.@.@.@.@.@.@.@.@.@.@. ", 128 | " @.@.@.@.@.@.@.@.@.@.@.@.Y c @.@.@.@.@.@.@.@.@.@.@.@. ", 129 | " @.@.@.@.@.@.@.@.@.@.@.@.@.t ; } @.@.@.@.@.@.@.@.@.@.@.@. ", 130 | " @.@.@.@.@.@.@.@.@.@.@.@.@.R v @.@.@.@.@.@.@.@.@.@.@.@.@. ", 131 | " @.@.@.@.@.@.@.@.@.@.@.@.@.@.u : } @.@.@.@.@.@.@.@.@.@.@.@.@. ", 132 | " @.@.@.@.@.G @.@.@.@.@.@.@.@.W n @.@.@.@.Q @.@.@.@.@.@.@.@.@. ", 133 | " @.@.@.@.@.5 +.@.@.@.@.@.@.@.@.i > | @.@.@.@.i @.@.@.@.@.@.@.@.@. ", 134 | " @.@.@.@.@. A @.@.@.@.@.@.@.@.Q . M @.@.@.@.W @.@.@.@.@.@.@.@.@. ", 135 | " @.@.@.@.@. 2 o.@.@.@.@.@.@.@.@.p , .@.@.@.@.u @.@.@.@.@.@.@.@.@. ", 136 | " @.@.@.@.@. V @.@.@.@.@.@.@.@.~ . N @.@.@.@.E @.@.@.@.@.@.@.@.@. ", 137 | " @.@.@.@.@. , .@.@.@.@.@.@.@.@.a , ..@.@.@.@.y @.@.@.@.@.@.@.@.@. ", 138 | " @.@.@.@.@. b @.@.@.@.@.@.@.@.^ X B @.@.@.@.T @.@.@.@.@.@.@.@.@. ", 139 | " @.@.@.@.@. - { @.@.@.@.@.@.@.@.s < X.@.@.@.@.r @.@.@.@.@.@.@.@.@. ", 140 | " @.@.@.@.@. l @.@.@.@.@.@.@.@.( O V @.@.@.@.U @.@.@.@.@.@.@.@.@. ", 141 | " @.@.@.@.@. $ ' @.@.@.@.@.@.@.@.f 1 X.@.@.@.@.w @.@.@.@.@.@.@.@.@. ", 142 | " @.@.@.@.@. h @.@.@.@.@.@.@.@.) + C @.@.@.@.P @.@.@.@.@.@.@.@.@. ", 143 | " @.@.@.@.@. # ` @.@.@.@.@.@.@.@.m o.@.@.@.@.0 @.@.@.@.@.@.@.@.@. ", 144 | " @.@.@.@.@. g @.@.@.@.@.@.@.@.@.@.@.@.@.K @.@.@.@.@.@.@.@.@. ", 145 | " @.@.@.@.@. @ _ @.@.@.@.@.@.@.@.@.@.@.@.9 @.@.@.@.@.@.@.@.@. ", 146 | " @.@.@.@.@. d @.@.@.@.@.@.@.@.@.@.@.J @.@.@.@.@.@.@.@.@. ", 147 | " @.@.@.@.@. o / @.@.@.@.@.@.@.@.@.@.8 @.@.@.@.@.@.@.@.@. ", 148 | " @.@.@.@.@. a @.@.@.@.@.@.@.@.@.F @.@.@.@.@.@.@.@.@. ", 149 | " @.@.@.@.@. . ! @.@.@.@.@.@.@.+.6 @.@.@.@.@.@.@.@.@. ", 150 | " @.@.@.@.@. i @.@.@.@.@.@.@.S @.@.@.@.@.@.@.@.@. ", 151 | " @.@.@.@.@. E @.@.@.@.@.+.4 @.@.@.@.@.@.@.@.@. ", 152 | " @.@.@.@.@. t @.@.@.@.@.A @.@.@.@.@.@.@.@.@. ", 153 | " @.@.@.@.@. U @.@.@.O.3 @.@.@.@.@.@.@.@.@. ", 154 | " @.@.@.@.@. q @.@.@.Z @.@.@.@.@.@.@.@.@. ", 155 | " ", 156 | " ", 157 | " ", 158 | " ", 159 | " ", 160 | " ", 161 | " ", 162 | " ", 163 | " ", 164 | " ", 165 | " ", 166 | " ", 167 | " ", 168 | " " 169 | }; 170 | -------------------------------------------------------------------------------- /src/MerryInformationDialog.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MerryInformationDialog.cpp -------------------------------------------------------------------------------- /src/MerryInformationDialog.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_INFORMATION_DIALOG_H_ 2 | #define _MERRY_INFORMATION_DIALOG_H_ 3 | 4 | #include "MerryWx.h" 5 | 6 | class MerryInformationDialog : public wxDialog 7 | { 8 | public: 9 | MerryInformationDialog(const wxString& title, const wxString& information); 10 | MerryInformationDialog(const wxString& title, const wxString& information,const wxString& check); 11 | bool isChecked(); 12 | 13 | private: 14 | void OnButtonOKEvent(wxCommandEvent& e); 15 | void OnCloseEvent(wxCloseEvent& e); 16 | wxCheckBox *check_flag; 17 | 18 | private: 19 | DECLARE_EVENT_TABLE() 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/MerryKey.cpp: -------------------------------------------------------------------------------- 1 | #include "MerryKey.h" 2 | #ifdef __WXMSW__ 3 | #include 4 | #endif 5 | 6 | MerryKey g_keys; 7 | 8 | MerryKey::~MerryKey() 9 | { 10 | __DEBUG_BEGIN("") 11 | m_wxKeys.clear(); 12 | __DEBUG_END("") 13 | } 14 | 15 | MerryKey::MerryKey() 16 | { 17 | m_wxKeys[wxT("BACK")] = WXK_BACK; 18 | m_wxKeys[wxT("TAB")] = WXK_TAB; 19 | m_wxKeys[wxT("RETURN")] = WXK_RETURN; 20 | m_wxKeys[wxT("ESCAPE")] = WXK_ESCAPE; 21 | m_wxKeys[wxT("SPACE")] = WXK_SPACE; 22 | m_wxKeys[wxT("DELETE")] = WXK_DELETE; 23 | m_wxKeys[wxT("LBUTTON")] = WXK_LBUTTON; 24 | m_wxKeys[wxT("RBUTTON")] = WXK_RBUTTON; 25 | m_wxKeys[wxT("CANCEL")] = WXK_CANCEL; 26 | m_wxKeys[wxT("MBUTTON")] = WXK_MBUTTON; 27 | m_wxKeys[wxT("CLEAR")] = WXK_CLEAR; 28 | m_wxKeys[wxT("SHIFT")] = WXK_SHIFT; 29 | m_wxKeys[wxT("ALT")] = WXK_ALT; 30 | m_wxKeys[wxT("CONTROL")] = WXK_CONTROL; 31 | m_wxKeys[wxT("MENU")] = WXK_MENU; 32 | m_wxKeys[wxT("PAUSE")] = WXK_PAUSE; 33 | m_wxKeys[wxT("CAPITAL")] = WXK_CAPITAL; 34 | m_wxKeys[wxT("END")] = WXK_END; 35 | m_wxKeys[wxT("HOME")] = WXK_HOME; 36 | m_wxKeys[wxT("LEFT")] = WXK_LEFT; 37 | m_wxKeys[wxT("UP")] = WXK_UP; 38 | m_wxKeys[wxT("RIGHT")] = WXK_RIGHT; 39 | m_wxKeys[wxT("DOWN")] = WXK_DOWN; 40 | m_wxKeys[wxT("SELECT")] = WXK_SELECT; 41 | m_wxKeys[wxT("PRINT")] = WXK_PRINT; 42 | m_wxKeys[wxT("EXECUTE")] = WXK_EXECUTE; 43 | m_wxKeys[wxT("SNAPSHOT")] = WXK_SNAPSHOT; 44 | m_wxKeys[wxT("INSERT")] = WXK_INSERT; 45 | m_wxKeys[wxT("HELP")] = WXK_HELP; 46 | m_wxKeys[wxT("NUMPAD0")] = WXK_NUMPAD0; 47 | m_wxKeys[wxT("NUMPAD1")] = WXK_NUMPAD1; 48 | m_wxKeys[wxT("NUMPAD2")] = WXK_NUMPAD2; 49 | m_wxKeys[wxT("NUMPAD3")] = WXK_NUMPAD3; 50 | m_wxKeys[wxT("NUMPAD4")] = WXK_NUMPAD4; 51 | m_wxKeys[wxT("NUMPAD5")] = WXK_NUMPAD5; 52 | m_wxKeys[wxT("NUMPAD6")] = WXK_NUMPAD6; 53 | m_wxKeys[wxT("NUMPAD7")] = WXK_NUMPAD7; 54 | m_wxKeys[wxT("NUMPAD8")] = WXK_NUMPAD8; 55 | m_wxKeys[wxT("NUMPAD9")] = WXK_NUMPAD9; 56 | m_wxKeys[wxT("MULTIPLY")] = WXK_MULTIPLY; 57 | m_wxKeys[wxT("ADD")] = WXK_ADD; 58 | m_wxKeys[wxT("SEPARATOR")] = WXK_SEPARATOR; 59 | m_wxKeys[wxT("SUBTRACT")] = WXK_SUBTRACT; 60 | m_wxKeys[wxT("DECIMAL")] = WXK_DECIMAL; 61 | m_wxKeys[wxT("DIVIDE")] = WXK_DIVIDE; 62 | m_wxKeys[wxT("F1")] = WXK_F1; 63 | m_wxKeys[wxT("F2")] = WXK_F2; 64 | m_wxKeys[wxT("F3")] = WXK_F3; 65 | m_wxKeys[wxT("F4")] = WXK_F4; 66 | m_wxKeys[wxT("F5")] = WXK_F5; 67 | m_wxKeys[wxT("F6")] = WXK_F6; 68 | m_wxKeys[wxT("F7")] = WXK_F7; 69 | m_wxKeys[wxT("F8")] = WXK_F8; 70 | m_wxKeys[wxT("F9")] = WXK_F9; 71 | m_wxKeys[wxT("F10")] = WXK_F10; 72 | m_wxKeys[wxT("F11")] = WXK_F11; 73 | m_wxKeys[wxT("F12")] = WXK_F12; 74 | m_wxKeys[wxT("F13")] = WXK_F13; 75 | m_wxKeys[wxT("F14")] = WXK_F14; 76 | m_wxKeys[wxT("F15")] = WXK_F15; 77 | m_wxKeys[wxT("F16")] = WXK_F16; 78 | m_wxKeys[wxT("F17")] = WXK_F17; 79 | m_wxKeys[wxT("F18")] = WXK_F18; 80 | m_wxKeys[wxT("F19")] = WXK_F19; 81 | m_wxKeys[wxT("F20")] = WXK_F20; 82 | m_wxKeys[wxT("F21")] = WXK_F21; 83 | m_wxKeys[wxT("F22")] = WXK_F22; 84 | m_wxKeys[wxT("F23")] = WXK_F23; 85 | m_wxKeys[wxT("F24")] = WXK_F24; 86 | m_wxKeys[wxT("NUMLOCK")] = WXK_NUMLOCK; 87 | m_wxKeys[wxT("SCROLL")] = WXK_SCROLL; 88 | m_wxKeys[wxT("PAGEUP")] = WXK_PAGEUP; 89 | m_wxKeys[wxT("PAGEDOWN")] = WXK_PAGEDOWN; 90 | m_wxKeys[wxT("NUMPAD_SPACE")] = WXK_NUMPAD_SPACE; 91 | m_wxKeys[wxT("NUMPAD_TAB")] = WXK_NUMPAD_TAB; 92 | m_wxKeys[wxT("NUMPAD_ENTER")] = WXK_NUMPAD_ENTER; 93 | m_wxKeys[wxT("NUMPAD_F1")] = WXK_NUMPAD_F1; 94 | m_wxKeys[wxT("NUMPAD_F2")] = WXK_NUMPAD_F2; 95 | m_wxKeys[wxT("NUMPAD_F3")] = WXK_NUMPAD_F3; 96 | m_wxKeys[wxT("NUMPAD_F4")] = WXK_NUMPAD_F4; 97 | m_wxKeys[wxT("NUMPAD_HOME")] = WXK_NUMPAD_HOME; 98 | m_wxKeys[wxT("NUMPAD_LEFT")] = WXK_NUMPAD_LEFT; 99 | m_wxKeys[wxT("NUMPAD_UP")] = WXK_NUMPAD_UP; 100 | m_wxKeys[wxT("NUMPAD_RIGHT")] = WXK_NUMPAD_RIGHT; 101 | m_wxKeys[wxT("NUMPAD_DOWN")] = WXK_NUMPAD_DOWN; 102 | m_wxKeys[wxT("NUMPAD_PAGEUP")] = WXK_NUMPAD_PAGEUP; 103 | m_wxKeys[wxT("NUMPAD_PAGEDOWN")] = WXK_NUMPAD_PAGEDOWN; 104 | m_wxKeys[wxT("NUMPAD_END")] = WXK_NUMPAD_END; 105 | m_wxKeys[wxT("NUMPAD_BEGIN")] = WXK_NUMPAD_BEGIN; 106 | m_wxKeys[wxT("NUMPAD_INSERT")] = WXK_NUMPAD_INSERT; 107 | m_wxKeys[wxT("NUMPAD_DELETE")] = WXK_NUMPAD_DELETE; 108 | m_wxKeys[wxT("NUMPAD_EQUAL")] = WXK_NUMPAD_EQUAL; 109 | m_wxKeys[wxT("NUMPAD_MULTIPLY")] = WXK_NUMPAD_MULTIPLY; 110 | m_wxKeys[wxT("NUMPAD_ADD")] = WXK_NUMPAD_ADD; 111 | m_wxKeys[wxT("NUMPAD_SEPARATOR")] = WXK_NUMPAD_SEPARATOR; 112 | m_wxKeys[wxT("NUMPAD_SUBTRACT")] = WXK_NUMPAD_SUBTRACT; 113 | m_wxKeys[wxT("NUMPAD_DECIMAL")] = WXK_NUMPAD_DECIMAL; 114 | m_wxKeys[wxT("NUMPAD_DIVIDE")] = WXK_NUMPAD_DIVIDE; 115 | 116 | #ifdef __WXMSW__ 117 | m_windowsKeys[wxT("BACK")] = VK_BACK; 118 | m_windowsKeys[wxT("TAB")] = VK_TAB; 119 | m_windowsKeys[wxT("RETURN")] = VK_RETURN; 120 | m_windowsKeys[wxT("ESCAPE")] = VK_ESCAPE; 121 | m_windowsKeys[wxT("SPACE")] = VK_SPACE; 122 | m_windowsKeys[wxT("DELETE")] = VK_DELETE; 123 | m_windowsKeys[wxT("LBUTTON")] = VK_LBUTTON; 124 | m_windowsKeys[wxT("RBUTTON")] = VK_RBUTTON; 125 | m_windowsKeys[wxT("CANCEL")] = VK_CANCEL; 126 | m_windowsKeys[wxT("MBUTTON")] = VK_MBUTTON; 127 | m_windowsKeys[wxT("CLEAR")] = VK_CLEAR; 128 | m_windowsKeys[wxT("SHIFT")] = VK_SHIFT; 129 | m_windowsKeys[wxT("RSHIFT")] = VK_RSHIFT; 130 | m_windowsKeys[wxT("LSHIFT")] = VK_LSHIFT; 131 | m_windowsKeys[wxT("ALT")] = VK_MENU; 132 | m_windowsKeys[wxT("CONTROL")] = VK_CONTROL; 133 | m_windowsKeys[wxT("CTRL")] = VK_CONTROL;; 134 | m_windowsKeys[wxT("LCTRL")] = VK_LCONTROL; 135 | m_windowsKeys[wxT("RCTRL")] = VK_RCONTROL; 136 | m_windowsKeys[wxT("MENU")] = VK_MENU; 137 | m_windowsKeys[wxT("PAUSE")] = VK_PAUSE; 138 | m_windowsKeys[wxT("CAPITAL")] = VK_CAPITAL; 139 | m_windowsKeys[wxT("END")] = VK_END; 140 | m_windowsKeys[wxT("HOME")] = VK_HOME; 141 | m_windowsKeys[wxT("LEFT")] = VK_LEFT; 142 | m_windowsKeys[wxT("UP")] = VK_UP; 143 | m_windowsKeys[wxT("RIGHT")] = VK_RIGHT; 144 | m_windowsKeys[wxT("DOWN")] = VK_DOWN; 145 | m_windowsKeys[wxT("SELECT")] = VK_SELECT; 146 | m_windowsKeys[wxT("PRINT")] = VK_PRINT; 147 | m_windowsKeys[wxT("EXECUTE")] = VK_EXECUTE; 148 | m_windowsKeys[wxT("SNAPSHOT")] = VK_SNAPSHOT; 149 | m_windowsKeys[wxT("INSERT")] = VK_INSERT; 150 | m_windowsKeys[wxT("HELP")] = VK_HELP; 151 | m_windowsKeys[wxT("NUMPAD0")] = VK_NUMPAD0; 152 | m_windowsKeys[wxT("NUMPAD1")] = VK_NUMPAD1; 153 | m_windowsKeys[wxT("NUMPAD2")] = VK_NUMPAD2; 154 | m_windowsKeys[wxT("NUMPAD3")] = VK_NUMPAD3; 155 | m_windowsKeys[wxT("NUMPAD4")] = VK_NUMPAD4; 156 | m_windowsKeys[wxT("NUMPAD5")] = VK_NUMPAD5; 157 | m_windowsKeys[wxT("NUMPAD6")] = VK_NUMPAD6; 158 | m_windowsKeys[wxT("NUMPAD7")] = VK_NUMPAD7; 159 | m_windowsKeys[wxT("NUMPAD8")] = VK_NUMPAD8; 160 | m_windowsKeys[wxT("NUMPAD9")] = VK_NUMPAD9; 161 | m_windowsKeys[wxT("MULTIPLY")] = VK_MULTIPLY; 162 | m_windowsKeys[wxT("ADD")] = VK_ADD; 163 | m_windowsKeys[wxT("SEPARATOR")] = VK_SEPARATOR; 164 | m_windowsKeys[wxT("SUBTRACT")] = VK_SUBTRACT; 165 | m_windowsKeys[wxT("DECIMAL")] = VK_DECIMAL; 166 | m_windowsKeys[wxT("DIVIDE")] = VK_DIVIDE; 167 | m_windowsKeys[wxT("F1")] = VK_F1; 168 | m_windowsKeys[wxT("F2")] = VK_F2; 169 | m_windowsKeys[wxT("F3")] = VK_F3; 170 | m_windowsKeys[wxT("F4")] = VK_F4; 171 | m_windowsKeys[wxT("F5")] = VK_F5; 172 | m_windowsKeys[wxT("F6")] = VK_F6; 173 | m_windowsKeys[wxT("F7")] = VK_F7; 174 | m_windowsKeys[wxT("F8")] = VK_F8; 175 | m_windowsKeys[wxT("F9")] = VK_F9; 176 | m_windowsKeys[wxT("F10")] = VK_F10; 177 | m_windowsKeys[wxT("F11")] = VK_F11; 178 | m_windowsKeys[wxT("F12")] = VK_F12; 179 | m_windowsKeys[wxT("F13")] = VK_F13; 180 | m_windowsKeys[wxT("F14")] = VK_F14; 181 | m_windowsKeys[wxT("F15")] = VK_F15; 182 | m_windowsKeys[wxT("F16")] = VK_F16; 183 | m_windowsKeys[wxT("F17")] = VK_F17; 184 | m_windowsKeys[wxT("F18")] = VK_F18; 185 | m_windowsKeys[wxT("F19")] = VK_F19; 186 | m_windowsKeys[wxT("F20")] = VK_F20; 187 | m_windowsKeys[wxT("F21")] = VK_F21; 188 | m_windowsKeys[wxT("F22")] = VK_F22; 189 | m_windowsKeys[wxT("F23")] = VK_F23; 190 | m_windowsKeys[wxT("F24")] = VK_F24; 191 | m_windowsKeys[wxT("NUMLOCK")] = VK_NUMLOCK; 192 | m_windowsKeys[wxT("SCROLL")] = VK_SCROLL; 193 | m_windowsKeys[wxT("PAGEUP")] = VK_PRIOR; 194 | m_windowsKeys[wxT("PAGEDOWN")] = VK_NEXT; 195 | 196 | m_windowsKeys[wxT("`")] = VK_OEM_3; 197 | m_windowsKeys[wxT("-")] = VK_OEM_MINUS; 198 | m_windowsKeys[wxT("=")] = VK_OEM_PLUS; 199 | m_windowsKeys[wxT("[")] = VK_OEM_4; 200 | m_windowsKeys[wxT("]")] = VK_OEM_6; 201 | m_windowsKeys[wxT(";")] = VK_OEM_1; 202 | m_windowsKeys[wxT("'")] = VK_OEM_7; 203 | m_windowsKeys[wxT("\\")] = VK_OEM_5; 204 | m_windowsKeys[wxT(",")] = VK_OEM_COMMA; 205 | m_windowsKeys[wxT(".")] = VK_OEM_PERIOD; 206 | m_windowsKeys[wxT("/")] = VK_OEM_2; 207 | #endif 208 | } 209 | 210 | int MerryKey::GetWxKeyCode(const wxString& key) const 211 | { 212 | std::map::const_iterator it = m_wxKeys.find(key); 213 | if (it == m_wxKeys.end()) 214 | return 0; 215 | return it->second; 216 | } 217 | 218 | #ifdef __WXMSW__ 219 | int MerryKey::GetWindowsKeyCode(const wxString& key) const 220 | { 221 | std::map::const_iterator it = m_windowsKeys.find(key); 222 | if (it == m_windowsKeys.end()) 223 | return 0; 224 | return it->second; 225 | } 226 | 227 | wxString MerryKey::GetKeyString(int key) const 228 | { 229 | if (key >= WXK_NUMPAD0 && key <= WXK_NUMPAD9) 230 | return wxString::Format("NUMPAD%d",key - WXK_NUMPAD0); 231 | if (key >= WXK_F1 && key <= WXK_F24) 232 | return wxString::Format("F%d",key - WXK_F1 + 1); 233 | std::map::const_iterator it = m_wxKeys.end(); 234 | it = std::find_if(m_wxKeys.begin(), m_wxKeys.end(), map_value_finder(key)); 235 | if (it == m_wxKeys.end()) 236 | return wxEmptyString; 237 | return it->first; 238 | } 239 | 240 | #endif 241 | -------------------------------------------------------------------------------- /src/MerryKey.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_KEY_H_ 2 | #define _MERRY_KEY_H_ 3 | 4 | #include "MerryWx.h" 5 | #include 6 | #include 7 | class map_value_finder 8 | { 9 | public: 10 | map_value_finder(const int key):code(key){} 11 | bool operator ()(const std::map::value_type &pair) 12 | { 13 | return pair.second == code; 14 | } 15 | private: 16 | const int code; 17 | }; 18 | 19 | class MerryKey 20 | { 21 | public: 22 | MerryKey(); 23 | ~MerryKey(); 24 | int GetWxKeyCode(const wxString& key) const; 25 | #ifdef __WXMSW__ 26 | int GetWindowsKeyCode(const wxString& key) const; 27 | wxString GetKeyString(int key) const; 28 | #endif 29 | 30 | private: 31 | std::map m_wxKeys; 32 | #ifdef __WXMSW__ 33 | std::map m_windowsKeys; 34 | #endif 35 | }; 36 | 37 | extern MerryKey g_keys; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/MerryListBoxPanel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MerryListBoxPanel.cpp -------------------------------------------------------------------------------- /src/MerryListBoxPanel.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_LIST_BOX_PANEL_H_ 2 | #define _MERRY_LIST_BOX_PANEL_H_ 3 | 4 | #include "MerryCommandManager.h" 5 | 6 | #ifdef __WXMSW__ 7 | #include 8 | typedef wxBufferedPaintDC MerryPaintDC; 9 | #else 10 | typedef wxPaintDC MerryPaintDC; 11 | #endif 12 | 13 | typedef enum _list_fmt_ 14 | { 15 | LIST_CMD_ITEM, 16 | LIST_CMD_ID, 17 | LIST_CMD_DESC, 18 | LIST_CMD_CMD, 19 | LIST_CMD_KEY, 20 | LIST_CMD_NAME, 21 | }; 22 | 23 | class MerryListBoxPanel : public wxPanel 24 | { 25 | public: 26 | MerryListBoxPanel(wxWindow* parent); 27 | ~MerryListBoxPanel(); 28 | 29 | void SetCommandArray(const MerryCommandArray& commands); 30 | void SelectNext(); 31 | void SelectPrev(); 32 | int flags; 33 | int SetSelection(int index,int top = -1); 34 | bool DelSelectedItem(); 35 | const MerryCommand* GetSelectionCommand() const; 36 | 37 | bool IsPopup() const; 38 | void Popup(); 39 | void Dismiss(); 40 | 41 | private: 42 | void OnMouseEvent(wxMouseEvent& e); 43 | void OnPaintEvent(wxPaintEvent& e); 44 | void onContextMenu(wxContextMenuEvent& e); 45 | void onPopMenu(wxCommandEvent& e); 46 | void OnKeyDownEvent(wxKeyEvent& e); 47 | 48 | private: 49 | void DrawBorder(MerryPaintDC& dc) const; 50 | void DrawBackground(MerryPaintDC& dc) const; 51 | void DrawItems(MerryPaintDC& dc); 52 | void DrawItem(MerryPaintDC& dc,size_t item); 53 | int commands_size; 54 | wxString list_fmt; 55 | 56 | void SetHeight(int height); 57 | int CalcHeight() const; 58 | int GetVisibleItemNum() const; 59 | 60 | private: 61 | MerryCommandArray m_commands; 62 | int m_topCommandIndex; 63 | int m_selectionCommandIndex; 64 | int item_height; 65 | int item_width; 66 | int border_width; 67 | 68 | wxRect m_items[MERRY_DEFAULT_LIST_BOX_ITEM_MAX_NUM+1]; 69 | wxBitmap m_listBackground; 70 | 71 | bool m_isPopup; 72 | MerryPaintDC *dc; 73 | wxPanel *panel; 74 | 75 | private: 76 | DECLARE_EVENT_TABLE() 77 | }; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/MerryLua.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MerryLua.cpp -------------------------------------------------------------------------------- /src/MerryLua.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_LUA_H_ 2 | #define _MERRY_LUA_H_ 3 | 4 | extern "C" { 5 | #include 6 | #include 7 | #include 8 | } 9 | 10 | typedef enum{ 11 | LUA_toggleMerry = 0, 12 | LUA_ReConfig, 13 | LUA_EXTERNAL_FUNC, 14 | LUA_CMDRun_FUNC = LUA_EXTERNAL_FUNC, 15 | LUA_CMDCompare_FUNC, 16 | LUA_PluginCommand_FUNC, 17 | LUA_ReadALTRunConfig_FUNC, 18 | LUA_FUNC_MAX, 19 | } lua_func_t; 20 | 21 | #include "MerryWx.h" 22 | 23 | class MerryLua 24 | { 25 | public: 26 | MerryLua(); 27 | ~MerryLua(); 28 | 29 | lua_State* GetLua(); 30 | 31 | public: 32 | // events 33 | static const char *lua_func_str[]; 34 | void OnClose(); 35 | void DoConfig(); 36 | void OnUndefinedCommand(const wxString& commandName, const wxString& commandArg); 37 | bool onCompare(const wxString& commandName,const wxString& commandPrefix); 38 | bool get_func(lua_func_t t); 39 | int get_funcref(lua_func_t t); 40 | #if _DEBUG 41 | void stackDump(); 42 | #endif 43 | 44 | private: 45 | int lua_func[LUA_FUNC_MAX]; 46 | lua_State* L; 47 | }; 48 | 49 | extern MerryLua* g_lua; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/MerryLuaExport.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MerryLuaExport.h -------------------------------------------------------------------------------- /src/MerryMacHelper.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_MAC_HELPER_H_ 2 | #define _MERRY_MAC_HELPER_H_ 3 | 4 | #include "MerryWx.h" 5 | 6 | #ifdef __WXOSX__ 7 | 8 | void MerryDisableFocusRing(WXWidget widget); 9 | void MerryActivateIgnoringOtherApps(); 10 | 11 | #endif 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/MerryMacHelper.mm: -------------------------------------------------------------------------------- 1 | #include "MerryMacHelper.h" 2 | 3 | #ifdef __WXOSX__ 4 | 5 | #import 6 | 7 | void MerryDisableFocusRing(WXWidget widget) 8 | { 9 | [widget setFocusRingType:NSFocusRingTypeNone]; 10 | } 11 | 12 | void MerryActivateIgnoringOtherApps() 13 | { 14 | NSApplication* merry = [NSApplication sharedApplication]; 15 | [merry activateIgnoringOtherApps:YES]; 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/MerryMainPanel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MerryMainPanel.cpp -------------------------------------------------------------------------------- /src/MerryMainPanel.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_MAIN_PANEL_H_ 2 | #define _MERRY_MAIN_PANEL_H_ 3 | 4 | #include "MerryTextCtrl.h" 5 | 6 | class MerryMainPanel : public wxPanel 7 | { 8 | public: 9 | ~MerryMainPanel(); 10 | MerryMainPanel(wxWindow* parent); 11 | void setTitle(const wxString &title); 12 | 13 | MerryTextCtrl* GetTextCtrl(); 14 | 15 | private: 16 | void OnMouseEvent(wxMouseEvent& e); 17 | void OnPaintEvent(wxPaintEvent& e); 18 | void onContextMenu(wxContextMenuEvent& e); 19 | private: 20 | MerryTextCtrl* m_textCtrl; 21 | 22 | wxPoint m_mousePosition; 23 | wxImage m_background; 24 | wxMenu* menu; 25 | wxRect title_cfg; 26 | wxString title_info; 27 | int title_align; 28 | 29 | private: 30 | DECLARE_EVENT_TABLE() 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/MerryTaskBarIcon.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MerryTaskBarIcon.cpp -------------------------------------------------------------------------------- /src/MerryTaskBarIcon.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_TASK_BAR_ICON_H_ 2 | #define _MERRY_TASK_BAR_ICON_H_ 3 | 4 | #include "MerryWx.h" 5 | #include 6 | 7 | class MerryTaskBarIcon : public wxTaskBarIcon 8 | { 9 | public: 10 | ~MerryTaskBarIcon(); 11 | void MerryTaskBarIcon::onPopMenu(wxCommandEvent& e); 12 | private: 13 | void OnLeftButtonDClickEvent(wxTaskBarIconEvent& e); 14 | 15 | private: 16 | virtual wxMenu* CreatePopupMenu(); 17 | 18 | private: 19 | DECLARE_EVENT_TABLE() 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/MerryTextCtrl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MerryTextCtrl.cpp -------------------------------------------------------------------------------- /src/MerryTextCtrl.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_TEXT_CTRL_H_ 2 | #define _MERRY_TEXT_CTRL_H_ 3 | 4 | #include "MerryWx.h" 5 | #include "MerryCommandManager.h" 6 | 7 | class MerryTextCtrl : public wxTextCtrl 8 | { 9 | public: 10 | long EnterArgs; 11 | void ExecuteCmd(); 12 | MerryTextCtrl(wxWindow* parent); 13 | #ifdef __WXMSW__ 14 | void SetEnInputMode(void); 15 | #endif 16 | 17 | private: 18 | void onContextMenu(wxContextMenuEvent& e); 19 | void OnKeyDownEvent(wxKeyEvent& e); 20 | void OnMouseEvent(wxMouseEvent& e); 21 | #ifdef __WXGTK__ 22 | void OnIdleEvent(wxIdleEvent& e); 23 | #else 24 | void OnTextEvent(wxCommandEvent& e); 25 | void OnCharEvent(wxKeyEvent& e); 26 | #endif 27 | 28 | private: 29 | void AutoCompletion(int keyCode); 30 | void SetPluginMode(const MerryCommand* cmd); 31 | private: 32 | int m_lastKeyDownCode; 33 | #ifdef __WXGTK__ 34 | wxString m_lastValue; 35 | bool m_needCompletion; 36 | #endif 37 | 38 | #ifdef __WXMSW__ 39 | HKL hkl; 40 | #endif 41 | 42 | private: 43 | DECLARE_EVENT_TABLE() 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/MerryTimer.cpp: -------------------------------------------------------------------------------- 1 | #include "MerryTimer.h" 2 | #include "MerryTimerManager.h" 3 | #include "MerryLua.h" 4 | #include "MerryInformationDialog.h" 5 | 6 | MerryTimer::MerryTimer(int funcRef) 7 | { 8 | m_callback = funcRef; 9 | } 10 | 11 | MerryTimer::~MerryTimer() 12 | { 13 | if (!g_lua) 14 | return; 15 | 16 | lua_State* L = g_lua->GetLua(); 17 | assert(L); 18 | luaL_unref(L, LUA_REGISTRYINDEX, m_callback); 19 | } 20 | 21 | void MerryTimer::Notify() 22 | { 23 | lua_State* L = g_lua->GetLua(); 24 | assert(L); 25 | 26 | bool isRunning = this->IsRunning(); 27 | 28 | lua_rawgeti(L, LUA_REGISTRYINDEX, m_callback); 29 | assert(lua_isfunction(L, -1)); 30 | if (lua_pcall(L, 0, 0, 0)) 31 | { 32 | new MerryInformationDialog(wxString::Format(wxT("Timer execute failed!")), 33 | wxString(lua_tostring(L, -1), wxConvLocal)); 34 | lua_pop(L, 1); 35 | } 36 | 37 | if (!isRunning) 38 | g_timers->ClearTimer(this); 39 | } 40 | -------------------------------------------------------------------------------- /src/MerryTimer.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_TIMER_H_ 2 | #define _MERRY_TIMER_H_ 3 | 4 | #include "MerryWx.h" 5 | 6 | class MerryTimer : public wxTimer 7 | { 8 | public: 9 | MerryTimer(int funcRef); 10 | ~MerryTimer(); 11 | 12 | private: 13 | virtual void Notify(); 14 | 15 | private: 16 | int m_callback; 17 | }; 18 | 19 | #endif -------------------------------------------------------------------------------- /src/MerryTimerManager.cpp: -------------------------------------------------------------------------------- 1 | #include "MerryTimerManager.h" 2 | #include "MerryTimer.h" 3 | 4 | MerryTimerManager* g_timers = NULL; 5 | 6 | MerryTimerManager::~MerryTimerManager() 7 | { 8 | __DEBUG_BEGIN("") 9 | std::set::iterator it = m_timers.begin(); 10 | for (; it != m_timers.end(); ++it) 11 | delete *it; 12 | __DEBUG_END("") 13 | } 14 | 15 | void* MerryTimerManager::SetTimer(int millisecond, bool oneShot, int funcRef) 16 | { 17 | MerryTimer* timer = new MerryTimer(funcRef); 18 | m_timers.insert(timer); 19 | timer->Start(millisecond, oneShot); 20 | return timer; 21 | } 22 | 23 | void MerryTimerManager::ClearTimer(void* timerHandler) 24 | { 25 | MerryTimer* timer = (MerryTimer*)timerHandler; 26 | if (m_timers.find(timer) == m_timers.end()) 27 | return; 28 | m_timers.erase(timer); 29 | delete timer; 30 | } 31 | -------------------------------------------------------------------------------- /src/MerryTimerManager.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_TIMER_MANAGER_H_ 2 | #define _MERRY_TIMER_MANAGER_H_ 3 | 4 | #include 5 | 6 | class MerryTimer; 7 | class MerryTimerManager 8 | { 9 | public: 10 | ~MerryTimerManager(); 11 | 12 | void* SetTimer(int millisecond, bool oneShot, int funcRef); 13 | void ClearTimer(void* timerHandler); 14 | 15 | private: 16 | std::set m_timers; 17 | }; 18 | 19 | extern MerryTimerManager* g_timers; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/MerryWx.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERRY_WX_H_ 2 | #define _MERRY_WX_H_ 3 | 4 | #include 5 | #include "MerryError.h" 6 | #ifdef __BORLANDC__ 7 | #pragma hdrstop 8 | #endif 9 | #ifndef WX_PRECOMP 10 | #include 11 | #endif 12 | /* 13 | #ifdef __WXMSW__ 14 | #if (_DEBUG || _RELWITHDEBINFO) 15 | #define VLD_FORCE_ENABLE 16 | #include "vld.h" 17 | #endif 18 | #endif 19 | */ 20 | #if _DEBUG_LOG 21 | #include 22 | #define __DEBUG_BEGIN(str) wxLogMessage("%s START %s",__FUNCTION__,str); 23 | #define __DEBUG_END(str) wxLogMessage("%s END %s",__FUNCTION__,str); 24 | #else 25 | #define __DEBUG_BEGIN(str) 26 | #define __DEBUG_END(str) 27 | #endif 28 | #endif -------------------------------------------------------------------------------- /src/MyTextCompleter.cpp: -------------------------------------------------------------------------------- 1 | #include "MyTextCompleter.h" 2 | 3 | MyTextCompleter::MyTextCompleter(wxComboBox *textctrl) 4 | { 5 | m_entry = textctrl; 6 | m_last_pos = 0; 7 | m_entry->Bind(wxEVT_CHAR,&MyTextCompleter::OnCharHook,this); 8 | } 9 | 10 | void MyTextCompleter::OnCharHook(wxKeyEvent& event) 11 | { 12 | if (event.GetKeyCode() == WXK_BACK) 13 | { 14 | if (m_last_pos) 15 | { 16 | m_entry->SetValue(m_last_str); 17 | m_entry->SetInsertionPointEnd(); 18 | m_last_pos = 0; 19 | } 20 | } 21 | event.Skip(); 22 | } 23 | 24 | bool MyTextCompleter::Start(const wxString& prefix) 25 | { 26 | long from, to; 27 | m_entry->GetSelection(&from, &to); 28 | 29 | if ( to == from ) 30 | { 31 | from = m_entry->GetLastPosition(); // Take all if no selection. 32 | } 33 | 34 | m_last_str = m_entry->GetRange(m_last_pos,from); 35 | const wxString find(m_last_str.Upper()); 36 | wxString Match; 37 | int n = m_entry->GetCount(); 38 | m_index = 0; 39 | m_completions.clear(); 40 | 41 | for(int i=0;iGetString(i)); 44 | size_t pos = str.Upper().find(find); 45 | if (pos != wxNOT_FOUND) 46 | { 47 | m_completions.Add(str); 48 | if (pos == 0) 49 | Match = str; 50 | } 51 | } 52 | 53 | if (m_completions.empty()) 54 | { 55 | if (m_last_pos) 56 | { 57 | m_entry->ChangeValue(m_last_str); 58 | m_last_pos = 0; 59 | m_entry->SetInsertionPointEnd(); 60 | } 61 | return false; 62 | } 63 | 64 | size_t find_pos = 0; 65 | if (m_completions.Count() == 1) 66 | { 67 | wxString str(m_completions[0]); 68 | find_pos = str.Upper().find(find); 69 | m_entry->ChangeValue(str); 70 | } 71 | else if (!Match.IsEmpty()) 72 | m_entry->ChangeValue(Match.Truncate(find.size() + 16)); 73 | m_last_pos = find_pos; 74 | m_entry->SetSelection(find_pos + find.size(),-1); 75 | return true; 76 | } 77 | 78 | wxString MyTextCompleter::GetNext() 79 | { 80 | if ( m_index == m_completions.size() ) 81 | return wxString(); 82 | return m_completions[m_index++]; 83 | } -------------------------------------------------------------------------------- /src/MyTextCompleter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/MyTextCompleter.h -------------------------------------------------------------------------------- /src/SkinConfig.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/SkinConfig.cpp -------------------------------------------------------------------------------- /src/SkinConfig.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/SkinConfig.h -------------------------------------------------------------------------------- /src/stServer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/src/stServer.cpp -------------------------------------------------------------------------------- /src/stServer.h: -------------------------------------------------------------------------------- 1 | #ifndef _ALMRUN_STSERVER_H_ 2 | #define _ALMRUN_STSERVER_H_ 3 | #include "MerryWx.h" 4 | #include "wx/ipc.h" 5 | #define IPC_SERVICE "36684" 6 | // the hostname 7 | #define IPC_HOST "localhost" 8 | 9 | // the IPC topic 10 | #define IPC_TOPIC "ALMRun" 11 | #define IPC_CMD_SHOW 1 12 | #define IPC_CMD_ADD_CMD 2 13 | #define IPC_CMD_ADD_DIR 3 14 | 15 | // Connection class, for use by both communicating instances 16 | 17 | class stConnection : public wxConnection 18 | { 19 | public: 20 | stConnection() {cmd_mode = 0;} 21 | ~stConnection() {} 22 | 23 | virtual bool OnExecute(const wxString& topic, 24 | const void *data, 25 | size_t size, 26 | wxIPCFormat format); 27 | virtual bool OnDisconnect(); 28 | private: 29 | int cmd_mode; 30 | wxArrayString cmds; 31 | }; 32 | 33 | // Server class, for listening to connection requests 34 | 35 | class stServer: public wxServer 36 | { 37 | public: 38 | stServer(); 39 | virtual ~stServer(); 40 | 41 | void Disconnect(); 42 | bool IsConnected() { return m_connection != NULL; } 43 | stConnection *GetConnection() { return m_connection; } 44 | virtual wxConnectionBase *OnAcceptConnection(const wxString& topic); 45 | 46 | protected: 47 | stConnection *m_connection; 48 | }; 49 | 50 | 51 | // Client class, to be used by subsequent instances in OnInit 52 | 53 | class stClient: public wxClient 54 | { 55 | public: 56 | stClient(); 57 | ~stClient(); 58 | bool Connect(const wxString& sHost, const wxString& sService, const wxString& sTopic); 59 | void Disconnect(); 60 | wxConnectionBase *OnMakeConnection(); 61 | bool IsConnected() { return m_connection != NULL; }; 62 | stConnection *GetConnection() { return m_connection; }; 63 | 64 | protected: 65 | stConnection *m_connection; 66 | }; 67 | 68 | 69 | 70 | #endif -------------------------------------------------------------------------------- /third_party/Everything-SDK/dll/Everything32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/third_party/Everything-SDK/dll/Everything32.dll -------------------------------------------------------------------------------- /third_party/Everything-SDK/dll/Everything64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/third_party/Everything-SDK/dll/Everything64.dll -------------------------------------------------------------------------------- /third_party/Everything-SDK/example/CSharp/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WindowsApplication1 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.button1 = new System.Windows.Forms.Button(); 32 | this.listBox1 = new System.Windows.Forms.ListBox(); 33 | this.textBox1 = new System.Windows.Forms.TextBox(); 34 | this.SuspendLayout(); 35 | // 36 | // button1 37 | // 38 | this.button1.Location = new System.Drawing.Point(250, 12); 39 | this.button1.Name = "button1"; 40 | this.button1.Size = new System.Drawing.Size(84, 20); 41 | this.button1.TabIndex = 0; 42 | this.button1.Text = "Search"; 43 | this.button1.UseVisualStyleBackColor = true; 44 | this.button1.Click += new System.EventHandler(this.button1_Click); 45 | // 46 | // listBox1 47 | // 48 | this.listBox1.FormattingEnabled = true; 49 | this.listBox1.Location = new System.Drawing.Point(12, 38); 50 | this.listBox1.Name = "listBox1"; 51 | this.listBox1.Size = new System.Drawing.Size(322, 199); 52 | this.listBox1.TabIndex = 2; 53 | // 54 | // textBox1 55 | // 56 | this.textBox1.Location = new System.Drawing.Point(12, 12); 57 | this.textBox1.Name = "textBox1"; 58 | this.textBox1.Size = new System.Drawing.Size(232, 20); 59 | this.textBox1.TabIndex = 3; 60 | // 61 | // Form1 62 | // 63 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 64 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 65 | this.ClientSize = new System.Drawing.Size(349, 251); 66 | this.Controls.Add(this.textBox1); 67 | this.Controls.Add(this.listBox1); 68 | this.Controls.Add(this.button1); 69 | this.Name = "Form1"; 70 | this.Text = "Form1"; 71 | this.ResumeLayout(false); 72 | this.PerformLayout(); 73 | 74 | } 75 | 76 | #endregion 77 | 78 | private System.Windows.Forms.Button button1; 79 | private System.Windows.Forms.ListBox listBox1; 80 | private System.Windows.Forms.TextBox textBox1; 81 | } 82 | } 83 | 84 | -------------------------------------------------------------------------------- /third_party/Everything-SDK/example/CSharp/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | using System.Runtime.InteropServices; 9 | 10 | namespace WindowsApplication1 11 | { 12 | public partial class Form1 : Form 13 | { 14 | const int EVERYTHING_OK = 0; 15 | const int EVERYTHING_ERROR_MEMORY = 1; 16 | const int EVERYTHING_ERROR_IPC = 2; 17 | const int EVERYTHING_ERROR_REGISTERCLASSEX = 3; 18 | const int EVERYTHING_ERROR_CREATEWINDOW = 4; 19 | const int EVERYTHING_ERROR_CREATETHREAD = 5; 20 | const int EVERYTHING_ERROR_INVALIDINDEX = 6; 21 | const int EVERYTHING_ERROR_INVALIDCALL = 7; 22 | 23 | [DllImport("Everything32.dll", CharSet = CharSet.Unicode)] 24 | public static extern int Everything_SetSearchW(string lpSearchString); 25 | [DllImport("Everything32.dll")] 26 | public static extern void Everything_SetMatchPath(bool bEnable); 27 | [DllImport("Everything32.dll")] 28 | public static extern void Everything_SetMatchCase(bool bEnable); 29 | [DllImport("Everything32.dll")] 30 | public static extern void Everything_SetMatchWholeWord(bool bEnable); 31 | [DllImport("Everything32.dll")] 32 | public static extern void Everything_SetRegex(bool bEnable); 33 | [DllImport("Everything32.dll")] 34 | public static extern void Everything_SetMax(int dwMax); 35 | [DllImport("Everything32.dll")] 36 | public static extern void Everything_SetOffset(int dwOffset); 37 | 38 | [DllImport("Everything32.dll")] 39 | public static extern bool Everything_GetMatchPath(); 40 | [DllImport("Everything32.dll")] 41 | public static extern bool Everything_GetMatchCase(); 42 | [DllImport("Everything32.dll")] 43 | public static extern bool Everything_GetMatchWholeWord(); 44 | [DllImport("Everything32.dll")] 45 | public static extern bool Everything_GetRegex(); 46 | [DllImport("Everything32.dll")] 47 | public static extern UInt32 Everything_GetMax(); 48 | [DllImport("Everything32.dll")] 49 | public static extern UInt32 Everything_GetOffset(); 50 | [DllImport("Everything32.dll")] 51 | public static extern string Everything_GetSearchW(); 52 | [DllImport("Everything32.dll")] 53 | public static extern int Everything_GetLastError(); 54 | 55 | [DllImport("Everything32.dll")] 56 | public static extern bool Everything_QueryW(bool bWait); 57 | 58 | [DllImport("Everything32.dll")] 59 | public static extern void Everything_SortResultsByPath(); 60 | 61 | [DllImport("Everything32.dll")] 62 | public static extern int Everything_GetNumFileResults(); 63 | [DllImport("Everything32.dll")] 64 | public static extern int Everything_GetNumFolderResults(); 65 | [DllImport("Everything32.dll")] 66 | public static extern int Everything_GetNumResults(); 67 | [DllImport("Everything32.dll")] 68 | public static extern int Everything_GetTotFileResults(); 69 | [DllImport("Everything32.dll")] 70 | public static extern int Everything_GetTotFolderResults(); 71 | [DllImport("Everything32.dll")] 72 | public static extern int Everything_GetTotResults(); 73 | [DllImport("Everything32.dll")] 74 | public static extern bool Everything_IsVolumeResult(int nIndex); 75 | [DllImport("Everything32.dll")] 76 | public static extern bool Everything_IsFolderResult(int nIndex); 77 | [DllImport("Everything32.dll")] 78 | public static extern bool Everything_IsFileResult(int nIndex); 79 | [DllImport("Everything32.dll", CharSet = CharSet.Unicode)] 80 | public static extern void Everything_GetResultFullPathNameW(int nIndex, StringBuilder lpString, int nMaxCount); 81 | [DllImport("Everything32.dll")] 82 | public static extern void Everything_Reset(); 83 | 84 | public Form1() 85 | { 86 | InitializeComponent(); 87 | } 88 | 89 | private void button1_Click(object sender, EventArgs e) 90 | { 91 | int i; 92 | const int bufsize = 260; 93 | StringBuilder buf = new StringBuilder(bufsize); 94 | 95 | // set the search 96 | Everything_SetSearchW(textBox1.Text); 97 | 98 | // use our own custom scrollbar... 99 | // Everything_SetMax(listBox1.ClientRectangle.Height / listBox1.ItemHeight); 100 | // Everything_SetOffset(VerticalScrollBarPosition...); 101 | 102 | // execute the query 103 | Everything_QueryW(true); 104 | 105 | // sort by path 106 | // Everything_SortResultsByPath(); 107 | 108 | // clear the old list of results 109 | listBox1.Items.Clear(); 110 | 111 | // set the window title 112 | Text = textBox1.Text + " - " + Everything_GetNumResults() + " Results"; 113 | 114 | // loop through the results, adding each result to the listbox. 115 | for (i = 0; i < Everything_GetNumResults(); i++) 116 | { 117 | // get the result's full path and file name. 118 | Everything_GetResultFullPathNameW(i, buf, bufsize); 119 | 120 | // add it to the list box 121 | listBox1.Items.Insert(i,buf); 122 | } 123 | } 124 | } 125 | } -------------------------------------------------------------------------------- /third_party/Everything-SDK/example/CSharp/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /third_party/Everything-SDK/example/CSharp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | 5 | namespace WindowsApplication1 6 | { 7 | 8 | static class Program 9 | { 10 | 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | 20 | Application.Run(new Form1()); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /third_party/Everything-SDK/example/CSharp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("WindowsApplication1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WindowsApplication1")] 13 | [assembly: AssemblyCopyright("Copyright © 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("00417877-82e2-4176-8724-bbe7870ee348")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /third_party/Everything-SDK/example/CSharp/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:2.0.50727.42 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsApplication1.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsApplication1.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /third_party/Everything-SDK/example/CSharp/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /third_party/Everything-SDK/example/CSharp/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:2.0.50727.42 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsApplication1.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /third_party/Everything-SDK/example/CSharp/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /third_party/Everything-SDK/example/CSharp/WindowsApplication1.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Debug 4 | AnyCPU 5 | 8.0.50727 6 | 2.0 7 | {FAB4597B-1FE6-4D40-8CD9-49BA8664C3B1} 8 | WinExe 9 | Properties 10 | WindowsApplication1 11 | WindowsApplication1 12 | 13 | 14 | true 15 | full 16 | false 17 | bin\Debug\ 18 | DEBUG;TRACE 19 | prompt 20 | 4 21 | 22 | 23 | pdbonly 24 | true 25 | bin\Release\ 26 | TRACE 27 | prompt 28 | 4 29 | 30 | 31 | true 32 | bin\x86\Debug\ 33 | DEBUG;TRACE 34 | full 35 | x86 36 | prompt 37 | 38 | 39 | bin\x86\Release\ 40 | TRACE 41 | true 42 | pdbonly 43 | x86 44 | prompt 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | Form 57 | 58 | 59 | Form1.cs 60 | 61 | 62 | 63 | 64 | Designer 65 | Form1.cs 66 | 67 | 68 | ResXFileCodeGenerator 69 | Resources.Designer.cs 70 | Designer 71 | 72 | 73 | True 74 | Resources.resx 75 | 76 | 77 | SettingsSingleFileGenerator 78 | Settings.Designer.cs 79 | 80 | 81 | True 82 | Settings.settings 83 | True 84 | 85 | 86 | 87 | 94 | -------------------------------------------------------------------------------- /third_party/Everything-SDK/example/CSharp/WindowsApplication1.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/third_party/Everything-SDK/example/CSharp/WindowsApplication1.suo -------------------------------------------------------------------------------- /third_party/Everything-SDK/example/dll.test.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/third_party/Everything-SDK/example/dll.test.c -------------------------------------------------------------------------------- /third_party/Everything-SDK/example/dll.test.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/third_party/Everything-SDK/example/dll.test.cpp -------------------------------------------------------------------------------- /third_party/Everything-SDK/include/Everything.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _EVERYTHING_DLL_ 3 | #define _EVERYTHING_DLL_ 4 | 5 | #ifndef _INC_WINDOWS 6 | #include 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | #define EVERYTHING_OK 0 14 | #define EVERYTHING_ERROR_MEMORY 1 15 | #define EVERYTHING_ERROR_IPC 2 16 | #define EVERYTHING_ERROR_REGISTERCLASSEX 3 17 | #define EVERYTHING_ERROR_CREATEWINDOW 4 18 | #define EVERYTHING_ERROR_CREATETHREAD 5 19 | #define EVERYTHING_ERROR_INVALIDINDEX 6 20 | #define EVERYTHING_ERROR_INVALIDCALL 7 21 | 22 | #ifndef EVERYTHINGAPI 23 | #define EVERYTHINGAPI __stdcall 24 | #endif 25 | 26 | #ifndef EVERYTHINGUSERAPI 27 | #define EVERYTHINGUSERAPI __declspec(dllexport) 28 | #endif 29 | 30 | // write search state 31 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetSearchW(LPCWSTR lpString); 32 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetSearchA(LPCSTR lpString); 33 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetMatchPath(BOOL bEnable); 34 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetMatchCase(BOOL bEnable); 35 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetMatchWholeWord(BOOL bEnable); 36 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetRegex(BOOL bEnable); 37 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetMax(DWORD dwMax); 38 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetOffset(DWORD dwOffset); 39 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetReplyWindow(HWND hWnd); 40 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SetReplyID(DWORD nId); 41 | 42 | // read search state 43 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetMatchPath(void); 44 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetMatchCase(void); 45 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetMatchWholeWord(void); 46 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_GetRegex(void); 47 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetMax(void); 48 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetOffset(void); 49 | EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetSearchA(void); 50 | EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetSearchW(void); 51 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetLastError(void); 52 | EVERYTHINGUSERAPI HWND EVERYTHINGAPI Everything_GetReplyWindow(void); 53 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetReplyID(void); 54 | 55 | // execute query 56 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_QueryA(BOOL bWait); 57 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_QueryW(BOOL bWait); 58 | 59 | // query reply 60 | BOOL EVERYTHINGAPI Everything_IsQueryReply(UINT message,WPARAM wParam,LPARAM lParam,DWORD nId); 61 | 62 | // write result state 63 | EVERYTHINGUSERAPI void EVERYTHINGAPI Everything_SortResultsByPath(void); 64 | 65 | // read result state 66 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetNumFileResults(void); 67 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetNumFolderResults(void); 68 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetNumResults(void); 69 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetTotFileResults(void); 70 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetTotFolderResults(void); 71 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetTotResults(void); 72 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsVolumeResult(DWORD nIndex); 73 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsFolderResult(DWORD nIndex); 74 | EVERYTHINGUSERAPI BOOL EVERYTHINGAPI Everything_IsFileResult(DWORD nIndex); 75 | EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultFileNameW(DWORD nIndex); 76 | EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultFileNameA(DWORD nIndex); 77 | EVERYTHINGUSERAPI LPCWSTR EVERYTHINGAPI Everything_GetResultPathW(DWORD nIndex); 78 | EVERYTHINGUSERAPI LPCSTR EVERYTHINGAPI Everything_GetResultPathA(DWORD nIndex); 79 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultFullPathNameA(DWORD nIndex,LPSTR buf,DWORD bufsize); 80 | EVERYTHINGUSERAPI DWORD EVERYTHINGAPI Everything_GetResultFullPathNameW(DWORD nIndex,LPWSTR wbuf,DWORD wbuf_size_in_wchars); 81 | 82 | #ifdef UNICODE 83 | #define Everything_SetSearch Everything_SetSearchW 84 | #define Everything_GetSearch Everything_GetSearchW 85 | #define Everything_Query Everything_QueryW 86 | #define Everything_GetResultFileName Everything_GetResultFileNameW 87 | #define Everything_GetResultPath Everything_GetResultPathW 88 | #define Everything_GetResultFullPathName Everything_GetResultFullPathNameW 89 | #else 90 | #define Everything_SetSearch Everything_SetSearchA 91 | #define Everything_GetSearch Everything_GetSearchA 92 | #define Everything_Query Everything_QueryA 93 | #define Everything_GetResultFileName Everything_GetResultFileNameA 94 | #define Everything_GetResultPath Everything_GetResultPathA 95 | #define Everything_GetResultFullPathName Everything_GetResultFullPathNameA 96 | #endif 97 | 98 | #ifdef __cplusplus 99 | } 100 | #endif 101 | 102 | #endif 103 | 104 | -------------------------------------------------------------------------------- /third_party/Everything-SDK/lib/Everything.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/third_party/Everything-SDK/lib/Everything.lib -------------------------------------------------------------------------------- /third_party/Everything-SDK/src/Everything.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/third_party/Everything-SDK/src/Everything.c -------------------------------------------------------------------------------- /third_party/Everything-SDK/src/Everything.def: -------------------------------------------------------------------------------- 1 | LIBRARY Everything 2 | 3 | EXPORTS 4 | 5 | Everything_GetLastError 6 | 7 | Everything_SetSearchA 8 | Everything_SetSearchW 9 | Everything_SetMatchPath 10 | Everything_SetMatchCase 11 | Everything_SetMatchWholeWord 12 | Everything_SetRegex 13 | Everything_SetMax 14 | Everything_SetOffset 15 | 16 | Everything_GetSearchA 17 | Everything_GetSearchW 18 | Everything_GetMatchPath 19 | Everything_GetMatchCase 20 | Everything_GetMatchWholeWord 21 | Everything_GetRegex 22 | Everything_GetMax 23 | Everything_GetOffset 24 | 25 | Everything_QueryA 26 | Everything_QueryW 27 | 28 | Everything_IsQueryReply 29 | 30 | Everything_SortResultsByPath 31 | 32 | Everything_GetNumFileResults 33 | Everything_GetNumFolderResults 34 | Everything_GetNumResults 35 | Everything_GetTotFileResults 36 | Everything_GetTotFolderResults 37 | Everything_GetTotResults 38 | 39 | Everything_IsVolumeResult 40 | Everything_IsFolderResult 41 | Everything_IsFileResult 42 | 43 | Everything_GetResultFileNameA 44 | Everything_GetResultFileNameW 45 | Everything_GetResultPathA 46 | Everything_GetResultPathW 47 | Everything_GetResultFullPathNameA 48 | Everything_GetResultFullPathNameW 49 | 50 | Everything_Reset 51 | -------------------------------------------------------------------------------- /third_party/lua/linux64/include/lauxlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Auxiliary functions for building Lua libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lauxlib_h 9 | #define lauxlib_h 10 | 11 | 12 | #include 13 | #include 14 | 15 | #include "lua.h" 16 | 17 | 18 | #define luaL_getn(L,i) ((int)lua_objlen(L, i)) 19 | #define luaL_setn(L,i,j) ((void)0) /* no op! */ 20 | 21 | /* extra error code for `luaL_load' */ 22 | #define LUA_ERRFILE (LUA_ERRERR+1) 23 | 24 | typedef struct luaL_Reg { 25 | const char *name; 26 | lua_CFunction func; 27 | } luaL_Reg; 28 | 29 | LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname, 30 | const luaL_Reg *l, int nup); 31 | LUALIB_API void (luaL_register) (lua_State *L, const char *libname, 32 | const luaL_Reg *l); 33 | LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); 34 | LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); 35 | LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname); 36 | LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); 37 | LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, 38 | size_t *l); 39 | LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg, 40 | const char *def, size_t *l); 41 | LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg); 42 | LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def); 43 | 44 | LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg); 45 | LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg, 46 | lua_Integer def); 47 | 48 | LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg); 49 | LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t); 50 | LUALIB_API void (luaL_checkany) (lua_State *L, int narg); 51 | 52 | LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname); 53 | LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname); 54 | 55 | LUALIB_API void (luaL_where) (lua_State *L, int lvl); 56 | LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); 57 | 58 | LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, 59 | const char *const lst[]); 60 | 61 | LUALIB_API int (luaL_ref) (lua_State *L, int t); 62 | LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); 63 | 64 | LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename); 65 | LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, 66 | const char *name); 67 | LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); 68 | 69 | LUALIB_API lua_State *(luaL_newstate) (void); 70 | 71 | 72 | LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, 73 | const char *r); 74 | 75 | LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx, 76 | const char *fname, int szhint); 77 | 78 | /* From Lua 5.2. */ 79 | LUALIB_API int luaL_fileresult(lua_State *L, int stat, const char *fname); 80 | LUALIB_API int luaL_execresult(lua_State *L, int stat); 81 | LUALIB_API int (luaL_loadfilex) (lua_State *L, const char *filename, 82 | const char *mode); 83 | LUALIB_API int (luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz, 84 | const char *name, const char *mode); 85 | LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, const char *msg, 86 | int level); 87 | 88 | 89 | /* 90 | ** =============================================================== 91 | ** some useful macros 92 | ** =============================================================== 93 | */ 94 | 95 | #define luaL_argcheck(L, cond,numarg,extramsg) \ 96 | ((void)((cond) || luaL_argerror(L, (numarg), (extramsg)))) 97 | #define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) 98 | #define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) 99 | #define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) 100 | #define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) 101 | #define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) 102 | #define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) 103 | 104 | #define luaL_typename(L,i) lua_typename(L, lua_type(L,(i))) 105 | 106 | #define luaL_dofile(L, fn) \ 107 | (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0)) 108 | 109 | #define luaL_dostring(L, s) \ 110 | (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0)) 111 | 112 | #define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n))) 113 | 114 | #define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) 115 | 116 | /* 117 | ** {====================================================== 118 | ** Generic Buffer manipulation 119 | ** ======================================================= 120 | */ 121 | 122 | 123 | 124 | typedef struct luaL_Buffer { 125 | char *p; /* current position in buffer */ 126 | int lvl; /* number of strings in the stack (level) */ 127 | lua_State *L; 128 | char buffer[LUAL_BUFFERSIZE]; 129 | } luaL_Buffer; 130 | 131 | #define luaL_addchar(B,c) \ 132 | ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \ 133 | (*(B)->p++ = (char)(c))) 134 | 135 | /* compatibility only */ 136 | #define luaL_putchar(B,c) luaL_addchar(B,c) 137 | 138 | #define luaL_addsize(B,n) ((B)->p += (n)) 139 | 140 | LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B); 141 | LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B); 142 | LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l); 143 | LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s); 144 | LUALIB_API void (luaL_addvalue) (luaL_Buffer *B); 145 | LUALIB_API void (luaL_pushresult) (luaL_Buffer *B); 146 | 147 | 148 | /* }====================================================== */ 149 | 150 | 151 | /* compatibility with ref system */ 152 | 153 | /* pre-defined references */ 154 | #define LUA_NOREF (-2) 155 | #define LUA_REFNIL (-1) 156 | 157 | #define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ 158 | (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) 159 | 160 | #define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) 161 | 162 | #define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref)) 163 | 164 | 165 | #define luaL_reg luaL_Reg 166 | 167 | #endif 168 | -------------------------------------------------------------------------------- /third_party/lua/linux64/include/lua.hpp: -------------------------------------------------------------------------------- 1 | // C++ wrapper for LuaJIT header files. 2 | 3 | extern "C" { 4 | #include "lua.h" 5 | #include "lauxlib.h" 6 | #include "lualib.h" 7 | #include "luajit.h" 8 | } 9 | 10 | -------------------------------------------------------------------------------- /third_party/lua/linux64/include/luaconf.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Configuration header. 3 | ** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef luaconf_h 7 | #define luaconf_h 8 | 9 | #include 10 | #include 11 | 12 | /* Default path for loading Lua and C modules with require(). */ 13 | #if defined(_WIN32) 14 | /* 15 | ** In Windows, any exclamation mark ('!') in the path is replaced by the 16 | ** path of the directory of the executable file of the current process. 17 | */ 18 | #define LUA_LDIR "!\\lua\\" 19 | #define LUA_CDIR "!\\" 20 | #define LUA_PATH_DEFAULT \ 21 | ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" 22 | #define LUA_CPATH_DEFAULT \ 23 | ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" 24 | #else 25 | /* 26 | ** Note to distribution maintainers: do NOT patch the following line! 27 | ** Please read ../doc/install.html#distro and pass PREFIX=/usr instead. 28 | */ 29 | #define LUA_ROOT "/usr/local/" 30 | #define LUA_LDIR LUA_ROOT "share/lua/5.1/" 31 | #define LUA_CDIR LUA_ROOT "lib/lua/5.1/" 32 | #ifdef LUA_XROOT 33 | #define LUA_JDIR LUA_XROOT "share/luajit-2.0.2/" 34 | #define LUA_XPATH \ 35 | ";" LUA_XROOT "share/lua/5.1/?.lua;" LUA_XROOT "share/lua/5.1/?/init.lua" 36 | #define LUA_XCPATH LUA_XROOT "lib/lua/5.1/?.so;" 37 | #else 38 | #define LUA_JDIR LUA_ROOT "share/luajit-2.0.2/" 39 | #define LUA_XPATH 40 | #define LUA_XCPATH 41 | #endif 42 | #define LUA_PATH_DEFAULT \ 43 | "./?.lua;" LUA_JDIR"?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua" LUA_XPATH 44 | #define LUA_CPATH_DEFAULT \ 45 | "./?.so;" LUA_CDIR"?.so;" LUA_XCPATH LUA_CDIR"loadall.so" 46 | #endif 47 | 48 | /* Environment variable names for path overrides and initialization code. */ 49 | #define LUA_PATH "LUA_PATH" 50 | #define LUA_CPATH "LUA_CPATH" 51 | #define LUA_INIT "LUA_INIT" 52 | 53 | /* Special file system characters. */ 54 | #if defined(_WIN32) 55 | #define LUA_DIRSEP "\\" 56 | #else 57 | #define LUA_DIRSEP "/" 58 | #endif 59 | #define LUA_PATHSEP ";" 60 | #define LUA_PATH_MARK "?" 61 | #define LUA_EXECDIR "!" 62 | #define LUA_IGMARK "-" 63 | #define LUA_PATH_CONFIG \ 64 | LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" \ 65 | LUA_EXECDIR "\n" LUA_IGMARK 66 | 67 | /* Quoting in error messages. */ 68 | #define LUA_QL(x) "'" x "'" 69 | #define LUA_QS LUA_QL("%s") 70 | 71 | /* Various tunables. */ 72 | #define LUAI_MAXSTACK 65500 /* Max. # of stack slots for a thread (<64K). */ 73 | #define LUAI_MAXCSTACK 8000 /* Max. # of stack slots for a C func (<10K). */ 74 | #define LUAI_GCPAUSE 200 /* Pause GC until memory is at 200%. */ 75 | #define LUAI_GCMUL 200 /* Run GC at 200% of allocation speed. */ 76 | #define LUA_MAXCAPTURES 32 /* Max. pattern captures. */ 77 | 78 | /* Compatibility with older library function names. */ 79 | #define LUA_COMPAT_MOD /* OLD: math.mod, NEW: math.fmod */ 80 | #define LUA_COMPAT_GFIND /* OLD: string.gfind, NEW: string.gmatch */ 81 | 82 | /* Configuration for the frontend (the luajit executable). */ 83 | #if defined(luajit_c) 84 | #define LUA_PROGNAME "luajit" /* Fallback frontend name. */ 85 | #define LUA_PROMPT "> " /* Interactive prompt. */ 86 | #define LUA_PROMPT2 ">> " /* Continuation prompt. */ 87 | #define LUA_MAXINPUT 512 /* Max. input line length. */ 88 | #endif 89 | 90 | /* Note: changing the following defines breaks the Lua 5.1 ABI. */ 91 | #define LUA_INTEGER ptrdiff_t 92 | #define LUA_IDSIZE 60 /* Size of lua_Debug.short_src. */ 93 | /* 94 | ** Size of lauxlib and io.* on-stack buffers. Weird workaround to avoid using 95 | ** unreasonable amounts of stack space, but still retain ABI compatibility. 96 | ** Blame Lua for depending on BUFSIZ in the ABI, blame **** for wrecking it. 97 | */ 98 | #define LUAL_BUFFERSIZE (BUFSIZ > 16384 ? 8192 : BUFSIZ) 99 | 100 | /* The following defines are here only for compatibility with luaconf.h 101 | ** from the standard Lua distribution. They must not be changed for LuaJIT. 102 | */ 103 | #define LUA_NUMBER_DOUBLE 104 | #define LUA_NUMBER double 105 | #define LUAI_UACNUMBER double 106 | #define LUA_NUMBER_SCAN "%lf" 107 | #define LUA_NUMBER_FMT "%.14g" 108 | #define lua_number2str(s, n) sprintf((s), LUA_NUMBER_FMT, (n)) 109 | #define LUAI_MAXNUMBER2STR 32 110 | #define LUA_INTFRMLEN "l" 111 | #define LUA_INTFRM_T long 112 | 113 | /* Linkage of public API functions. */ 114 | #if defined(LUA_BUILD_AS_DLL) 115 | #if defined(LUA_CORE) || defined(LUA_LIB) 116 | #define LUA_API __declspec(dllexport) 117 | #else 118 | #define LUA_API __declspec(dllimport) 119 | #endif 120 | #else 121 | #define LUA_API extern 122 | #endif 123 | 124 | #define LUALIB_API LUA_API 125 | 126 | /* Support for internal assertions. */ 127 | #if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK) 128 | #include 129 | #endif 130 | #ifdef LUA_USE_ASSERT 131 | #define lua_assert(x) assert(x) 132 | #endif 133 | #ifdef LUA_USE_APICHECK 134 | #define luai_apicheck(L, o) { (void)L; assert(o); } 135 | #else 136 | #define luai_apicheck(L, o) { (void)L; } 137 | #endif 138 | 139 | #endif 140 | -------------------------------------------------------------------------------- /third_party/lua/linux64/include/luajit.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** LuaJIT -- a Just-In-Time Compiler for Lua. http://luajit.org/ 3 | ** 4 | ** Copyright (C) 2005-2013 Mike Pall. All rights reserved. 5 | ** 6 | ** Permission is hereby granted, free of charge, to any person obtaining 7 | ** a copy of this software and associated documentation files (the 8 | ** "Software"), to deal in the Software without restriction, including 9 | ** without limitation the rights to use, copy, modify, merge, publish, 10 | ** distribute, sublicense, and/or sell copies of the Software, and to 11 | ** permit persons to whom the Software is furnished to do so, subject to 12 | ** the following conditions: 13 | ** 14 | ** The above copyright notice and this permission notice shall be 15 | ** included in all copies or substantial portions of the Software. 16 | ** 17 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | ** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | ** 25 | ** [ MIT license: http://www.opensource.org/licenses/mit-license.php ] 26 | */ 27 | 28 | #ifndef _LUAJIT_H 29 | #define _LUAJIT_H 30 | 31 | #include "lua.h" 32 | 33 | #define LUAJIT_VERSION "LuaJIT 2.0.2" 34 | #define LUAJIT_VERSION_NUM 20002 /* Version 2.0.2 = 02.00.02. */ 35 | #define LUAJIT_VERSION_SYM luaJIT_version_2_0_2 36 | #define LUAJIT_COPYRIGHT "Copyright (C) 2005-2013 Mike Pall" 37 | #define LUAJIT_URL "http://luajit.org/" 38 | 39 | /* Modes for luaJIT_setmode. */ 40 | #define LUAJIT_MODE_MASK 0x00ff 41 | 42 | enum { 43 | LUAJIT_MODE_ENGINE, /* Set mode for whole JIT engine. */ 44 | LUAJIT_MODE_DEBUG, /* Set debug mode (idx = level). */ 45 | 46 | LUAJIT_MODE_FUNC, /* Change mode for a function. */ 47 | LUAJIT_MODE_ALLFUNC, /* Recurse into subroutine protos. */ 48 | LUAJIT_MODE_ALLSUBFUNC, /* Change only the subroutines. */ 49 | 50 | LUAJIT_MODE_TRACE, /* Flush a compiled trace. */ 51 | 52 | LUAJIT_MODE_WRAPCFUNC = 0x10, /* Set wrapper mode for C function calls. */ 53 | 54 | LUAJIT_MODE_MAX 55 | }; 56 | 57 | /* Flags or'ed in to the mode. */ 58 | #define LUAJIT_MODE_OFF 0x0000 /* Turn feature off. */ 59 | #define LUAJIT_MODE_ON 0x0100 /* Turn feature on. */ 60 | #define LUAJIT_MODE_FLUSH 0x0200 /* Flush JIT-compiled code. */ 61 | 62 | /* LuaJIT public C API. */ 63 | 64 | /* Control the JIT engine. */ 65 | LUA_API int luaJIT_setmode(lua_State *L, int idx, int mode); 66 | 67 | /* Enforce (dynamic) linker error for version mismatches. Call from main. */ 68 | LUA_API void LUAJIT_VERSION_SYM(void); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /third_party/lua/linux64/include/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Standard library header. 3 | ** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LUALIB_H 7 | #define _LUALIB_H 8 | 9 | #include "lua.h" 10 | 11 | #define LUA_FILEHANDLE "FILE*" 12 | 13 | #define LUA_COLIBNAME "coroutine" 14 | #define LUA_MATHLIBNAME "math" 15 | #define LUA_STRLIBNAME "string" 16 | #define LUA_TABLIBNAME "table" 17 | #define LUA_IOLIBNAME "io" 18 | #define LUA_OSLIBNAME "os" 19 | #define LUA_LOADLIBNAME "package" 20 | #define LUA_DBLIBNAME "debug" 21 | #define LUA_BITLIBNAME "bit" 22 | #define LUA_JITLIBNAME "jit" 23 | #define LUA_FFILIBNAME "ffi" 24 | 25 | LUALIB_API int luaopen_base(lua_State *L); 26 | LUALIB_API int luaopen_math(lua_State *L); 27 | LUALIB_API int luaopen_string(lua_State *L); 28 | LUALIB_API int luaopen_table(lua_State *L); 29 | LUALIB_API int luaopen_io(lua_State *L); 30 | LUALIB_API int luaopen_os(lua_State *L); 31 | LUALIB_API int luaopen_package(lua_State *L); 32 | LUALIB_API int luaopen_debug(lua_State *L); 33 | LUALIB_API int luaopen_bit(lua_State *L); 34 | LUALIB_API int luaopen_jit(lua_State *L); 35 | LUALIB_API int luaopen_ffi(lua_State *L); 36 | 37 | LUALIB_API void luaL_openlibs(lua_State *L); 38 | 39 | #ifndef lua_assert 40 | #define lua_assert(x) ((void)0) 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /third_party/lua/macos/include/lauxlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Auxiliary functions for building Lua libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lauxlib_h 9 | #define lauxlib_h 10 | 11 | 12 | #include 13 | #include 14 | 15 | #include "lua.h" 16 | 17 | 18 | #define luaL_getn(L,i) ((int)lua_objlen(L, i)) 19 | #define luaL_setn(L,i,j) ((void)0) /* no op! */ 20 | 21 | /* extra error code for `luaL_load' */ 22 | #define LUA_ERRFILE (LUA_ERRERR+1) 23 | 24 | typedef struct luaL_Reg { 25 | const char *name; 26 | lua_CFunction func; 27 | } luaL_Reg; 28 | 29 | LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname, 30 | const luaL_Reg *l, int nup); 31 | LUALIB_API void (luaL_register) (lua_State *L, const char *libname, 32 | const luaL_Reg *l); 33 | LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); 34 | LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); 35 | LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname); 36 | LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); 37 | LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, 38 | size_t *l); 39 | LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg, 40 | const char *def, size_t *l); 41 | LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg); 42 | LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def); 43 | 44 | LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg); 45 | LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg, 46 | lua_Integer def); 47 | 48 | LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg); 49 | LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t); 50 | LUALIB_API void (luaL_checkany) (lua_State *L, int narg); 51 | 52 | LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname); 53 | LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname); 54 | 55 | LUALIB_API void (luaL_where) (lua_State *L, int lvl); 56 | LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); 57 | 58 | LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, 59 | const char *const lst[]); 60 | 61 | LUALIB_API int (luaL_ref) (lua_State *L, int t); 62 | LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); 63 | 64 | LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename); 65 | LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, 66 | const char *name); 67 | LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); 68 | 69 | LUALIB_API lua_State *(luaL_newstate) (void); 70 | 71 | 72 | LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, 73 | const char *r); 74 | 75 | LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx, 76 | const char *fname, int szhint); 77 | 78 | /* From Lua 5.2. */ 79 | LUALIB_API int luaL_fileresult(lua_State *L, int stat, const char *fname); 80 | LUALIB_API int luaL_execresult(lua_State *L, int stat); 81 | LUALIB_API int (luaL_loadfilex) (lua_State *L, const char *filename, 82 | const char *mode); 83 | LUALIB_API int (luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz, 84 | const char *name, const char *mode); 85 | LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, const char *msg, 86 | int level); 87 | 88 | 89 | /* 90 | ** =============================================================== 91 | ** some useful macros 92 | ** =============================================================== 93 | */ 94 | 95 | #define luaL_argcheck(L, cond,numarg,extramsg) \ 96 | ((void)((cond) || luaL_argerror(L, (numarg), (extramsg)))) 97 | #define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) 98 | #define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) 99 | #define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) 100 | #define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) 101 | #define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) 102 | #define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) 103 | 104 | #define luaL_typename(L,i) lua_typename(L, lua_type(L,(i))) 105 | 106 | #define luaL_dofile(L, fn) \ 107 | (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0)) 108 | 109 | #define luaL_dostring(L, s) \ 110 | (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0)) 111 | 112 | #define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n))) 113 | 114 | #define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) 115 | 116 | /* 117 | ** {====================================================== 118 | ** Generic Buffer manipulation 119 | ** ======================================================= 120 | */ 121 | 122 | 123 | 124 | typedef struct luaL_Buffer { 125 | char *p; /* current position in buffer */ 126 | int lvl; /* number of strings in the stack (level) */ 127 | lua_State *L; 128 | char buffer[LUAL_BUFFERSIZE]; 129 | } luaL_Buffer; 130 | 131 | #define luaL_addchar(B,c) \ 132 | ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \ 133 | (*(B)->p++ = (char)(c))) 134 | 135 | /* compatibility only */ 136 | #define luaL_putchar(B,c) luaL_addchar(B,c) 137 | 138 | #define luaL_addsize(B,n) ((B)->p += (n)) 139 | 140 | LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B); 141 | LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B); 142 | LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l); 143 | LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s); 144 | LUALIB_API void (luaL_addvalue) (luaL_Buffer *B); 145 | LUALIB_API void (luaL_pushresult) (luaL_Buffer *B); 146 | 147 | 148 | /* }====================================================== */ 149 | 150 | 151 | /* compatibility with ref system */ 152 | 153 | /* pre-defined references */ 154 | #define LUA_NOREF (-2) 155 | #define LUA_REFNIL (-1) 156 | 157 | #define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ 158 | (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) 159 | 160 | #define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) 161 | 162 | #define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref)) 163 | 164 | 165 | #define luaL_reg luaL_Reg 166 | 167 | #endif 168 | -------------------------------------------------------------------------------- /third_party/lua/macos/include/lua.hpp: -------------------------------------------------------------------------------- 1 | // C++ wrapper for LuaJIT header files. 2 | 3 | extern "C" { 4 | #include "lua.h" 5 | #include "lauxlib.h" 6 | #include "lualib.h" 7 | #include "luajit.h" 8 | } 9 | 10 | -------------------------------------------------------------------------------- /third_party/lua/macos/include/luaconf.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Configuration header. 3 | ** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef luaconf_h 7 | #define luaconf_h 8 | 9 | #include 10 | #include 11 | 12 | /* Default path for loading Lua and C modules with require(). */ 13 | #if defined(_WIN32) 14 | /* 15 | ** In Windows, any exclamation mark ('!') in the path is replaced by the 16 | ** path of the directory of the executable file of the current process. 17 | */ 18 | #define LUA_LDIR "!\\lua\\" 19 | #define LUA_CDIR "!\\" 20 | #define LUA_PATH_DEFAULT \ 21 | ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" 22 | #define LUA_CPATH_DEFAULT \ 23 | ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" 24 | #else 25 | /* 26 | ** Note to distribution maintainers: do NOT patch the following line! 27 | ** Please read ../doc/install.html#distro and pass PREFIX=/usr instead. 28 | */ 29 | #define LUA_ROOT "/usr/local/" 30 | #define LUA_LDIR LUA_ROOT "share/lua/5.1/" 31 | #define LUA_CDIR LUA_ROOT "lib/lua/5.1/" 32 | #ifdef LUA_XROOT 33 | #define LUA_JDIR LUA_XROOT "share/luajit-2.0.2/" 34 | #define LUA_XPATH \ 35 | ";" LUA_XROOT "share/lua/5.1/?.lua;" LUA_XROOT "share/lua/5.1/?/init.lua" 36 | #define LUA_XCPATH LUA_XROOT "lib/lua/5.1/?.so;" 37 | #else 38 | #define LUA_JDIR LUA_ROOT "share/luajit-2.0.2/" 39 | #define LUA_XPATH 40 | #define LUA_XCPATH 41 | #endif 42 | #define LUA_PATH_DEFAULT \ 43 | "./?.lua;" LUA_JDIR"?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua" LUA_XPATH 44 | #define LUA_CPATH_DEFAULT \ 45 | "./?.so;" LUA_CDIR"?.so;" LUA_XCPATH LUA_CDIR"loadall.so" 46 | #endif 47 | 48 | /* Environment variable names for path overrides and initialization code. */ 49 | #define LUA_PATH "LUA_PATH" 50 | #define LUA_CPATH "LUA_CPATH" 51 | #define LUA_INIT "LUA_INIT" 52 | 53 | /* Special file system characters. */ 54 | #if defined(_WIN32) 55 | #define LUA_DIRSEP "\\" 56 | #else 57 | #define LUA_DIRSEP "/" 58 | #endif 59 | #define LUA_PATHSEP ";" 60 | #define LUA_PATH_MARK "?" 61 | #define LUA_EXECDIR "!" 62 | #define LUA_IGMARK "-" 63 | #define LUA_PATH_CONFIG \ 64 | LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" \ 65 | LUA_EXECDIR "\n" LUA_IGMARK 66 | 67 | /* Quoting in error messages. */ 68 | #define LUA_QL(x) "'" x "'" 69 | #define LUA_QS LUA_QL("%s") 70 | 71 | /* Various tunables. */ 72 | #define LUAI_MAXSTACK 65500 /* Max. # of stack slots for a thread (<64K). */ 73 | #define LUAI_MAXCSTACK 8000 /* Max. # of stack slots for a C func (<10K). */ 74 | #define LUAI_GCPAUSE 200 /* Pause GC until memory is at 200%. */ 75 | #define LUAI_GCMUL 200 /* Run GC at 200% of allocation speed. */ 76 | #define LUA_MAXCAPTURES 32 /* Max. pattern captures. */ 77 | 78 | /* Compatibility with older library function names. */ 79 | #define LUA_COMPAT_MOD /* OLD: math.mod, NEW: math.fmod */ 80 | #define LUA_COMPAT_GFIND /* OLD: string.gfind, NEW: string.gmatch */ 81 | 82 | /* Configuration for the frontend (the luajit executable). */ 83 | #if defined(luajit_c) 84 | #define LUA_PROGNAME "luajit" /* Fallback frontend name. */ 85 | #define LUA_PROMPT "> " /* Interactive prompt. */ 86 | #define LUA_PROMPT2 ">> " /* Continuation prompt. */ 87 | #define LUA_MAXINPUT 512 /* Max. input line length. */ 88 | #endif 89 | 90 | /* Note: changing the following defines breaks the Lua 5.1 ABI. */ 91 | #define LUA_INTEGER ptrdiff_t 92 | #define LUA_IDSIZE 60 /* Size of lua_Debug.short_src. */ 93 | /* 94 | ** Size of lauxlib and io.* on-stack buffers. Weird workaround to avoid using 95 | ** unreasonable amounts of stack space, but still retain ABI compatibility. 96 | ** Blame Lua for depending on BUFSIZ in the ABI, blame **** for wrecking it. 97 | */ 98 | #define LUAL_BUFFERSIZE (BUFSIZ > 16384 ? 8192 : BUFSIZ) 99 | 100 | /* The following defines are here only for compatibility with luaconf.h 101 | ** from the standard Lua distribution. They must not be changed for LuaJIT. 102 | */ 103 | #define LUA_NUMBER_DOUBLE 104 | #define LUA_NUMBER double 105 | #define LUAI_UACNUMBER double 106 | #define LUA_NUMBER_SCAN "%lf" 107 | #define LUA_NUMBER_FMT "%.14g" 108 | #define lua_number2str(s, n) sprintf((s), LUA_NUMBER_FMT, (n)) 109 | #define LUAI_MAXNUMBER2STR 32 110 | #define LUA_INTFRMLEN "l" 111 | #define LUA_INTFRM_T long 112 | 113 | /* Linkage of public API functions. */ 114 | #if defined(LUA_BUILD_AS_DLL) 115 | #if defined(LUA_CORE) || defined(LUA_LIB) 116 | #define LUA_API __declspec(dllexport) 117 | #else 118 | #define LUA_API __declspec(dllimport) 119 | #endif 120 | #else 121 | #define LUA_API extern 122 | #endif 123 | 124 | #define LUALIB_API LUA_API 125 | 126 | /* Support for internal assertions. */ 127 | #if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK) 128 | #include 129 | #endif 130 | #ifdef LUA_USE_ASSERT 131 | #define lua_assert(x) assert(x) 132 | #endif 133 | #ifdef LUA_USE_APICHECK 134 | #define luai_apicheck(L, o) { (void)L; assert(o); } 135 | #else 136 | #define luai_apicheck(L, o) { (void)L; } 137 | #endif 138 | 139 | #endif 140 | -------------------------------------------------------------------------------- /third_party/lua/macos/include/luajit.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** LuaJIT -- a Just-In-Time Compiler for Lua. http://luajit.org/ 3 | ** 4 | ** Copyright (C) 2005-2013 Mike Pall. All rights reserved. 5 | ** 6 | ** Permission is hereby granted, free of charge, to any person obtaining 7 | ** a copy of this software and associated documentation files (the 8 | ** "Software"), to deal in the Software without restriction, including 9 | ** without limitation the rights to use, copy, modify, merge, publish, 10 | ** distribute, sublicense, and/or sell copies of the Software, and to 11 | ** permit persons to whom the Software is furnished to do so, subject to 12 | ** the following conditions: 13 | ** 14 | ** The above copyright notice and this permission notice shall be 15 | ** included in all copies or substantial portions of the Software. 16 | ** 17 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | ** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | ** 25 | ** [ MIT license: http://www.opensource.org/licenses/mit-license.php ] 26 | */ 27 | 28 | #ifndef _LUAJIT_H 29 | #define _LUAJIT_H 30 | 31 | #include "lua.h" 32 | 33 | #define LUAJIT_VERSION "LuaJIT 2.0.2" 34 | #define LUAJIT_VERSION_NUM 20002 /* Version 2.0.2 = 02.00.02. */ 35 | #define LUAJIT_VERSION_SYM luaJIT_version_2_0_2 36 | #define LUAJIT_COPYRIGHT "Copyright (C) 2005-2013 Mike Pall" 37 | #define LUAJIT_URL "http://luajit.org/" 38 | 39 | /* Modes for luaJIT_setmode. */ 40 | #define LUAJIT_MODE_MASK 0x00ff 41 | 42 | enum { 43 | LUAJIT_MODE_ENGINE, /* Set mode for whole JIT engine. */ 44 | LUAJIT_MODE_DEBUG, /* Set debug mode (idx = level). */ 45 | 46 | LUAJIT_MODE_FUNC, /* Change mode for a function. */ 47 | LUAJIT_MODE_ALLFUNC, /* Recurse into subroutine protos. */ 48 | LUAJIT_MODE_ALLSUBFUNC, /* Change only the subroutines. */ 49 | 50 | LUAJIT_MODE_TRACE, /* Flush a compiled trace. */ 51 | 52 | LUAJIT_MODE_WRAPCFUNC = 0x10, /* Set wrapper mode for C function calls. */ 53 | 54 | LUAJIT_MODE_MAX 55 | }; 56 | 57 | /* Flags or'ed in to the mode. */ 58 | #define LUAJIT_MODE_OFF 0x0000 /* Turn feature off. */ 59 | #define LUAJIT_MODE_ON 0x0100 /* Turn feature on. */ 60 | #define LUAJIT_MODE_FLUSH 0x0200 /* Flush JIT-compiled code. */ 61 | 62 | /* LuaJIT public C API. */ 63 | 64 | /* Control the JIT engine. */ 65 | LUA_API int luaJIT_setmode(lua_State *L, int idx, int mode); 66 | 67 | /* Enforce (dynamic) linker error for version mismatches. Call from main. */ 68 | LUA_API void LUAJIT_VERSION_SYM(void); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /third_party/lua/macos/include/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Standard library header. 3 | ** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LUALIB_H 7 | #define _LUALIB_H 8 | 9 | #include "lua.h" 10 | 11 | #define LUA_FILEHANDLE "FILE*" 12 | 13 | #define LUA_COLIBNAME "coroutine" 14 | #define LUA_MATHLIBNAME "math" 15 | #define LUA_STRLIBNAME "string" 16 | #define LUA_TABLIBNAME "table" 17 | #define LUA_IOLIBNAME "io" 18 | #define LUA_OSLIBNAME "os" 19 | #define LUA_LOADLIBNAME "package" 20 | #define LUA_DBLIBNAME "debug" 21 | #define LUA_BITLIBNAME "bit" 22 | #define LUA_JITLIBNAME "jit" 23 | #define LUA_FFILIBNAME "ffi" 24 | 25 | LUALIB_API int luaopen_base(lua_State *L); 26 | LUALIB_API int luaopen_math(lua_State *L); 27 | LUALIB_API int luaopen_string(lua_State *L); 28 | LUALIB_API int luaopen_table(lua_State *L); 29 | LUALIB_API int luaopen_io(lua_State *L); 30 | LUALIB_API int luaopen_os(lua_State *L); 31 | LUALIB_API int luaopen_package(lua_State *L); 32 | LUALIB_API int luaopen_debug(lua_State *L); 33 | LUALIB_API int luaopen_bit(lua_State *L); 34 | LUALIB_API int luaopen_jit(lua_State *L); 35 | LUALIB_API int luaopen_ffi(lua_State *L); 36 | 37 | LUALIB_API void luaL_openlibs(lua_State *L); 38 | 39 | #ifndef lua_assert 40 | #define lua_assert(x) ((void)0) 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /third_party/lua/win32/debug/lua51.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/third_party/lua/win32/debug/lua51.lib -------------------------------------------------------------------------------- /third_party/lua/win32/include/lauxlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Auxiliary functions for building Lua libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lauxlib_h 9 | #define lauxlib_h 10 | 11 | 12 | #include 13 | #include 14 | 15 | #include "lua.h" 16 | 17 | 18 | #define luaL_getn(L,i) ((int)lua_objlen(L, i)) 19 | #define luaL_setn(L,i,j) ((void)0) /* no op! */ 20 | 21 | /* extra error code for `luaL_load' */ 22 | #define LUA_ERRFILE (LUA_ERRERR+1) 23 | 24 | typedef struct luaL_Reg { 25 | const char *name; 26 | lua_CFunction func; 27 | } luaL_Reg; 28 | 29 | LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname, 30 | const luaL_Reg *l, int nup); 31 | LUALIB_API void (luaL_register) (lua_State *L, const char *libname, 32 | const luaL_Reg *l); 33 | LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); 34 | LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); 35 | LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname); 36 | LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); 37 | LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, 38 | size_t *l); 39 | LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg, 40 | const char *def, size_t *l); 41 | LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg); 42 | LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def); 43 | 44 | LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg); 45 | LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg, 46 | lua_Integer def); 47 | 48 | LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg); 49 | LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t); 50 | LUALIB_API void (luaL_checkany) (lua_State *L, int narg); 51 | 52 | LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname); 53 | LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname); 54 | 55 | LUALIB_API void (luaL_where) (lua_State *L, int lvl); 56 | LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); 57 | 58 | LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, 59 | const char *const lst[]); 60 | 61 | LUALIB_API int (luaL_ref) (lua_State *L, int t); 62 | LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); 63 | 64 | LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename); 65 | LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, 66 | const char *name); 67 | LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); 68 | 69 | LUALIB_API lua_State *(luaL_newstate) (void); 70 | 71 | 72 | LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, 73 | const char *r); 74 | 75 | LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx, 76 | const char *fname, int szhint); 77 | 78 | /* From Lua 5.2. */ 79 | LUALIB_API int luaL_fileresult(lua_State *L, int stat, const char *fname); 80 | LUALIB_API int luaL_execresult(lua_State *L, int stat); 81 | LUALIB_API int (luaL_loadfilex) (lua_State *L, const char *filename, 82 | const char *mode); 83 | LUALIB_API int (luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz, 84 | const char *name, const char *mode); 85 | LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, const char *msg, 86 | int level); 87 | 88 | 89 | /* 90 | ** =============================================================== 91 | ** some useful macros 92 | ** =============================================================== 93 | */ 94 | 95 | #define luaL_argcheck(L, cond,numarg,extramsg) \ 96 | ((void)((cond) || luaL_argerror(L, (numarg), (extramsg)))) 97 | #define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) 98 | #define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) 99 | #define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) 100 | #define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) 101 | #define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) 102 | #define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) 103 | 104 | #define luaL_typename(L,i) lua_typename(L, lua_type(L,(i))) 105 | 106 | #define luaL_dofile(L, fn) \ 107 | (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0)) 108 | 109 | #define luaL_dostring(L, s) \ 110 | (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0)) 111 | 112 | #define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n))) 113 | 114 | #define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) 115 | 116 | /* 117 | ** {====================================================== 118 | ** Generic Buffer manipulation 119 | ** ======================================================= 120 | */ 121 | 122 | 123 | 124 | typedef struct luaL_Buffer { 125 | char *p; /* current position in buffer */ 126 | int lvl; /* number of strings in the stack (level) */ 127 | lua_State *L; 128 | char buffer[LUAL_BUFFERSIZE]; 129 | } luaL_Buffer; 130 | 131 | #define luaL_addchar(B,c) \ 132 | ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \ 133 | (*(B)->p++ = (char)(c))) 134 | 135 | /* compatibility only */ 136 | #define luaL_putchar(B,c) luaL_addchar(B,c) 137 | 138 | #define luaL_addsize(B,n) ((B)->p += (n)) 139 | 140 | LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B); 141 | LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B); 142 | LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l); 143 | LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s); 144 | LUALIB_API void (luaL_addvalue) (luaL_Buffer *B); 145 | LUALIB_API void (luaL_pushresult) (luaL_Buffer *B); 146 | 147 | 148 | /* }====================================================== */ 149 | 150 | 151 | /* compatibility with ref system */ 152 | 153 | /* pre-defined references */ 154 | #define LUA_NOREF (-2) 155 | #define LUA_REFNIL (-1) 156 | 157 | #define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ 158 | (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) 159 | 160 | #define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) 161 | 162 | #define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref)) 163 | 164 | 165 | #define luaL_reg luaL_Reg 166 | 167 | #endif 168 | -------------------------------------------------------------------------------- /third_party/lua/win32/include/lua.hpp: -------------------------------------------------------------------------------- 1 | // C++ wrapper for LuaJIT header files. 2 | 3 | extern "C" { 4 | #include "lua.h" 5 | #include "lauxlib.h" 6 | #include "lualib.h" 7 | #include "luajit.h" 8 | } 9 | 10 | -------------------------------------------------------------------------------- /third_party/lua/win32/include/luaconf.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Configuration header. 3 | ** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef luaconf_h 7 | #define luaconf_h 8 | 9 | #include 10 | #include 11 | 12 | /* Default path for loading Lua and C modules with require(). */ 13 | #if defined(_WIN32) 14 | /* 15 | ** In Windows, any exclamation mark ('!') in the path is replaced by the 16 | ** path of the directory of the executable file of the current process. 17 | */ 18 | #define LUA_LDIR "!\\lua\\" 19 | #define LUA_CDIR "!\\" 20 | #define LUA_PATH_DEFAULT \ 21 | ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" 22 | #define LUA_CPATH_DEFAULT \ 23 | ".\\LuaEx\\?.dll;.\\?.dll;" LUA_CDIR"LuaEx\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" 24 | #else 25 | /* 26 | ** Note to distribution maintainers: do NOT patch the following lines! 27 | ** Please read ../doc/install.html#distro and pass PREFIX=/usr instead. 28 | */ 29 | #ifndef LUA_MULTILIB 30 | #define LUA_MULTILIB "lib" 31 | #endif 32 | #ifndef LUA_LMULTILIB 33 | #define LUA_LMULTILIB "lib" 34 | #endif 35 | #define LUA_LROOT "/usr/local" 36 | #define LUA_LUADIR "/lua/5.1/" 37 | #define LUA_LJDIR "/luajit-2.0.2/" 38 | 39 | #ifdef LUA_ROOT 40 | #define LUA_JROOT LUA_ROOT 41 | #define LUA_RLDIR LUA_ROOT "/share" LUA_LUADIR 42 | #define LUA_RCDIR LUA_ROOT "/" LUA_MULTILIB LUA_LUADIR 43 | #define LUA_RLPATH ";" LUA_RLDIR "?.lua;" LUA_RLDIR "?/init.lua" 44 | #define LUA_RCPATH ";" LUA_RCDIR "?.so" 45 | #else 46 | #define LUA_JROOT LUA_LROOT 47 | #define LUA_RLPATH 48 | #define LUA_RCPATH 49 | #endif 50 | 51 | #define LUA_JPATH ";" LUA_JROOT "/share" LUA_LJDIR "?.lua" 52 | #define LUA_LLDIR LUA_LROOT "/share" LUA_LUADIR 53 | #define LUA_LCDIR LUA_LROOT "/" LUA_LMULTILIB LUA_LUADIR 54 | #define LUA_LLPATH ";" LUA_LLDIR "?.lua;" LUA_LLDIR "?/init.lua" 55 | #define LUA_LCPATH1 ";" LUA_LCDIR "?.so" 56 | #define LUA_LCPATH2 ";" LUA_LCDIR "loadall.so" 57 | 58 | #define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH 59 | #define LUA_CPATH_DEFAULT "./?.so" LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2 60 | #endif 61 | 62 | /* Environment variable names for path overrides and initialization code. */ 63 | #define LUA_PATH "LUA_PATH" 64 | #define LUA_CPATH "LUA_CPATH" 65 | #define LUA_INIT "LUA_INIT" 66 | 67 | /* Special file system characters. */ 68 | #if defined(_WIN32) 69 | #define LUA_DIRSEP "\\" 70 | #else 71 | #define LUA_DIRSEP "/" 72 | #endif 73 | #define LUA_PATHSEP ";" 74 | #define LUA_PATH_MARK "?" 75 | #define LUA_EXECDIR "!" 76 | #define LUA_IGMARK "-" 77 | #define LUA_PATH_CONFIG \ 78 | LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" \ 79 | LUA_EXECDIR "\n" LUA_IGMARK 80 | 81 | /* Quoting in error messages. */ 82 | #define LUA_QL(x) "'" x "'" 83 | #define LUA_QS LUA_QL("%s") 84 | 85 | /* Various tunables. */ 86 | #define LUAI_MAXSTACK 65500 /* Max. # of stack slots for a thread (<64K). */ 87 | #define LUAI_MAXCSTACK 8000 /* Max. # of stack slots for a C func (<10K). */ 88 | #define LUAI_GCPAUSE 200 /* Pause GC until memory is at 200%. */ 89 | #define LUAI_GCMUL 200 /* Run GC at 200% of allocation speed. */ 90 | #define LUA_MAXCAPTURES 32 /* Max. pattern captures. */ 91 | 92 | /* Compatibility with older library function names. */ 93 | #define LUA_COMPAT_MOD /* OLD: math.mod, NEW: math.fmod */ 94 | #define LUA_COMPAT_GFIND /* OLD: string.gfind, NEW: string.gmatch */ 95 | 96 | /* Configuration for the frontend (the luajit executable). */ 97 | #if defined(luajit_c) 98 | #define LUA_PROGNAME "luajit" /* Fallback frontend name. */ 99 | #define LUA_PROMPT "> " /* Interactive prompt. */ 100 | #define LUA_PROMPT2 ">> " /* Continuation prompt. */ 101 | #define LUA_MAXINPUT 512 /* Max. input line length. */ 102 | #endif 103 | 104 | /* Note: changing the following defines breaks the Lua 5.1 ABI. */ 105 | #define LUA_INTEGER ptrdiff_t 106 | #define LUA_IDSIZE 60 /* Size of lua_Debug.short_src. */ 107 | /* 108 | ** Size of lauxlib and io.* on-stack buffers. Weird workaround to avoid using 109 | ** unreasonable amounts of stack space, but still retain ABI compatibility. 110 | ** Blame Lua for depending on BUFSIZ in the ABI, blame **** for wrecking it. 111 | */ 112 | #define LUAL_BUFFERSIZE (BUFSIZ > 16384 ? 8192 : BUFSIZ) 113 | 114 | /* The following defines are here only for compatibility with luaconf.h 115 | ** from the standard Lua distribution. They must not be changed for LuaJIT. 116 | */ 117 | #define LUA_NUMBER_DOUBLE 118 | #define LUA_NUMBER double 119 | #define LUAI_UACNUMBER double 120 | #define LUA_NUMBER_SCAN "%lf" 121 | #define LUA_NUMBER_FMT "%.14g" 122 | #define lua_number2str(s, n) sprintf((s), LUA_NUMBER_FMT, (n)) 123 | #define LUAI_MAXNUMBER2STR 32 124 | #define LUA_INTFRMLEN "l" 125 | #define LUA_INTFRM_T long 126 | 127 | /* Linkage of public API functions. */ 128 | #if defined(LUA_BUILD_AS_DLL) 129 | #if defined(LUA_CORE) || defined(LUA_LIB) 130 | #define LUA_API __declspec(dllexport) 131 | #else 132 | #define LUA_API __declspec(dllimport) 133 | #endif 134 | #else 135 | #define LUA_API extern 136 | #endif 137 | 138 | #define LUALIB_API LUA_API 139 | 140 | /* Support for internal assertions. */ 141 | #if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK) 142 | #include 143 | #endif 144 | #ifdef LUA_USE_ASSERT 145 | #define lua_assert(x) assert(x) 146 | #endif 147 | #ifdef LUA_USE_APICHECK 148 | #define luai_apicheck(L, o) { (void)L; assert(o); } 149 | #else 150 | #define luai_apicheck(L, o) { (void)L; } 151 | #endif 152 | 153 | #endif 154 | -------------------------------------------------------------------------------- /third_party/lua/win32/include/luajit.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** LuaJIT -- a Just-In-Time Compiler for Lua. http://luajit.org/ 3 | ** 4 | ** Copyright (C) 2005-2013 Mike Pall. All rights reserved. 5 | ** 6 | ** Permission is hereby granted, free of charge, to any person obtaining 7 | ** a copy of this software and associated documentation files (the 8 | ** "Software"), to deal in the Software without restriction, including 9 | ** without limitation the rights to use, copy, modify, merge, publish, 10 | ** distribute, sublicense, and/or sell copies of the Software, and to 11 | ** permit persons to whom the Software is furnished to do so, subject to 12 | ** the following conditions: 13 | ** 14 | ** The above copyright notice and this permission notice shall be 15 | ** included in all copies or substantial portions of the Software. 16 | ** 17 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | ** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | ** 25 | ** [ MIT license: http://www.opensource.org/licenses/mit-license.php ] 26 | */ 27 | 28 | #ifndef _LUAJIT_H 29 | #define _LUAJIT_H 30 | 31 | #include "lua.h" 32 | 33 | #define LUAJIT_VERSION "LuaJIT 2.0.2" 34 | #define LUAJIT_VERSION_NUM 20002 /* Version 2.0.2 = 02.00.02. */ 35 | #define LUAJIT_VERSION_SYM luaJIT_version_2_0_2 36 | #define LUAJIT_COPYRIGHT "Copyright (C) 2005-2013 Mike Pall" 37 | #define LUAJIT_URL "http://luajit.org/" 38 | 39 | /* Modes for luaJIT_setmode. */ 40 | #define LUAJIT_MODE_MASK 0x00ff 41 | 42 | enum { 43 | LUAJIT_MODE_ENGINE, /* Set mode for whole JIT engine. */ 44 | LUAJIT_MODE_DEBUG, /* Set debug mode (idx = level). */ 45 | 46 | LUAJIT_MODE_FUNC, /* Change mode for a function. */ 47 | LUAJIT_MODE_ALLFUNC, /* Recurse into subroutine protos. */ 48 | LUAJIT_MODE_ALLSUBFUNC, /* Change only the subroutines. */ 49 | 50 | LUAJIT_MODE_TRACE, /* Flush a compiled trace. */ 51 | 52 | LUAJIT_MODE_WRAPCFUNC = 0x10, /* Set wrapper mode for C function calls. */ 53 | 54 | LUAJIT_MODE_MAX 55 | }; 56 | 57 | /* Flags or'ed in to the mode. */ 58 | #define LUAJIT_MODE_OFF 0x0000 /* Turn feature off. */ 59 | #define LUAJIT_MODE_ON 0x0100 /* Turn feature on. */ 60 | #define LUAJIT_MODE_FLUSH 0x0200 /* Flush JIT-compiled code. */ 61 | 62 | /* LuaJIT public C API. */ 63 | 64 | /* Control the JIT engine. */ 65 | LUA_API int luaJIT_setmode(lua_State *L, int idx, int mode); 66 | 67 | /* Enforce (dynamic) linker error for version mismatches. Call from main. */ 68 | LUA_API void LUAJIT_VERSION_SYM(void); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /third_party/lua/win32/include/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Standard library header. 3 | ** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LUALIB_H 7 | #define _LUALIB_H 8 | 9 | #include "lua.h" 10 | 11 | #define LUA_FILEHANDLE "FILE*" 12 | 13 | #define LUA_COLIBNAME "coroutine" 14 | #define LUA_MATHLIBNAME "math" 15 | #define LUA_STRLIBNAME "string" 16 | #define LUA_TABLIBNAME "table" 17 | #define LUA_IOLIBNAME "io" 18 | #define LUA_OSLIBNAME "os" 19 | #define LUA_LOADLIBNAME "package" 20 | #define LUA_DBLIBNAME "debug" 21 | #define LUA_BITLIBNAME "bit" 22 | #define LUA_JITLIBNAME "jit" 23 | #define LUA_FFILIBNAME "ffi" 24 | 25 | LUALIB_API int luaopen_base(lua_State *L); 26 | LUALIB_API int luaopen_math(lua_State *L); 27 | LUALIB_API int luaopen_string(lua_State *L); 28 | LUALIB_API int luaopen_table(lua_State *L); 29 | LUALIB_API int luaopen_io(lua_State *L); 30 | LUALIB_API int luaopen_os(lua_State *L); 31 | LUALIB_API int luaopen_package(lua_State *L); 32 | LUALIB_API int luaopen_debug(lua_State *L); 33 | LUALIB_API int luaopen_bit(lua_State *L); 34 | LUALIB_API int luaopen_jit(lua_State *L); 35 | LUALIB_API int luaopen_ffi(lua_State *L); 36 | 37 | LUALIB_API void luaL_openlibs(lua_State *L); 38 | 39 | #ifndef lua_assert 40 | #define lua_assert(x) ((void)0) 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /third_party/lua/win32/release/lua51.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/third_party/lua/win32/release/lua51.lib -------------------------------------------------------------------------------- /third_party/lua/win32/static/lua51.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/third_party/lua/win32/static/lua51.lib -------------------------------------------------------------------------------- /third_party/vld/include/vld_def.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Visual Leak Detector - Import Library Header 4 | // Copyright (c) 2005-2014 VLD Team 5 | // 6 | // This library is free software; you can redistribute it and/or 7 | // modify it under the terms of the GNU Lesser General Public 8 | // License as published by the Free Software Foundation; either 9 | // version 2.1 of the License, or (at your option) any later version. 10 | // 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | // Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public 17 | // License along with this library; if not, write to the Free Software 18 | // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | // 20 | // See COPYING.txt for the full terms of the GNU Lesser General Public License. 21 | // 22 | //////////////////////////////////////////////////////////////////////////////// 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | #define VLD_OPT_AGGREGATE_DUPLICATES 0x0001 // If set, aggregate duplicate leaks in the leak report. 29 | #define VLD_OPT_MODULE_LIST_INCLUDE 0x0002 // If set, modules in the module list are included, all others are excluded. 30 | #define VLD_OPT_REPORT_TO_DEBUGGER 0x0004 // If set, the memory leak report is sent to the debugger. 31 | #define VLD_OPT_REPORT_TO_FILE 0x0008 // If set, the memory leak report is sent to a file. 32 | #define VLD_OPT_SAFE_STACK_WALK 0x0010 // If set, the stack is walked using the "safe" method (StackWalk64). 33 | #define VLD_OPT_SELF_TEST 0x0020 // If set, perform a self-test to verify memory leak self-checking. 34 | #define VLD_OPT_SLOW_DEBUGGER_DUMP 0x0040 // If set, inserts a slight delay between sending output to the debugger. 35 | #define VLD_OPT_START_DISABLED 0x0080 // If set, memory leak detection will initially disabled. 36 | #define VLD_OPT_TRACE_INTERNAL_FRAMES 0x0100 // If set, include useless frames (e.g. internal to VLD) in call stacks. 37 | #define VLD_OPT_UNICODE_REPORT 0x0200 // If set, the leak report will be encoded UTF-16 instead of ASCII. 38 | #define VLD_OPT_VLDOFF 0x0400 // If set, VLD will be completely deactivated. It will not attach to any modules. 39 | #define VLD_OPT_REPORT_TO_STDOUT 0x0800 // If set, the memory leak report is sent to stdout. 40 | #define VLD_OPT_SKIP_HEAPFREE_LEAKS 0x1000 // If set, VLD skip HeapFree memory leaks. 41 | #define VLD_OPT_VALIDATE_HEAPFREE 0x2000 // If set, VLD verifies and reports heap consistency for HeapFree calls. 42 | 43 | #define VLD_RPTHOOK_INSTALL 0 44 | #define VLD_RPTHOOK_REMOVE 1 45 | 46 | typedef int (__cdecl * VLD_REPORT_HOOK)(int reportType, wchar_t *message, int *returnValue); 47 | -------------------------------------------------------------------------------- /third_party/vld/win32/debug/vld.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/third_party/vld/win32/debug/vld.lib -------------------------------------------------------------------------------- /third_party/vld/win64/debug/vld.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chenall/ALMRun/133b65683f7ab7864bc889c2031f4ae0250d23d3/third_party/vld/win64/debug/vld.lib --------------------------------------------------------------------------------