├── .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 | 
83 |
84 | * Merry 原生界面
85 |
86 | 
87 |
88 | * 直接使用Executor 主题效果
89 |
90 | 
91 |
92 | 
93 |
94 | 
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