# WinMerge Plugins
This folders holds the WinMerge runtime plugins, source code and binaries both.
These filters are distributed in the `MergePlugins` subdirectory beneath the WinMerge executables.
## Quick description
Plugins use an ActiveX interface. Plugins may be written in any format that supports this interface.
Examples are available in :
* C++ COM component
* VB ActiveX dll
* Scriptlets (VBScript, JScript)
* Delphi
Limitation : Scriptlets only work for `EDITOR_SCRIPT` plugins.
**Properties** are used to present information concerning the plugin.
**Methods** are used to process the data. Method names and syntax depends on events and **API** (see below).
## Events
### `EDITOR_SCRIPT`
In editor view, apply a function to the current selection.
### `PREDIFF`
Preprocess file before diffing : the plugin is not apply to the text displayed in the editor.
It is applied only to a copy of the left and right texts, and this copy are then scanned to create the difference list.
As now:
* you may delete one column, change the names of variables...
* you may not add/delete/move lines.
### `PACK_UNPACK`
Transform a file in a viewable format (for example, decompress a file...)
* The editor displays the unpacked data.
* Sometimes files may be packed again (zipped files...). An additional function is of course necessary.
* If the author of the plugin created this function, file may be saved again in the compressed format.
* Else the file can only be saved in a text format. To avoid problems, you are proposed to change the filename when saving a changed file.
## API
Some events have two API. One to exchange the data through a `BSTR` (memory) and one through input/ouput files.
| Event | Data exchange |
|:---------------------|:---------------------------------------------------------------------------------------------------------|
| `FILE_PREDIFF` | data are exchanged through an input and an output file |
| `BUFFER_PREDIFF` | data are exchanged through a `BSTR` |
| `FILE_PACK_UNPACK` | data are exchanged through an input and an output file |
| `BUFFER_PACK_UNPACK` | data are exchanged through a `SafeArray` (`BSTR` not available as the packed data are possibly not text) |
| `EDITOR_SCRIPT` | data are exchanged through a `BSTR` |
You need to define only one API to handle an event. Define the one you prefer.
## Properties
| Name | Mandatory | Events |
|:--------------------|:----------------------------------|:-------------------------|
| `PluginEvent` | yes | all |
| `PluginDescription` | no | all |
| `PluginFileFilters` | no | `PACK_UNPACK`, `PREDIFF` |
| `PluginIsAutomatic` | if `PluginFileFilters` is defined | `PACK_UNPACK`, `PREDIFF` |
`PluginIsAutomatic` and `PluginFileFilters` are for automatic mode :
* When `PluginIsAutomatic` is `false`, the plugin is never used in automatic mode.
* When `PluginIsAutomatic` is `true`, `PluginFileFilters` is compared to the filename of both files. If one file matches the filter, the plugin is applied.
## Methods
| API | Method name |
|:---------------------|:-----------------------------------------------------------------------------------------------|
| `EDITOR_SCRIPT` | function name is free **Note**: several functions may be defined in one `EDITOR_SCRIPT` plugin |
| `BUFFER_PREDIFF` | `PrediffBufferW` |
| `FILE_PREDIFF` | `PrediffFile` |
| `BUFFER_PACK_UNPACK` | `UnpackBufferA`, `PackBufferA` |
| `FILE_PACK_UNPACK` | `UnpackFile`, `PackFile` |
**Note**: `PACK_UNPACK` functions use an additional parameter. The value may be set during `UnpackBuffer`.
When file is changed, the value is forwarded to `PackBuffer`. The goal is to pass a parameter from `UnpackBuffer` to `PackBuffer`.
For example, the plugin may handle several compressed formats, and use this value to recompress a file in the format of the original.
This parameter is mandatory for the function's syntax. But you don't have to set its value when you don't use it.
## Syntax
### Properties syntax
#### `PluginEvent`
| Language | Syntax |
|:--------:|:--------------------------------------------------------------------|
| C++ | `STDMETHODIMP CWinMergeScript::get_PluginEvent(BSTR * pVal)` |
| VB | `Public Property Get PluginEvent() As String` |
| VBScript | `Function get_PluginEvent()` |
| JScript | `function get_PluginEvent()` |
#### `PluginDescription`
| Language | Syntax |
|:--------:|:--------------------------------------------------------------------|
| C++ | `STDMETHODIMP CWinMergeScript::get_PluginDescription(BSTR * pVal)` |
| VB | `Public Property Get PluginDescription() As String` |
| VBScript | `Function get_PluginDescription() |
| JScript | `function get_PluginDescription()` |
#### `PluginFileFilters`
String formed of fileFilters, separated with `;`
| Language | Syntax |
|:--------:|:--------------------------------------------------------------------|
| C++ | `STDMETHODIMP CWinMergeScript::get_PluginFileFilters(BSTR * pVal)` |
| VB | `Public Property Get PluginFileFilters() As String` |
| VBScript | `Function get_PluginFileFilters() |
| JScript | `function get_PluginFileFilters()` |
#### `PluginIsAutomatic`
| Language | Syntax |
|:--------:|:------------------------------------------------------------------------------|
| C++ | `STDMETHODIMP CWinMergeScript::get_PluginIsAutomatic(VARIANT_BOOL * pVal)` |
| VB | `Public Property Get PluginIsAutomatic() As Boolean` |
| VBScript | `Function get_PluginIsAutomatic()` |
| JScript | `function get_PluginIsAutomatic()` |
### Methods syntax
#### `EDITOR_SCRIPT`
| Language | Functions parameters (function names are free) |
|:--------:|:------------------------------------------------------------------------------|
| C++ | `STDMETHOD(MakeUpper)([in] BSTR inputText, [out, retval] BSTR * outputText);` |
| VB | `Public Function MakeUpper(text As String)` |
| VBScript | `Function MakeUpper(Text)` |
| JScript | `function MakeUpper(Text)` |
#### `FILE_PREDIFF`
| Language | Functions names | Functions parameters |
|:--------:|:-------------------
没有合适的资源?快使用搜索试试~ 我知道了~
开源软件 winmerge 代码
共2000个文件
h:705个
cpp:680个
txt:486个
需积分: 0 3 下载量 169 浏览量
2024-02-29
21:08:47
上传
评论
收藏 17MB ZIP 举报
温馨提示
WinMerge 是一款功能强大且易于使用的文件比较和合并工具,它能够帮助用户快速准确地找出文件之间的差异,并提供了方便的合并功能,解决了文件管理工作中的痛点。
资源推荐
资源详情
资源评论
收起资源包目录
开源软件 winmerge 代码 (2000个子文件)
charsets.c 81KB
io.c 36KB
analyze.c 32KB
xdiffi.c 28KB
util.c 23KB
pdjson.c 22KB
lwdisp.c 22KB
xmerge.c 17KB
xutils.c 13KB
xprepare.c 12KB
context.c 11KB
xpatience.c 11KB
ifdef.c 10KB
xhistogram.c 9KB
xemit.c 8KB
side.c 7KB
ed.c 5KB
normal.c 2KB
cmpbuf.c 1KB
xnone.c 998B
GnuVersion.c 94B
ccrystaltextview.cpp 227KB
DirView.cpp 139KB
MergeDoc.cpp 129KB
MergeEditView.cpp 122KB
MainFrm.cpp 117KB
MergeCmdLine_test.cpp 103KB
ccrystaleditview.cpp 84KB
ImgMergeFrm.cpp 71KB
DirViewColItems.cpp 70KB
ccrystaltextbuffer.cpp 63KB
JSONTest.cpp 54KB
Merge.cpp 53KB
BCMenu.cpp 53KB
OpenView.cpp 52KB
WebPageDiffFrm.cpp 50KB
DiffWrapper.cpp 50KB
DirActions.cpp 49KB
Plugins.cpp 48KB
NetworkInterface.cpp 44KB
MessageBoxDialog.cpp 43KB
sizecbar.cpp 42KB
cregexp.cpp 38KB
wcwidth.cpp 35KB
DirScan.cpp 35KB
ccrystaltextview2.cpp 33KB
TimeSizeCompare_test.cpp 33KB
LocationView.cpp 32KB
Merge7zCommon.cpp 31KB
unicoder.cpp 30KB
stringdiffs_test.cpp 30KB
SocketImpl.cpp 29KB
DirDoc.cpp 29KB
GhostTextBuffer.cpp 28KB
MergeDocDiffSync.cpp 27KB
stringdiffs.cpp 27KB
ConfigTest.cpp 26KB
HexMergeDoc.cpp 26KB
FileTransform.cpp 25KB
xutils_test.cpp 24KB
LanguageSelect.cpp 24KB
tex.cpp 24KB
Test.cpp 24KB
DiffList.cpp 23KB
InternalPlugins.cpp 22KB
ccrystalrendererdirectwrite.cpp 22KB
abap.cpp 22KB
7zCommon.cpp 22KB
paths.cpp 21KB
OptionsMgr.cpp 21KB
batch.cpp 21KB
UniFile.cpp 20KB
markdown.cpp 20KB
is.cpp 19KB
SubeditList.cpp 19KB
autoit.cpp 19KB
CMoveConstraint.cpp 19KB
IPAddressTest.cpp 19KB
MailMessageTest.cpp 19KB
IPAddressImpl.cpp 18KB
nsis.cpp 18KB
css.cpp 18KB
RegOptionsMgr.cpp 18KB
DatagramSocketTest.cpp 17KB
MailMessage.cpp 17KB
stringdiffs_test_bugs.cpp 17KB
DiffTextBuffer.cpp 17KB
FolderCmp.cpp 17KB
html.cpp 17KB
FileFiltersDlg.cpp 17KB
DNS.cpp 17KB
ByteCompare_test.cpp 17KB
DirCmpReport.cpp 16KB
ProjectFile.cpp 16KB
MDITabBar.cpp 16KB
HTTPServerTest.cpp 16KB
php.cpp 16KB
multiformatText.cpp 16KB
innosetup.cpp 16KB
SMTPClientSession.cpp 16KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
ewrest
- 粉丝: 12
- 资源: 81
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功