<?xml version="1.0" encoding="UTF-8"?>
<sect1 id="Plugins">
  <title>プラグイン</title>

  <para>Plugins are extra-features for WinMerge. They are not included in the
  basic version because they interest few users, or because they do not fit in
  WinMerge architecture.</para>

  <para>Each plugin:</para>

  <itemizedlist>
    <listitem>
      <simpara>is a single file, either a dll or a scriptlet (extension
      <filename class="extension">.sct</filename>)</simpara>
    </listitem>

    <listitem>
      <simpara>is installed in the subfolder <filename
      class="directory">MergePlugins</filename></simpara>
    </listitem>

    <listitem>
      <simpara>is easy to install: copy the plugin file in <filename
      class="directory">MergePlugins</filename>, close WinMerge if it is
      running, and launch it again</simpara>
    </listitem>
  </itemizedlist>

  <sect2>
    <title>プラグインの３つのカテゴリ</title>

    <para>"<guilabel>Plugins</guilabel>" is a generic name for extra-feature
    dll or scriptlets. Plugins features are spread over three
    categories:</para>

    <sect3>
      <title>エディタ補完プラグイン</title>

      <para>Operate custom operations on the currently selected text from the
      active editor pane.</para>

      <para>Example plugin: <link linkend="EditorAddin"><filename>editor
      addin.sct</filename></link> (Turn the selection to UPPER CASE or lower
      case.)</para>
    </sect3>

    <sect3>
      <title>展開プラグイン - ファイルからテキストフォーマットへ</title>

      <para>The plugin transform a file in a viewable format (for example,
      decompress a file). The original file is not changed. A temporary
      transformed file is created and loaded in WinMerge.</para>

      <para>Sometimes the transformed file can be packed back. (See the plugin
      details to know if it supports packing back.) Then you may merge and
      save the transformed file. The packing is done automatically in this
      case. To avoid problems, you are proposed to change the filename when
      saving a changed file.</para>

      <note>
        <para>When you compare folders, WinMerge doesn't need to display the
        files, but the diffing process can give a different result when you
        compare compressed and not compressed files (for example, uncompressed
        files may be identical, but the compressed files may differ if they
        include the date of creation). WinMerge applies the unpacker in all
        situations, and you are sure to have the same result when you compare
        folder, or when you merge two versions of a file.</para>
      </note>

      <para>Example plugin: <link
      linkend="DisplayXMLFiles"><filename>DisplayXMLFiles.dll</filename></link>
      (Display XML files nicely, by consistently inserting tabs and
      linebreaks.)</para>
    </sect3>

    <sect3>
      <title>比較前処理プラグイン - 差異を隠すためのファイル処理</title>

      <para>The plugin is not apply to the files displayed in the editor. It
      is applied only to temporary copies of the files, and this copies are
      then scanned to create the difference list.</para>

      <para>Example plugin: <link
      linkend="IgnoreColumns"><filename>IgnoreColumns.dll</filename></link>
      (Ignore the differences inside given columns, while displaying the
      characters in these columns.)</para>
    </sect3>
  </sect2>

  <sect2>
    <title>プラグインの選択と適用</title>

    <sect3>
      <title>"<guilabel>関連するプラグイン</guilabel>" と "<guilabel>自動展開
      </guilabel>"</title>

      <para>Each plugin specifies a list of file extensions (see plugins
      details for more info). When the file extension, either from the left or
      from the right file, matches the plugin list, the plugin is called
      "<guilabel>a suggested plugin</guilabel>".</para>

      <para>When "<guilabel>Automatic mode</guilabel>" is on, WinMerge
      searches for a suggested plugin and applies it if it is avaialble. When
      two suggested plugins are available for a file, WinMerge applies the
      first one only (alphabetical order).</para>

      <note>
        <para>"<guimenuitem>Automatic Unpacking</guimenuitem>" and
        "<guimenuitem>Auto prediffer</guimenuitem>" are two separate options.
        There is no option for editor complements.</para>
      </note>
    </sect3>

    <sect3>
      <title>フォルダビューでのエディタ補完プラグイン</title>

      <para><emphasis>Not available</emphasis></para>
    </sect3>

    <sect3>
      <title>エディタビューでのエディタ補完プラグイン</title>

      <para>Access list from <menuchoice>
          <guimenu>Edit</guimenu>

          <guisubmenu>Scripts</guisubmenu>

          <guimenuitem>...</guimenuitem>
        </menuchoice> in the main menu.</para>
    </sect3>

    <sect3>
      <title>フォルダビューでの展開プラグイン</title>

      <para>Check <menuchoice>
          <guimenu>Plugins</guimenu>

          <guimenuitem>Automatic Unpacking</guimenuitem>
        </menuchoice> in the main menu. You need to update the results
      (<keycap>F5</keycap>). Each file is loaded again with its suggested
      unpacker and compared.</para>
    </sect3>

    <sect3>
      <title>エディタビューでの展開プラグイン</title>

      <orderedlist>
        <listitem>
          <para>Open dialog: Select the two files first and then press the
          <guibutton>Select</guibutton> button right from the field
          "<guilabel>Unpacker</guilabel>". WinMerge displays the standard
          dialog for unpacker selection. Use the top combobox to select the
          plugin. Two generic choices "<guilabel>None</guilabel>" and
          "<guilabel>Automatic</guilabel>" are also available.</para>
        </listitem>

        <listitem>
          <para>From the folder view when <menuchoice>
              <guimenu>Plugins</guimenu>

              <guimenuitem>Automatic Unpacking</guimenuitem>
            </menuchoice> is checked: Just double click to open the file. The
          suggested plugin used during the folder comparison is used to load
          the file in the editor.</para>
        </listitem>

        <listitem>
          <para>From the folder view, always: Select one file, then main menu
          <menuchoice>
              <guimenu>Plugins</guimenu>

              <guimenuitem>Edit with Unpacker</guimenuitem>
            </menuchoice>. WinMerge displays the dialog for unpacker
          selection. Select an unpacker and press <guibutton>OK</guibutton>,
          WinMerge opens the editor view and applies this unpacker to load the
          file. This plugin is forgotten when you close the editor
          view.</para>
        </listitem>
      </orderedlist>
    </sect3>

    <sect3>
      <title>フォルダビューでの比較前処理プラグイン</title>

      <para>When the files are selected, right-click to open the context menu.
      Follow <menuchoice>
          <guimenu>Plugin Settings</guimenu>

          <guisubmenu>Prediffer Settings</guisubmenu>
        </menuchoice> and select "<guimenuitem>Auto prediffer</guimenuitem>"
      or "<guimenuitem>No prediffer</guimenuitem>". Refresh the view
      (<keycap>F5</keycap>) to update the results.</para>

      <note>
        <para>"<guimenuitem>Auto prediffer</guimenuitem>" is a per-file
        option. Some files in the same folder can be in mode "<guimenuitem>No
        prediffer</guimenuitem>" and some in mode "<guimenuitem>Auto
        prediffer</guimenuitem>". When you change folder during a
        non-recursive compare, the mode is always reset to "<guimenuitem>No
        prediffer</guimenuitem>".</para>
      </note>
    </sect3>

    <sect3>
      <title>エディタビューでの比較前処理プラグイン</title>

      <orderedlist>
        <listitem>
          <para>From the folder view when "<guimenuitem>Auto
          prediffer</guimenuitem>" is checked for a file: Just double click to
          open the file. The plugin used during the folder comparison is used
          in the editor before the diff algorithm.</para>
        </listitem>

        <listitem>
          <para>During an editor session, access prediffer lists with menu
          <menuchoice>
              <guimenu>Plugins</guimenu>

              <guisubmenu>Prediffer</guisubmenu>

              <guimenuitem>...</guimenuitem>
            </menuchoice>: The active prediffer is checked. Suggested plugins
          are indicated first above the not-suggested ones. The files are
          compared again after the selection, you don't need to rescan.</para>
        </listitem>
      </orderedlist>
    </sect3>
  </sect2>

  <sect2>
    <title>使用できるプラグイン</title>

    <sect3>
      <title><filename>CompareMSExcelFiles.dll</filename></title>

      <para>Displays the text content of a <trademark
      class="registered">Microsoft</trademark>
      <application>Excel</application> file, stripping away all formatting and
      embedded objects.</para>

      <para><segmentedlist>
          <segtitle>Categorie</segtitle>

          <segtitle>File filter</segtitle>

          <segtitle>Packing</segtitle>

          <segtitle>Requirement</segtitle>

          <seglistitem>
            <seg>Unpacker</seg>

            <seg><filename class="extension">*.xls</filename></seg>

            <seg>No</seg>

            <seg><trademark class="registered">Microsoft</trademark>
            <application>Excel</application>, <link
            linkend="MSVBVM60"><application>Visual Basic</application> runtime
            library</link></seg>
          </seglistitem>
        </segmentedlist></para>
    </sect3>

    <sect3>
      <title><filename>CompareMSWordFiles.dll</filename></title>

      <para>Displays the text content of a <trademark
      class="registered">Microsoft</trademark> <application>Word</application>
      file, stripping away all formatting and embedded objects.</para>

      <para><segmentedlist>
          <segtitle>Categorie</segtitle>

          <segtitle>File filter</segtitle>

          <segtitle>Packing</segtitle>

          <segtitle>Requirement</segtitle>

          <seglistitem>
            <seg>Unpacker</seg>

            <seg><filename class="extension">*.doc</filename>, <filename
            class="extension">*.dot</filename></seg>

            <seg>No</seg>

            <seg><trademark
            class="registered">Microsoft</trademark><application>Word</application>,
            <link linkend="MSVBVM60"><application>Visual Basic</application>
            runtime library</link></seg>
          </seglistitem>
        </segmentedlist></para>
    </sect3>

    <sect3 id="DisplayXMLFiles">
      <title><filename>DisplayXMLFiles.dll</filename></title>

      <para>This plugin display XML files nicely, by consistently inserting
      tabs and linebreaks. This is to fix XML files which do not have line
      returns in convenient locations.</para>

      <para><segmentedlist>
          <segtitle>Categorie</segtitle>

          <segtitle>File filter</segtitle>

          <segtitle>Packing</segtitle>

          <seglistitem>
            <seg>Unpacker</seg>

            <seg><filename class="extension">*.xml</filename></seg>

            <seg>No</seg>
          </seglistitem>
        </segmentedlist></para>
    </sect3>

    <sect3 id="EditorAddin">
      <title><filename>editor addin.sct</filename></title>

      <para>Add two functions to the <menuchoice>
          <guimenu>Edit</guimenu>

          <guisubmenu>Scripts</guisubmenu>
        </menuchoice> menu:</para>

      <itemizedlist>
        <listitem>
          <simpara><guimenuitem>MakeUpper</guimenuitem> convert the selection
          to UPPER CASE.</simpara>
        </listitem>

        <listitem>
          <simpara><guimenuitem>MakeLower</guimenuitem> convert the selection
          to lower case.</simpara>
        </listitem>
      </itemizedlist>

      <para><segmentedlist>
          <segtitle>Categorie</segtitle>

          <seglistitem>
            <seg>Editor complement</seg>
          </seglistitem>
        </segmentedlist></para>
    </sect3>

    <sect3 id="IgnoreColumns">
      <title><filename>IgnoreColumns.dll</filename></title>

      <para>The plugin ignore the characters at specified columns. It does not
      support files with tabulations (no crash, but all tabs will be treated
      as a normal character). The first column has number 1.</para>

      <para>For the parameters, you just need to rename the dll with the
      following syntax:</para>

      <itemizedlist>
        <listitem>
          <simpara>Delimiters between ranges: _ or ,</simpara>
        </listitem>

        <listitem>
          <simpara>Delimiters between min and max: <emphasis>anything
          else</emphasis></simpara>
        </listitem>

        <listitem>
          <simpara>Min and max are included.</simpara>
        </listitem>

        <listitem>
          <simpara>When max = min, max may be omitted.</simpara>
        </listitem>
      </itemizedlist>

      <example>
        <title><filename>IgnoreColumns.dll</filename> syntax</title>

        <variablelist>
          <varlistentry>
            <term><filename>IgnoreColumns _ 3 _ 10 - 20 _ 32 -
            33.dll</filename></term>

            <listitem>
              <simpara>Ignore all characters at column 3, and in columns 10 to
              20, and 32 to 33.</simpara>
            </listitem>
          </varlistentry>

          <varlistentry>
            <term><filename>IgnoreColumns_1,30 to 40.dll</filename></term>

            <listitem>
              <simpara>Ignore all the characters in column 1, and in columns
              30 to 40.</simpara>
            </listitem>
          </varlistentry>
        </variablelist>
      </example>

      <para><segmentedlist>
          <segtitle>Categorie</segtitle>

          <segtitle>File filter</segtitle>

          <seglistitem>
            <seg>Prediffer</seg>

            <seg><filename class="extension">*.txt</filename></seg>
          </seglistitem>
        </segmentedlist></para>
    </sect3>

    <sect3>
      <title><filename>IgnoreCommentsC.dll</filename></title>

      <para>The plugin ignores comments (<constant>//</constant>... and
      <constant>/*</constant> ... <constant>*/</constant>) in C, C++, PHP and
      JavaScript files.</para>

      <para><segmentedlist>
          <segtitle>Categorie</segtitle>

          <segtitle>File filter</segtitle>

          <seglistitem>
            <seg>Prediffer</seg>

            <seg><filename class="extension">*.cpp</filename>, <filename
            class="extension">*.cxx</filename>, <filename
            class="extension">*.h</filename>, <filename
            class="extension">*.hxx</filename>, <filename
            class="extension">*.c</filename>, <filename
            class="extension">*.php</filename>, <filename
            class="extension">*.js</filename>,</seg>
          </seglistitem>
        </segmentedlist></para>
    </sect3>

    <sect3>
      <title><filename>IgnoreFieldsComma.dll</filename></title>

      <para>The plugin is for files with fields and <emphasis>comma</emphasis>
      as delimiters (CSV files for example). It ignore the characters in the
      specified fields. First field has number 1.</para>

      <para>Modify the filename to specify the fields. See <link
      linkend="IgnoreColumns">IgnoreColumns.dll</link> for the syntax.</para>

      <para><segmentedlist>
          <segtitle>Categorie</segtitle>

          <segtitle>File filter</segtitle>

          <seglistitem>
            <seg>Prediffer</seg>

            <seg><filename class="extension">*.csv</filename></seg>
          </seglistitem>
        </segmentedlist></para>
    </sect3>

    <sect3>
      <title><filename>IgnoreFieldsTab.dll</filename></title>

      <para>The plugin is for files with fields and
      <emphasis>tabulations</emphasis> as delimiters
      (<application>Excel</application> files saved in format <filename
      class="extension">*.txt</filename> for example). It ignore the
      characters in the specified fields. First field has number 1.</para>

      <para>Modify the filename to specify the fields. See <link
      linkend="IgnoreColumns">IgnoreColumns.dll</link> for the syntax.</para>

      <para><segmentedlist>
          <segtitle>Categorie</segtitle>

          <segtitle>File filter</segtitle>

          <seglistitem>
            <seg>Prediffer</seg>

            <seg><filename class="extension">*.txt</filename></seg>
          </seglistitem>
        </segmentedlist></para>
    </sect3>

    <sect3>
      <title><filename>IgnoreLeadingLineNumbers.dll</filename></title>

      <para>This plugin ignores the leading line numbers in text files (for
      example NC and BASIC files).</para>

      <para><segmentedlist>
          <segtitle>Categorie</segtitle>

          <segtitle>File filter</segtitle>

          <segtitle>Requirement</segtitle>

          <seglistitem>
            <seg>Prediffer</seg>

            <seg><filename class="extension">*.nc</filename></seg>

            <seg><link linkend="MSVBVM60"><application>Visual
            Basic</application> runtime library</link></seg>
          </seglistitem>
        </segmentedlist></para>
    </sect3>

    <sect3>
      <title><filename>insert datetime.sct</filename></title>

      <para>Add two functions to the <menuchoice>
          <guimenu>Edit</guimenu>

          <guisubmenu>Scripts</guisubmenu>
        </menuchoice> menu:</para>

      <itemizedlist>
        <listitem>
          <simpara><guimenuitem>InsertDate</guimenuitem> insert date in the
          current locale format.</simpara>
        </listitem>

        <listitem>
          <simpara><guimenuitem>InsertTime</guimenuitem> insert time in the
          current locale format.</simpara>
        </listitem>
      </itemizedlist>

      <para><segmentedlist>
          <segtitle>Categorie</segtitle>

          <seglistitem>
            <seg>Editor complement</seg>
          </seglistitem>
        </segmentedlist></para>
    </sect3>

    <sect3>
      <title><filename>RCLocalizationHelper.dll</filename>,
      <filename>RCLocalizationHelperU.dll</filename></title>

      <para>The plugin preprocesses RC files by stripping out localized
      strings, to enable comparing differnt language versions of the same RC
      file and ignoring the translations.</para>

      <para><filename>RCLocalizationHelperU.dll</filename> is the Unicode
      version.</para>

      <para><segmentedlist>
          <segtitle>Categorie</segtitle>

          <segtitle>File filter</segtitle>

          <seglistitem>
            <seg>Prediffer</seg>

            <seg><filename class="extension">*.rc</filename></seg>
          </seglistitem>
        </segmentedlist></para>
    </sect3>

    <sect3>
      <title><filename>WatchBeginningOfLog.dll</filename>,
      <filename>WatchEndOfLog.dll</filename></title>

      <para>For long LOG files, the user is often interested only in the first
      lines or in the last lines.</para>

      <itemizedlist>
        <listitem>
          <simpara><filename>WatchBeginningOfLog.dll</filename> truncates the
          files to the first 1/10th.</simpara>
        </listitem>

        <listitem>
          <simpara><filename>WatchEndOfLog.dll</filename> truncates the files
          to the first 1/10th.</simpara>
        </listitem>
      </itemizedlist>

      <para><segmentedlist>
          <segtitle>Categorie</segtitle>

          <segtitle>File filter</segtitle>

          <segtitle>Packing</segtitle>

          <seglistitem>
            <seg>Unpacker</seg>

            <seg><filename class="extension">*.log</filename></seg>

            <seg>No</seg>
          </seglistitem>
        </segmentedlist></para>

      <para>Developers may find information and code of examples in the source
      package, under the folder "<filename
      class="directory">Plugins</filename>".</para>
    </sect3>
  </sect2>

  <sect2>
    <title>必要なもの</title>

    <sect3>
      <title>Windows Script Host</title>

      <para>Some editor complements need this optional component from
      <trademark class="registered">Microsoft</trademark>.</para>

      <para>If the list of editor complements does not present all editor
      plugins, this component is probably missing. You can check easily.
      WinMerge informs you with a comment at the bottom of the list. You may
      install WSH on any version of Windows (need IE 4.0). Download it from
      <ulink
      url="http://msdn.microsoft.com/library/default.asp?url=/downloads/list/webdev.asp">MSDN
      Library</ulink>.</para>
    </sect3>

    <sect3 id="MSVBVM60">
      <title><application>Visual Basic</application> ランタイムライブラリ</title>

      <para>Some plugins require <application>Visual Basic</application>
      runtime library to work.</para>

      <para>You can download the required file <filename><ulink
      url="http://www.dll-files.com/dllindex/dll-files.shtml?msvbvm60">msvbvm60.dll</ulink></filename>
      or use the <ulink
      url="http://www.microsoft.com/downloads/details.aspx?familyid=7b9ba261-7a9c-43e7-9117-f673077ffb3c">Run-Time
      Redistribution Pack</ulink> from <trademark
      class="registered">Microsoft</trademark>. If you don't need the plugin,
      you can safely remove it.</para>
    </sect3>
  </sect2>
</sect1>
