diff --git a/IntChecker2.sln b/IntChecker2.sln index 9875cd2..e54671c 100644 --- a/IntChecker2.sln +++ b/IntChecker2.sln @@ -1,50 +1,32 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.32510.428 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IntChecker2", "source\IntChecker2.vcxproj", "{575E3215-DAD6-4B44-8231-C7D53D25BE82}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rhash", "depends\rhash\rhash.vcxproj", "{66FEB52E-3624-4806-B018-02DAD5CF59DF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug-Far2|Win32 = Debug-Far2|Win32 - Debug-Far2|x64 = Debug-Far2|x64 Debug-Far3|Win32 = Debug-Far3|Win32 Debug-Far3|x64 = Debug-Far3|x64 - Release-Far2|Win32 = Release-Far2|Win32 - Release-Far2|x64 = Release-Far2|x64 Release-Far3|Win32 = Release-Far3|Win32 Release-Far3|x64 = Release-Far3|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Debug-Far2|Win32.ActiveCfg = Debug-Far2|Win32 - {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Debug-Far2|Win32.Build.0 = Debug-Far2|Win32 - {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Debug-Far2|x64.ActiveCfg = Debug-Far2|x64 - {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Debug-Far2|x64.Build.0 = Debug-Far2|x64 {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Debug-Far3|Win32.ActiveCfg = Debug-Far3|Win32 {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Debug-Far3|Win32.Build.0 = Debug-Far3|Win32 {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Debug-Far3|x64.ActiveCfg = Debug-Far3|x64 {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Debug-Far3|x64.Build.0 = Debug-Far3|x64 - {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Release-Far2|Win32.ActiveCfg = Release-Far2|Win32 - {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Release-Far2|Win32.Build.0 = Release-Far2|Win32 - {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Release-Far2|x64.ActiveCfg = Release-Far2|x64 - {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Release-Far2|x64.Build.0 = Release-Far2|x64 {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Release-Far3|Win32.ActiveCfg = Release-Far3|Win32 {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Release-Far3|Win32.Build.0 = Release-Far3|Win32 {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Release-Far3|x64.ActiveCfg = Release-Far3|x64 {575E3215-DAD6-4B44-8231-C7D53D25BE82}.Release-Far3|x64.Build.0 = Release-Far3|x64 - {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Debug-Far2|Win32.ActiveCfg = Debug-Far2|Win32 - {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Debug-Far2|Win32.Build.0 = Debug-Far2|Win32 - {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Debug-Far2|x64.ActiveCfg = Debug-Far2|x64 - {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Debug-Far2|x64.Build.0 = Debug-Far2|x64 {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Debug-Far3|Win32.ActiveCfg = Debug-Far3|Win32 {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Debug-Far3|Win32.Build.0 = Debug-Far3|Win32 {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Debug-Far3|x64.ActiveCfg = Debug-Far3|x64 {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Debug-Far3|x64.Build.0 = Debug-Far3|x64 - {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Release-Far2|Win32.ActiveCfg = Release-Far2|Win32 - {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Release-Far2|Win32.Build.0 = Release-Far2|Win32 - {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Release-Far2|x64.ActiveCfg = Release-Far2|x64 - {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Release-Far2|x64.Build.0 = Release-Far2|x64 {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Release-Far3|Win32.ActiveCfg = Release-Far3|Win32 {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Release-Far3|Win32.Build.0 = Release-Far3|Win32 {66FEB52E-3624-4806-B018-02DAD5CF59DF}.Release-Far3|x64.ActiveCfg = Release-Far3|x64 @@ -53,4 +35,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5DD68ECA-C76B-4802-835D-919C9AD59523} + EndGlobalSection EndGlobal diff --git a/depends/far2/farcolor.hpp b/depends/far2/farcolor.hpp deleted file mode 100644 index 780c4f5..0000000 --- a/depends/far2/farcolor.hpp +++ /dev/null @@ -1,221 +0,0 @@ -#pragma once -#ifndef __COLORS_HPP__ -#define __COLORS_HPP__ -/* - farcolor.hpp - - Colors Index for FAR Manager 2.0 build 1807 - HKCU\Software\Far\Colors\CurrentPalette -*/ - -/* -Copyright (c) 1996 Eugene Roshal -Copyright (c) 2000 Far Group -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the authors may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -EXCEPTION: -Far Manager plugins that use this header file can be distributed under any -other possible license with no implications from the above license on them. -*/ - - -enum PaletteColors -{ - COL_MENUTEXT, - COL_MENUSELECTEDTEXT, - COL_MENUHIGHLIGHT, - COL_MENUSELECTEDHIGHLIGHT, - COL_MENUBOX, - COL_MENUTITLE, - - COL_HMENUTEXT, - COL_HMENUSELECTEDTEXT, - COL_HMENUHIGHLIGHT, - COL_HMENUSELECTEDHIGHLIGHT, - - COL_PANELTEXT, - COL_PANELSELECTEDTEXT, - COL_PANELHIGHLIGHTTEXT, - COL_PANELINFOTEXT, - COL_PANELCURSOR, - COL_PANELSELECTEDCURSOR, - COL_PANELTITLE, - COL_PANELSELECTEDTITLE, - COL_PANELCOLUMNTITLE, - COL_PANELTOTALINFO, - COL_PANELSELECTEDINFO, - - COL_DIALOGTEXT, - COL_DIALOGHIGHLIGHTTEXT, - COL_DIALOGBOX, - COL_DIALOGBOXTITLE, - COL_DIALOGHIGHLIGHTBOXTITLE, - COL_DIALOGEDIT, - COL_DIALOGBUTTON, - COL_DIALOGSELECTEDBUTTON, - COL_DIALOGHIGHLIGHTBUTTON, - COL_DIALOGHIGHLIGHTSELECTEDBUTTON, - - COL_DIALOGLISTTEXT, - COL_DIALOGLISTSELECTEDTEXT, - COL_DIALOGLISTHIGHLIGHT, - COL_DIALOGLISTSELECTEDHIGHLIGHT, - - COL_WARNDIALOGTEXT, - COL_WARNDIALOGHIGHLIGHTTEXT, - COL_WARNDIALOGBOX, - COL_WARNDIALOGBOXTITLE, - COL_WARNDIALOGHIGHLIGHTBOXTITLE, - COL_WARNDIALOGEDIT, - COL_WARNDIALOGBUTTON, - COL_WARNDIALOGSELECTEDBUTTON, - COL_WARNDIALOGHIGHLIGHTBUTTON, - COL_WARNDIALOGHIGHLIGHTSELECTEDBUTTON, - - COL_KEYBARNUM, - COL_KEYBARTEXT, - COL_KEYBARBACKGROUND, - - COL_COMMANDLINE, - - COL_CLOCK, - - COL_VIEWERTEXT, - COL_VIEWERSELECTEDTEXT, - COL_VIEWERSTATUS, - - COL_EDITORTEXT, - COL_EDITORSELECTEDTEXT, - COL_EDITORSTATUS, - - COL_HELPTEXT, - COL_HELPHIGHLIGHTTEXT, - COL_HELPTOPIC, - COL_HELPSELECTEDTOPIC, - COL_HELPBOX, - COL_HELPBOXTITLE, - - COL_PANELDRAGTEXT, - COL_DIALOGEDITUNCHANGED, - COL_PANELSCROLLBAR, - COL_HELPSCROLLBAR, - COL_PANELBOX, - COL_PANELSCREENSNUMBER, - COL_DIALOGEDITSELECTED, - COL_COMMANDLINESELECTED, - COL_VIEWERARROWS, - - COL_RESERVED0, - - COL_DIALOGLISTSCROLLBAR, - COL_MENUSCROLLBAR, - COL_VIEWERSCROLLBAR, - COL_COMMANDLINEPREFIX, - COL_DIALOGDISABLED, - COL_DIALOGEDITDISABLED, - COL_DIALOGLISTDISABLED, - COL_WARNDIALOGDISABLED, - COL_WARNDIALOGEDITDISABLED, - COL_WARNDIALOGLISTDISABLED, - - COL_MENUDISABLEDTEXT, - - COL_EDITORCLOCK, - COL_VIEWERCLOCK, - - COL_DIALOGLISTTITLE, - COL_DIALOGLISTBOX, - - COL_WARNDIALOGEDITSELECTED, - COL_WARNDIALOGEDITUNCHANGED, - - COL_DIALOGCOMBOTEXT, - COL_DIALOGCOMBOSELECTEDTEXT, - COL_DIALOGCOMBOHIGHLIGHT, - COL_DIALOGCOMBOSELECTEDHIGHLIGHT, - COL_DIALOGCOMBOBOX, - COL_DIALOGCOMBOTITLE, - COL_DIALOGCOMBODISABLED, - COL_DIALOGCOMBOSCROLLBAR, - - COL_WARNDIALOGLISTTEXT, - COL_WARNDIALOGLISTSELECTEDTEXT, - COL_WARNDIALOGLISTHIGHLIGHT, - COL_WARNDIALOGLISTSELECTEDHIGHLIGHT, - COL_WARNDIALOGLISTBOX, - COL_WARNDIALOGLISTTITLE, - COL_WARNDIALOGLISTSCROLLBAR, - - COL_WARNDIALOGCOMBOTEXT, - COL_WARNDIALOGCOMBOSELECTEDTEXT, - COL_WARNDIALOGCOMBOHIGHLIGHT, - COL_WARNDIALOGCOMBOSELECTEDHIGHLIGHT, - COL_WARNDIALOGCOMBOBOX, - COL_WARNDIALOGCOMBOTITLE, - COL_WARNDIALOGCOMBODISABLED, - COL_WARNDIALOGCOMBOSCROLLBAR, - - COL_DIALOGLISTARROWS, - COL_DIALOGLISTARROWSDISABLED, - COL_DIALOGLISTARROWSSELECTED, - COL_DIALOGCOMBOARROWS, - COL_DIALOGCOMBOARROWSDISABLED, - COL_DIALOGCOMBOARROWSSELECTED, - COL_WARNDIALOGLISTARROWS, - COL_WARNDIALOGLISTARROWSDISABLED, - COL_WARNDIALOGLISTARROWSSELECTED, - COL_WARNDIALOGCOMBOARROWS, - COL_WARNDIALOGCOMBOARROWSDISABLED, - COL_WARNDIALOGCOMBOARROWSSELECTED, - COL_MENUARROWS, - COL_MENUARROWSDISABLED, - COL_MENUARROWSSELECTED, - COL_COMMANDLINEUSERSCREEN, - COL_EDITORSCROLLBAR, - - COL_MENUGRAYTEXT, - COL_MENUSELECTEDGRAYTEXT, - COL_DIALOGCOMBOGRAY, - COL_DIALOGCOMBOSELECTEDGRAYTEXT, - COL_DIALOGLISTGRAY, - COL_DIALOGLISTSELECTEDGRAYTEXT, - COL_WARNDIALOGCOMBOGRAY, - COL_WARNDIALOGCOMBOSELECTEDGRAYTEXT, - COL_WARNDIALOGLISTGRAY, - COL_WARNDIALOGLISTSELECTEDGRAYTEXT, - - COL_DIALOGDEFAULTBUTTON, - COL_DIALOGSELECTEDDEFAULTBUTTON, - COL_DIALOGHIGHLIGHTDEFAULTBUTTON, - COL_DIALOGHIGHLIGHTSELECTEDDEFAULTBUTTON, - COL_WARNDIALOGDEFAULTBUTTON, - COL_WARNDIALOGSELECTEDDEFAULTBUTTON, - COL_WARNDIALOGHIGHLIGHTDEFAULTBUTTON, - COL_WARNDIALOGHIGHLIGHTSELECTEDDEFAULTBUTTON, - - COL_LASTPALETTECOLOR -}; - -#endif // __COLORS_HPP__ diff --git a/depends/far2/farkeys.hpp b/depends/far2/farkeys.hpp deleted file mode 100644 index 4904973..0000000 --- a/depends/far2/farkeys.hpp +++ /dev/null @@ -1,706 +0,0 @@ -#pragma once -#ifndef __FARKEYS_HPP__ -#define __FARKEYS_HPP__ -/* - farkeys.hpp - - Inside KeyName for FAR Manager 2.0 build 1807 -*/ - -/* -Copyright (c) 1996 Eugene Roshal -Copyright (c) 2000 Far Group -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the authors may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -EXCEPTION: -Far Manager plugins that use this header file can be distributed under any -other possible license with no implications from the above license on them. -*/ - -#define EXTENDED_KEY_BASE 0x00010000 -#define INTERNAL_KEY_BASE 0x00020000 -#define INTERNAL_KEY_BASE_2 0x00030000 - -enum BaseDefKeyboard -{ - KEY_CTRLMASK =0xFFF00000, - KEY_CTRL =0x01000000, - KEY_ALT =0x02000000, - KEY_SHIFT =0x04000000, - // - KEY_RCTRL =0x10000000, - KEY_RALT =0x20000000, - - KEY_BRACKET ='[', - KEY_BACKBRACKET =']', - KEY_COMMA =',', - KEY_QUOTE ='"', - KEY_DOT ='.', - KEY_SLASH ='/', - KEY_COLON =':', - KEY_SEMICOLON =';', - KEY_BACKSLASH ='\\', - - KEY_BS =0x00000008, - KEY_TAB =0x00000009, - KEY_ENTER =0x0000000D, - KEY_ESC =0x0000001B, - KEY_SPACE =0x00000020, - - KEY_MASKF =0x0001FFFF, - - KEY_FKEY_BEGIN =EXTENDED_KEY_BASE, - - KEY_BREAK =EXTENDED_KEY_BASE+VK_CANCEL, - - KEY_PAUSE =EXTENDED_KEY_BASE+VK_PAUSE, - KEY_CAPSLOCK =EXTENDED_KEY_BASE+VK_CAPITAL, - - KEY_PGUP =EXTENDED_KEY_BASE+VK_PRIOR, - KEY_PGDN =EXTENDED_KEY_BASE+VK_NEXT, - KEY_END =EXTENDED_KEY_BASE+VK_END, - KEY_HOME =EXTENDED_KEY_BASE+VK_HOME, - KEY_LEFT =EXTENDED_KEY_BASE+VK_LEFT, - KEY_UP =EXTENDED_KEY_BASE+VK_UP, - KEY_RIGHT =EXTENDED_KEY_BASE+VK_RIGHT, - KEY_DOWN =EXTENDED_KEY_BASE+VK_DOWN, - KEY_PRNTSCRN =EXTENDED_KEY_BASE+VK_SNAPSHOT, - KEY_INS =EXTENDED_KEY_BASE+VK_INSERT, - KEY_DEL =EXTENDED_KEY_BASE+VK_DELETE, - - KEY_LWIN =EXTENDED_KEY_BASE+VK_LWIN, - KEY_RWIN =EXTENDED_KEY_BASE+VK_RWIN, - KEY_APPS =EXTENDED_KEY_BASE+VK_APPS, - KEY_STANDBY =EXTENDED_KEY_BASE+VK_SLEEP, - - KEY_NUMPAD0 =EXTENDED_KEY_BASE+VK_NUMPAD0, - KEY_NUMPAD1 =EXTENDED_KEY_BASE+VK_NUMPAD1, - KEY_NUMPAD2 =EXTENDED_KEY_BASE+VK_NUMPAD2, - KEY_NUMPAD3 =EXTENDED_KEY_BASE+VK_NUMPAD3, - KEY_NUMPAD4 =EXTENDED_KEY_BASE+VK_NUMPAD4, - KEY_NUMPAD5 =EXTENDED_KEY_BASE+VK_NUMPAD5, - KEY_CLEAR =KEY_NUMPAD5, - KEY_NUMPAD6 =EXTENDED_KEY_BASE+VK_NUMPAD6, - KEY_NUMPAD7 =EXTENDED_KEY_BASE+VK_NUMPAD7, - KEY_NUMPAD8 =EXTENDED_KEY_BASE+VK_NUMPAD8, - KEY_NUMPAD9 =EXTENDED_KEY_BASE+VK_NUMPAD9, - - KEY_MULTIPLY =EXTENDED_KEY_BASE+VK_MULTIPLY, - KEY_ADD =EXTENDED_KEY_BASE+VK_ADD, - KEY_SUBTRACT =EXTENDED_KEY_BASE+VK_SUBTRACT, - KEY_DECIMAL =EXTENDED_KEY_BASE+VK_DECIMAL, - KEY_DIVIDE =EXTENDED_KEY_BASE+VK_DIVIDE, - - KEY_F1 =EXTENDED_KEY_BASE+VK_F1, - KEY_F2 =EXTENDED_KEY_BASE+VK_F2, - KEY_F3 =EXTENDED_KEY_BASE+VK_F3, - KEY_F4 =EXTENDED_KEY_BASE+VK_F4, - KEY_F5 =EXTENDED_KEY_BASE+VK_F5, - KEY_F6 =EXTENDED_KEY_BASE+VK_F6, - KEY_F7 =EXTENDED_KEY_BASE+VK_F7, - KEY_F8 =EXTENDED_KEY_BASE+VK_F8, - KEY_F9 =EXTENDED_KEY_BASE+VK_F9, - KEY_F10 =EXTENDED_KEY_BASE+VK_F10, - KEY_F11 =EXTENDED_KEY_BASE+VK_F11, - KEY_F12 =EXTENDED_KEY_BASE+VK_F12, - - KEY_F13 =EXTENDED_KEY_BASE+VK_F13, - KEY_F14 =EXTENDED_KEY_BASE+VK_F14, - KEY_F15 =EXTENDED_KEY_BASE+VK_F15, - KEY_F16 =EXTENDED_KEY_BASE+VK_F16, - KEY_F17 =EXTENDED_KEY_BASE+VK_F17, - KEY_F18 =EXTENDED_KEY_BASE+VK_F18, - KEY_F19 =EXTENDED_KEY_BASE+VK_F19, - KEY_F20 =EXTENDED_KEY_BASE+VK_F20, - KEY_F21 =EXTENDED_KEY_BASE+VK_F21, - KEY_F22 =EXTENDED_KEY_BASE+VK_F22, - KEY_F23 =EXTENDED_KEY_BASE+VK_F23, - KEY_F24 =EXTENDED_KEY_BASE+VK_F24, - - KEY_NUMLOCK =EXTENDED_KEY_BASE+VK_NUMLOCK, - KEY_SCROLLLOCK =EXTENDED_KEY_BASE+VK_SCROLL, - -#if (_WIN32_WINNT >= 0x0500) - KEY_BROWSER_BACK =EXTENDED_KEY_BASE+VK_BROWSER_BACK, - KEY_BROWSER_FORWARD =EXTENDED_KEY_BASE+VK_BROWSER_FORWARD, - KEY_BROWSER_REFRESH =EXTENDED_KEY_BASE+VK_BROWSER_REFRESH, - KEY_BROWSER_STOP =EXTENDED_KEY_BASE+VK_BROWSER_STOP, - KEY_BROWSER_SEARCH =EXTENDED_KEY_BASE+VK_BROWSER_SEARCH, - KEY_BROWSER_FAVORITES =EXTENDED_KEY_BASE+VK_BROWSER_FAVORITES, - KEY_BROWSER_HOME =EXTENDED_KEY_BASE+VK_BROWSER_HOME, - KEY_VOLUME_MUTE =EXTENDED_KEY_BASE+VK_VOLUME_MUTE, - KEY_VOLUME_DOWN =EXTENDED_KEY_BASE+VK_VOLUME_DOWN, - KEY_VOLUME_UP =EXTENDED_KEY_BASE+VK_VOLUME_UP, - KEY_MEDIA_NEXT_TRACK =EXTENDED_KEY_BASE+VK_MEDIA_NEXT_TRACK, - KEY_MEDIA_PREV_TRACK =EXTENDED_KEY_BASE+VK_MEDIA_PREV_TRACK, - KEY_MEDIA_STOP =EXTENDED_KEY_BASE+VK_MEDIA_STOP, - KEY_MEDIA_PLAY_PAUSE =EXTENDED_KEY_BASE+VK_MEDIA_PLAY_PAUSE, - KEY_LAUNCH_MAIL =EXTENDED_KEY_BASE+VK_LAUNCH_MAIL, - KEY_LAUNCH_MEDIA_SELECT =EXTENDED_KEY_BASE+VK_LAUNCH_MEDIA_SELECT, - KEY_LAUNCH_APP1 =EXTENDED_KEY_BASE+VK_LAUNCH_APP1, - KEY_LAUNCH_APP2 =EXTENDED_KEY_BASE+VK_LAUNCH_APP2, -#endif - - KEY_CTRLALTSHIFTPRESS =INTERNAL_KEY_BASE+1, - KEY_CTRLALTSHIFTRELEASE =INTERNAL_KEY_BASE+2, - - KEY_MSWHEEL_UP =INTERNAL_KEY_BASE+3, - KEY_MSWHEEL_DOWN =INTERNAL_KEY_BASE+4, - KEY_NUMDEL =INTERNAL_KEY_BASE+9, - KEY_NUMENTER =INTERNAL_KEY_BASE+0xB, - - KEY_MSWHEEL_LEFT =INTERNAL_KEY_BASE+0xC, - KEY_MSWHEEL_RIGHT =INTERNAL_KEY_BASE+0xD, - - KEY_MSLCLICK =INTERNAL_KEY_BASE+0xF, - KEY_MSRCLICK =INTERNAL_KEY_BASE+0x10, - - KEY_MSM1CLICK =INTERNAL_KEY_BASE+0x11, - KEY_MSM2CLICK =INTERNAL_KEY_BASE+0x12, - KEY_MSM3CLICK =INTERNAL_KEY_BASE+0x13, - - - - KEY_VK_0xFF_BEGIN =EXTENDED_KEY_BASE+0x00000100, - KEY_VK_0xFF_END =EXTENDED_KEY_BASE+0x000001FF, - - KEY_END_FKEY =0x0001FFFF, - - KEY_NONE =INTERNAL_KEY_BASE_2+1, - KEY_IDLE =INTERNAL_KEY_BASE_2+2, - - KEY_KILLFOCUS =INTERNAL_KEY_BASE_2+6, - KEY_GOTFOCUS =INTERNAL_KEY_BASE_2+7, - KEY_CONSOLE_BUFFER_RESIZE=INTERNAL_KEY_BASE_2+8, - - - KEY_END_SKEY =0x0003FFFF, - KEY_LAST_BASE =KEY_END_SKEY, - -}; - -enum AddDefKeyboard -{ - KEY_CTRLSHIFT =KEY_CTRL|KEY_SHIFT, - KEY_ALTSHIFT =KEY_ALT|KEY_SHIFT, - KEY_CTRLALT =KEY_CTRL|KEY_ALT, - - KEY_CTRL0 =KEY_CTRL+'0', - KEY_CTRL1 =KEY_CTRL+'1', - KEY_CTRL2 =KEY_CTRL+'2', - KEY_CTRL3 =KEY_CTRL+'3', - KEY_CTRL4 =KEY_CTRL+'4', - KEY_CTRL5 =KEY_CTRL+'5', - KEY_CTRL6 =KEY_CTRL+'6', - KEY_CTRL7 =KEY_CTRL+'7', - KEY_CTRL8 =KEY_CTRL+'8', - KEY_CTRL9 =KEY_CTRL+'9', - - KEY_RCTRL0 =KEY_RCTRL+'0', - KEY_RCTRL1 =KEY_RCTRL+'1', - KEY_RCTRL2 =KEY_RCTRL+'2', - KEY_RCTRL3 =KEY_RCTRL+'3', - KEY_RCTRL4 =KEY_RCTRL+'4', - KEY_RCTRL5 =KEY_RCTRL+'5', - KEY_RCTRL6 =KEY_RCTRL+'6', - KEY_RCTRL7 =KEY_RCTRL+'7', - KEY_RCTRL8 =KEY_RCTRL+'8', - KEY_RCTRL9 =KEY_RCTRL+'9', - - KEY_CTRLA =KEY_CTRL+'A', - KEY_CTRLB =KEY_CTRL+'B', - KEY_CTRLC =KEY_CTRL+'C', - KEY_CTRLD =KEY_CTRL+'D', - KEY_CTRLE =KEY_CTRL+'E', - KEY_CTRLF =KEY_CTRL+'F', - KEY_CTRLG =KEY_CTRL+'G', - KEY_CTRLH =KEY_CTRL+'H', - KEY_CTRLI =KEY_CTRL+'I', - KEY_CTRLJ =KEY_CTRL+'J', - KEY_CTRLK =KEY_CTRL+'K', - KEY_CTRLL =KEY_CTRL+'L', - KEY_CTRLM =KEY_CTRL+'M', - KEY_CTRLN =KEY_CTRL+'N', - KEY_CTRLO =KEY_CTRL+'O', - KEY_CTRLP =KEY_CTRL+'P', - KEY_CTRLQ =KEY_CTRL+'Q', - KEY_CTRLR =KEY_CTRL+'R', - KEY_CTRLS =KEY_CTRL+'S', - KEY_CTRLT =KEY_CTRL+'T', - KEY_CTRLU =KEY_CTRL+'U', - KEY_CTRLV =KEY_CTRL+'V', - KEY_CTRLW =KEY_CTRL+'W', - KEY_CTRLX =KEY_CTRL+'X', - KEY_CTRLY =KEY_CTRL+'Y', - KEY_CTRLZ =KEY_CTRL+'Z', - - KEY_CTRLBRACKET =KEY_CTRL|KEY_BRACKET, - KEY_CTRLBACKBRACKET =KEY_CTRL|KEY_BACKBRACKET, - KEY_CTRLCOMMA =KEY_CTRL|KEY_COMMA, - KEY_CTRLQUOTE =KEY_CTRL|KEY_QUOTE, - KEY_CTRLDOT =KEY_CTRL|KEY_DOT, - - KEY_ALT0 =KEY_ALT+'0', - KEY_ALT1 =KEY_ALT+'1', - KEY_ALT2 =KEY_ALT+'2', - KEY_ALT3 =KEY_ALT+'3', - KEY_ALT4 =KEY_ALT+'4', - KEY_ALT5 =KEY_ALT+'5', - KEY_ALT6 =KEY_ALT+'6', - KEY_ALT7 =KEY_ALT+'7', - KEY_ALT8 =KEY_ALT+'8', - KEY_ALT9 =KEY_ALT+'9', - - KEY_ALTADD =KEY_ALT|KEY_ADD, - KEY_ALTDOT =KEY_ALT|KEY_DOT, - KEY_ALTCOMMA =KEY_ALT|KEY_COMMA, - KEY_ALTMULTIPLY =KEY_ALT|KEY_MULTIPLY, - - KEY_ALTA =KEY_ALT+'A', - KEY_ALTB =KEY_ALT+'B', - KEY_ALTC =KEY_ALT+'C', - KEY_ALTD =KEY_ALT+'D', - KEY_ALTE =KEY_ALT+'E', - KEY_ALTF =KEY_ALT+'F', - KEY_ALTG =KEY_ALT+'G', - KEY_ALTH =KEY_ALT+'H', - KEY_ALTI =KEY_ALT+'I', - KEY_ALTJ =KEY_ALT+'J', - KEY_ALTK =KEY_ALT+'K', - KEY_ALTL =KEY_ALT+'L', - KEY_ALTM =KEY_ALT+'M', - KEY_ALTN =KEY_ALT+'N', - KEY_ALTO =KEY_ALT+'O', - KEY_ALTP =KEY_ALT+'P', - KEY_ALTQ =KEY_ALT+'Q', - KEY_ALTR =KEY_ALT+'R', - KEY_ALTS =KEY_ALT+'S', - KEY_ALTT =KEY_ALT+'T', - KEY_ALTU =KEY_ALT+'U', - KEY_ALTV =KEY_ALT+'V', - KEY_ALTW =KEY_ALT+'W', - KEY_ALTX =KEY_ALT+'X', - KEY_ALTY =KEY_ALT+'Y', - KEY_ALTZ =KEY_ALT+'Z', - - KEY_CTRLSHIFTADD =KEY_CTRL|KEY_SHIFT|KEY_ADD, - KEY_CTRLSHIFTSUBTRACT =KEY_CTRL|KEY_SHIFT|KEY_SUBTRACT, - KEY_CTRLSHIFTDOT =KEY_CTRL|KEY_SHIFT|KEY_DOT, - KEY_CTRLSHIFTSLASH =KEY_CTRL|KEY_SHIFT|KEY_SLASH, - - KEY_CTRLSHIFT0 =(KEY_CTRL|KEY_SHIFT)+'0', - KEY_CTRLSHIFT1 =(KEY_CTRL|KEY_SHIFT)+'1', - KEY_CTRLSHIFT2 =(KEY_CTRL|KEY_SHIFT)+'2', - KEY_CTRLSHIFT3 =(KEY_CTRL|KEY_SHIFT)+'3', - KEY_CTRLSHIFT4 =(KEY_CTRL|KEY_SHIFT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(KEY_ALT|KEY_SHIFT)+'W', - KEY_ALTSHIFTX =(KEY_ALT|KEY_SHIFT)+'X', - KEY_ALTSHIFTY =(KEY_ALT|KEY_SHIFT)+'Y', - KEY_ALTSHIFTZ =(KEY_ALT|KEY_SHIFT)+'Z', - - KEY_ALTSHIFTBRACKET =KEY_ALT|KEY_SHIFT|KEY_BRACKET, - KEY_ALTSHIFTBACKBRACKET =KEY_ALT|KEY_SHIFT|KEY_BACKBRACKET, - - KEY_CTRLALT0 =(KEY_CTRL|KEY_ALT)+'0', - KEY_CTRLALT1 =(KEY_CTRL|KEY_ALT)+'1', - KEY_CTRLALT2 =(KEY_CTRL|KEY_ALT)+'2', - KEY_CTRLALT3 =(KEY_CTRL|KEY_ALT)+'3', - KEY_CTRLALT4 =(KEY_CTRL|KEY_ALT)+'4', - KEY_CTRLALT5 =(KEY_CTRL|KEY_ALT)+'5', - KEY_CTRLALT6 =(KEY_CTRL|KEY_ALT)+'6', - KEY_CTRLALT7 =(KEY_CTRL|KEY_ALT)+'7', - KEY_CTRLALT8 =(KEY_CTRL|KEY_ALT)+'8', - KEY_CTRLALT9 =(KEY_CTRL|KEY_ALT)+'9', - - KEY_CTRLALTA =(KEY_CTRL|KEY_ALT)+'A', - KEY_CTRLALTB =(KEY_CTRL|KEY_ALT)+'B', - KEY_CTRLALTC =(KEY_CTRL|KEY_ALT)+'C', - KEY_CTRLALTD =(KEY_CTRL|KEY_ALT)+'D', - KEY_CTRLALTE =(KEY_CTRL|KEY_ALT)+'E', - KEY_CTRLALTF =(KEY_CTRL|KEY_ALT)+'F', - KEY_CTRLALTG =(KEY_CTRL|KEY_ALT)+'G', - KEY_CTRLALTH =(KEY_CTRL|KEY_ALT)+'H', - KEY_CTRLALTI =(KEY_CTRL|KEY_ALT)+'I', - KEY_CTRLALTJ =(KEY_CTRL|KEY_ALT)+'J', - KEY_CTRLALTK =(KEY_CTRL|KEY_ALT)+'K', - KEY_CTRLALTL =(KEY_CTRL|KEY_ALT)+'L', - KEY_CTRLALTM =(KEY_CTRL|KEY_ALT)+'M', - KEY_CTRLALTN =(KEY_CTRL|KEY_ALT)+'N', - KEY_CTRLALTO =(KEY_CTRL|KEY_ALT)+'O', - KEY_CTRLALTP =(KEY_CTRL|KEY_ALT)+'P', - KEY_CTRLALTQ =(KEY_CTRL|KEY_ALT)+'Q', - KEY_CTRLALTR =(KEY_CTRL|KEY_ALT)+'R', - KEY_CTRLALTS =(KEY_CTRL|KEY_ALT)+'S', - KEY_CTRLALTT =(KEY_CTRL|KEY_ALT)+'T', - KEY_CTRLALTU =(KEY_CTRL|KEY_ALT)+'U', - KEY_CTRLALTV =(KEY_CTRL|KEY_ALT)+'V', - KEY_CTRLALTW =(KEY_CTRL|KEY_ALT)+'W', - KEY_CTRLALTX =(KEY_CTRL|KEY_ALT)+'X', - KEY_CTRLALTY =(KEY_CTRL|KEY_ALT)+'Y', - KEY_CTRLALTZ =(KEY_CTRL|KEY_ALT)+'Z', - - KEY_CTRLALTBRACKET =KEY_CTRL|KEY_ALT|KEY_BRACKET, - KEY_CTRLALTBACKBRACKET =KEY_CTRL|KEY_ALT|KEY_BACKBRACKET, - - KEY_CTRLF1 =KEY_CTRL|KEY_F1, - KEY_CTRLF2 =KEY_CTRL|KEY_F2, - KEY_CTRLF3 =KEY_CTRL|KEY_F3, - KEY_CTRLF4 =KEY_CTRL|KEY_F4, - KEY_CTRLF5 =KEY_CTRL|KEY_F5, - KEY_CTRLF6 =KEY_CTRL|KEY_F6, - KEY_CTRLF7 =KEY_CTRL|KEY_F7, - KEY_CTRLF8 =KEY_CTRL|KEY_F8, - KEY_CTRLF9 =KEY_CTRL|KEY_F9, - KEY_CTRLF10 =KEY_CTRL|KEY_F10, - KEY_CTRLF11 =KEY_CTRL|KEY_F11, - KEY_CTRLF12 =KEY_CTRL|KEY_F12, - - KEY_SHIFTF1 =KEY_SHIFT|KEY_F1, - KEY_SHIFTF2 =KEY_SHIFT|KEY_F2, - KEY_SHIFTF3 =KEY_SHIF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TF11 =KEY_CTRL|KEY_ALT|KEY_F11, - KEY_CTRLALTF12 =KEY_CTRL|KEY_ALT|KEY_F12, - - KEY_CTRLHOME =KEY_CTRL|KEY_HOME, - KEY_CTRLUP =KEY_CTRL|KEY_UP, - KEY_CTRLPGUP =KEY_CTRL|KEY_PGUP, - KEY_CTRLLEFT =KEY_CTRL|KEY_LEFT, - KEY_CTRLRIGHT =KEY_CTRL|KEY_RIGHT, - KEY_CTRLEND =KEY_CTRL|KEY_END, - KEY_CTRLDOWN =KEY_CTRL|KEY_DOWN, - KEY_CTRLPGDN =KEY_CTRL|KEY_PGDN, - KEY_CTRLINS =KEY_CTRL|KEY_INS, - KEY_CTRLDEL =KEY_CTRL|KEY_DEL, - KEY_CTRLNUMDEL =KEY_CTRL|KEY_NUMDEL, - KEY_CTRLDECIMAL =KEY_CTRL|KEY_DECIMAL, - - KEY_SHIFTHOME =KEY_SHIFT|KEY_HOME, - KEY_SHIFTUP =KEY_SHIFT|KEY_UP, - KEY_SHIFTPGUP =KEY_SHIFT|KEY_PGUP, - KEY_SHIFTLEFT =KEY_SHIFT|KEY_LEFT, - KEY_SHIFTRIGHT =KEY_SHIFT|KEY_RIGHT, - KEY_SHIFTEND =KEY_SHIFT|KEY_END, - KEY_SHIFTDOWN =KEY_SHIFT|KEY_DOWN, - KEY_SHIFTPGDN =KEY_SHIFT|KEY_PGDN, - KEY_SHIFTINS =KEY_SHIFT|KEY_INS, - KEY_SHIFTDEL =KEY_SHIFT|KEY_DEL, - KEY_SHIFTNUMDEL =KEY_SHIFT|KEY_NUMDEL, - KEY_SHIFTDECIMAL =KEY_SHIFT|KEY_DECIMAL, - - KEY_ALTHOME =KEY_ALT|KEY_HOME, - KEY_ALTUP =KEY_ALT|KEY_UP, - KEY_ALTPGUP =KEY_ALT|KEY_PGUP, - KEY_ALTLEFT =KEY_ALT|KEY_LEFT, - KEY_ALTRIGHT =KEY_ALT|KEY_RIGHT, - KEY_ALTEND =KEY_ALT|KEY_END, - KEY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- KEY_CTRLSHIFTCLEAR =KEY_CTRL|KEY_SHIFT|KEY_CLEAR, - KEY_CTRLALTCLEAR =KEY_CTRL|KEY_ALT|KEY_CLEAR, - KEY_CTRLADD =KEY_CTRL|KEY_ADD, - KEY_SHIFTADD =KEY_SHIFT|KEY_ADD, - - KEY_CTRLSUBTRACT =KEY_CTRL|KEY_SUBTRACT, - KEY_ALTSUBTRACT =KEY_ALT|KEY_SUBTRACT, - KEY_SHIFTSUBTRACT =KEY_SHIFT|KEY_SUBTRACT, - KEY_CTRLMULTIPLY =KEY_CTRL|KEY_MULTIPLY, - - KEY_CTRLBS =KEY_CTRL|KEY_BS, - KEY_ALTBS =KEY_ALT|KEY_BS, - KEY_CTRLSHIFTBS =KEY_CTRL|KEY_SHIFT|KEY_BS, - KEY_SHIFTBS =KEY_SHIFT|KEY_BS, - - KEY_CTRLSHIFTTAB =KEY_CTRL|KEY_SHIFT|KEY_TAB, - KEY_CTRLTAB =KEY_CTRL|KEY_TAB, - KEY_SHIFTTAB =KEY_SHIFT|KEY_TAB, - - KEY_CTRLENTER =KEY_CTRL|KEY_ENTER, - KEY_SHIFTENTER =KEY_SHIFT|KEY_ENTER, - KEY_ALTSHIFTENTER =KEY_ALT|KEY_SHIFT|KEY_ENTER, - KEY_CTRLALTENTER =KEY_CTRL|KEY_ALT|KEY_ENTER, - KEY_CTRLSHIFTENTER =KEY_CTRL|KEY_SHIFT|KEY_ENTER, - - KEY_CTRLNUMENTER =KEY_CTRL|KEY_NUMENTER, - KEY_SHIFTNUMENTER =KEY_SHIFT|KEY_NUMENTER, - KEY_ALTSHIFTNUMENTER =KEY_ALT|KEY_SHIFT|KEY_NUMENTER, - KEY_CTRLALTNUMENTER =KEY_CTRL|KEY_ALT|KEY_NUMENTER, - KEY_CTRLSHIFTNUMENTER =KEY_CTRL|KEY_SHIFT|KEY_NUMENTER, - - KEY_CTRLAPPS =KEY_CTRL|KEY_APPS, - KEY_ALTAPPS =KEY_ALT|KEY_APPS, - KEY_SHIFTAPPS =KEY_SHIFT|KEY_APPS, - KEY_CTRLSHIFTAPPS =KEY_CTRL|KEY_SHIFT|KEY_APPS, - KEY_ALTSHIFTAPPS =KEY_ALT|KEY_SHIFT|KEY_APPS, - KEY_CTRLALTAPPS =KEY_CTRL|KEY_ALT|KEY_APPS, - - KEY_CTRLSPACE =KEY_CTRL|KEY_SPACE, - KEY_SHIFTSPACE =KEY_SHIFT|KEY_SPACE, - KEY_CTRLSHIFTSPACE =KEY_CTRL|KEY_SHIFT|KEY_SPACE, - - KEY_ALT_BASE =KEY_ALT, - KEY_ALTSHIFT_BASE =KEY_ALTSHIFT, -}; - - -#endif // __FARKEYS_HPP__ diff --git a/depends/far2/plugin.hpp b/depends/far2/plugin.hpp deleted file mode 100644 index 4d4b866..0000000 --- a/depends/far2/plugin.hpp +++ /dev/null @@ -1,2103 +0,0 @@ -#pragma once -#ifndef __PLUGIN_HPP__ -#define __PLUGIN_HPP__ - -/* - plugin.hpp - - Plugin API for FAR Manager 2.0 build 1807 -*/ - -/* -Copyright (c) 1996 Eugene Roshal -Copyright (c) 2000 Far Group -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the authors may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -EXCEPTION: -Far Manager plugins that use this header file can be distributed under any -other possible license with no implications from the above license on them. -*/ - -#define FARMANAGERVERSION_MAJOR 2 -#define FARMANAGERVERSION_MINOR 0 -#define FARMANAGERVERSION_BUILD 1807 - -#ifndef RC_INVOKED - -#define MAKEFARVERSION(major,minor,build) ( ((major)<<8) | (minor) | ((build)<<16)) - -#define FARMANAGERVERSION MAKEFARVERSION(FARMANAGERVERSION_MAJOR,FARMANAGERVERSION_MINOR,FARMANAGERVERSION_BUILD) - -#if !defined(_INC_WINDOWS) && !defined(_WINDOWS_) -#if (defined(__GNUC__) || defined(_MSC_VER)) && !defined(_WIN64) -#if !defined(_WINCON_H) && !defined(_WINCON_) -#define _WINCON_H -#define _WINCON_ // to prevent including wincon.h -#if defined(_MSC_VER) -#pragma pack(push,2) -#else -#pragma pack(2) -#endif -#include -#if defined(_MSC_VER) -#pragma pack(pop) -#else -#pragma pack() -#endif -#undef _WINCON_ -#undef _WINCON_H - -#if defined(_MSC_VER) -#pragma pack(push,8) -#else -#pragma pack(8) -#endif -#include -#if defined(_MSC_VER) -#pragma pack(pop) -#else -#pragma pack() -#endif -#endif -#define _WINCON_ -#else -#include -#endif -#endif - -#if defined(__BORLANDC__) -#ifndef _WIN64 -#pragma option -a2 -#endif -#elif defined(__GNUC__) || (defined(__WATCOMC__) && (__WATCOMC__ < 1100)) || defined(__LCC__) -#ifndef _WIN64 -#pragma pack(2) -#endif -#if defined(__LCC__) -#define _export __declspec(dllexport) -#endif -#else -#ifndef _WIN64 -#pragma pack(push,2) -#endif -#if _MSC_VER -#ifdef _export -#undef _export -#endif -#define _export -#endif -#endif - -#undef DefDlgProc - -#define FARMACRO_KEY_EVENT (KEY_EVENT|0x8000) - -// To ensure compatibility of plugin.hpp with compilers not supporting C++, -// you can #define _FAR_NO_NAMELESS_UNIONS. In this case, to access, -// for example, the Data field of the FarDialogItem structure -// you will need to use Data.Data, and the Selected field - Param.Selected -//#define _FAR_NO_NAMELESS_UNIONS - -#ifndef _WINCON_ -typedef struct _INPUT_RECORD INPUT_RECORD; -typedef struct _CHAR_INFO CHAR_INFO; -#endif - -#define CP_UNICODE 1200 -#define CP_REVERSEBOM 1201 -#define CP_AUTODETECT ((UINT)-1) - -enum FARMESSAGEFLAGS -{ - FMSG_WARNING = 0x00000001, - FMSG_ERRORTYPE = 0x00000002, - FMSG_KEEPBACKGROUND = 0x00000004, - FMSG_LEFTALIGN = 0x00000010, - - FMSG_ALLINONE = 0x00000020, - - FMSG_MB_OK = 0x00010000, - FMSG_MB_OKCANCEL = 0x00020000, - FMSG_MB_ABORTRETRYIGNORE = 0x00030000, - FMSG_MB_YESNO = 0x00040000, - FMSG_MB_YESNOCANCEL = 0x00050000, - FMSG_MB_RETRYCANCEL = 0x00060000, -}; - -typedef int (WINAPI *FARAPIMESSAGE)( - INT_PTR PluginNumber, - DWORD Flags, - const wchar_t *HelpTopic, - const wchar_t * const *Items, - int ItemsNumber, - int ButtonsNumber -); - - -enum DialogItemTypes -{ - DI_TEXT, - DI_VTEXT, - DI_SINGLEBOX, - DI_DOUBLEBOX, - DI_EDIT, - DI_PSWEDIT, - DI_FIXEDIT, - DI_BUTTON, - DI_CHECKBOX, - DI_RADIOBUTTON, - DI_COMBOBOX, - DI_LISTBOX, - - DI_USERCONTROL=255, -}; - -/* - Check diagol element type has inputstring? - (DI_EDIT, DI_FIXEDIT, DI_PSWEDIT, etc) -*/ -static __inline BOOL IsEdit(int Type) -{ - switch (Type) - { - case DI_EDIT: - case DI_FIXEDIT: - case DI_PSWEDIT: - case DI_COMBOBOX: - return TRUE; - default: - return FALSE; - } -} - - -enum FarDialogItemFlags -{ - DIF_NONE = 0, - DIF_COLORMASK = 0x000000ffUL, - DIF_SETCOLOR = 0x00000100UL, - DIF_BOXCOLOR = 0x00000200UL, - DIF_GROUP = 0x00000400UL, - DIF_LEFTTEXT = 0x00000800UL, - DIF_MOVESELECT = 0x00001000UL, - DIF_SHOWAMPERSAND = 0x00002000UL, - DIF_CENTERGROUP = 0x00004000UL, - DIF_NOBRACKETS = 0x00008000UL, - DIF_MANUALADDHISTORY = 0x00008000UL, - DIF_SEPARATOR = 0x00010000UL, - DIF_SEPARATOR2 = 0x00020000UL, - DIF_EDITOR = 0x00020000UL, - DIF_LISTNOAMPERSAND = 0x00020000UL, - DIF_LISTNOBOX = 0x00040000UL, - DIF_HISTORY = 0x00040000UL, - DIF_BTNNOCLOSE = 0x00040000UL, - DIF_CENTERTEXT = 0x00040000UL, - DIF_SETSHIELD = 0x00080000UL, - DIF_EDITEXPAND = 0x00080000UL, - DIF_DROPDOWNLIST = 0x00100000UL, - DIF_USELASTHISTORY = 0x00200000UL, - DIF_MASKEDIT = 0x00400000UL, - DIF_SELECTONENTRY = 0x00800000UL, - DIF_3STATE = 0x00800000UL, - DIF_EDITPATH = 0x01000000UL, - DIF_LISTWRAPMODE = 0x01000000UL, - DIF_NOAUTOCOMPLETE = 0x02000000UL, - DIF_LISTAUTOHIGHLIGHT = 0x02000000UL, - DIF_LISTNOCLOSE = 0x04000000UL, - DIF_HIDDEN = 0x10000000UL, - DIF_READONLY = 0x20000000UL, - DIF_NOFOCUS = 0x40000000UL, - DIF_DISABLE = 0x80000000UL, -}; - -enum FarMessagesProc -{ - DM_FIRST=0, - DM_CLOSE, - DM_ENABLE, - DM_ENABLEREDRAW, - DM_GETDLGDATA, - DM_GETDLGITEM, - DM_GETDLGRECT, - DM_GETTEXT, - DM_GETTEXTLENGTH, - DM_KEY, - DM_MOVEDIALOG, - DM_SETDLGDATA, - DM_SETDLGITEM, - DM_SETFOCUS, - DM_REDRAW, - DM_SETREDRAW=DM_REDRAW, - DM_SETTEXT, - DM_SETMAXTEXTLENGTH, - DM_SETTEXTLENGTH=DM_SETMAXTEXTLENGTH, - DM_SHOWDIALOG, - DM_GETFOCUS, - DM_GETCURSORPOS, - DM_SETCURSORPOS, - DM_GETTEXTPTR, - DM_SETTEXTPTR, - DM_SHOWITEM, - DM_ADDHISTORY, - - DM_GETCHECK, - DM_SETCHECK, - DM_SET3STATE, - - DM_LISTSORT, - DM_LISTGETITEM, - DM_LISTGETCURPOS, - DM_LISTSETCURPOS, - DM_LISTDELETE, - DM_LISTADD, - DM_LISTADDSTR, - DM_LISTUPDATE, - DM_LISTINSERT, - DM_LISTFINDSTRING, - DM_LISTINFO, - DM_LISTGETDATA, - DM_LISTSETDATA, - DM_LISTSETTITLES, - DM_LISTGETTITLES, - - DM_RESIZEDIALOG, - DM_SETITEMPOSITION, - - DM_GETDROPDOWNOPENED, - DM_SETDROPDOWNOPENED, - - DM_SETHISTORY, - - DM_GETITEMPOSITION, - DM_SETMOUSEEVENTNOTIFY, - - DM_EDITUNCHANGEDFLAG, - - DM_GETITEMDATA, - DM_SETITEMDATA, - - DM_LISTSET, - DM_LISTSETMOUSEREACTION, - - DM_GETCURSORSIZE, - DM_SETCURSORSIZE, - - DM_LISTGETDATASIZE, - - DM_GETSELECTION, - DM_SETSELECTION, - - DM_GETEDITPOSITION, - DM_SETEDITPOSITION, - - DM_SETCOMBOBOXEVENT, - DM_GETCOMBOBOXEVENT, - - DM_GETCONSTTEXTPTR, - DM_GETDLGITEMSHORT, - DM_SETDLGITEMSHORT, - - DM_GETDIALOGINFO, - - DN_FIRST=0x1000, - DN_BTNCLICK, - DN_CTLCOLORDIALOG, - DN_CTLCOLORDLGITEM, - DN_CTLCOLORDLGLIST, - DN_DRAWDIALOG, - DN_DRAWDLGITEM, - DN_EDITCHANGE, - DN_ENTERIDLE, - DN_GOTFOCUS, - DN_HELP, - DN_HOTKEY, - DN_INITDIALOG, - DN_KILLFOCUS, - DN_LISTCHANGE, - DN_MOUSECLICK, - DN_DRAGGED, - DN_RESIZECONSOLE, - DN_MOUSEEVENT, - DN_DRAWDIALOGDONE, - DN_LISTHOTKEY, - - DN_GETDIALOGINFO=DM_GETDIALOGINFO, - - DN_CLOSE=DM_CLOSE, - DN_KEY=DM_KEY, - - - DM_USER=0x4000, - -}; - -enum FARCHECKEDSTATE -{ - BSTATE_UNCHECKED = 0, - BSTATE_CHECKED = 1, - BSTATE_3STATE = 2, - BSTATE_TOGGLE = 3, -}; - -enum FARLISTMOUSEREACTIONTYPE -{ - LMRT_ONLYFOCUS = 0, - LMRT_ALWAYS = 1, - LMRT_NEVER = 2, -}; - -enum FARCOMBOBOXEVENTTYPE -{ - CBET_KEY = 0x00000001, - CBET_MOUSE = 0x00000002, -}; - -enum LISTITEMFLAGS -{ - LIF_SELECTED = 0x00010000UL, - LIF_CHECKED = 0x00020000UL, - LIF_SEPARATOR = 0x00040000UL, - LIF_DISABLE = 0x00080000UL, - LIF_GRAYED = 0x00100000UL, - LIF_HIDDEN = 0x00200000UL, - LIF_DELETEUSERDATA = 0x80000000UL, -}; - -struct FarListItem -{ - DWORD Flags; - const wchar_t *Text; - DWORD Reserved[3]; -}; - -struct FarListUpdate -{ - int Index; - struct FarListItem Item; -}; - -struct FarListInsert -{ - int Index; - struct FarListItem Item; -}; - -struct FarListGetItem -{ - int ItemIndex; - struct FarListItem Item; -}; - -struct FarListPos -{ - int SelectPos; - int TopPos; -}; - -enum FARLISTFINDFLAGS -{ - LIFIND_EXACTMATCH = 0x00000001, -}; - -struct FarListFind -{ - int StartIndex; - const wchar_t *Pattern; - DWORD Flags; - DWORD Reserved; -}; - -struct FarListDelete -{ - int StartIndex; - int Count; -}; - -enum FARLISTINFOFLAGS -{ - LINFO_SHOWNOBOX = 0x00000400, - LINFO_AUTOHIGHLIGHT = 0x00000800, - LINFO_REVERSEHIGHLIGHT = 0x00001000, - LINFO_WRAPMODE = 0x00008000, - LINFO_SHOWAMPERSAND = 0x00010000, -}; - -struct FarListInfo -{ - DWORD Flags; - int ItemsNumber; - int SelectPos; - int TopPos; - int MaxHeight; - int MaxLength; - DWORD Reserved[6]; -}; - -struct FarListItemData -{ - int Index; - int DataSize; - void *Data; - DWORD Reserved; -}; - -struct FarList -{ - int ItemsNumber; - struct FarListItem *Items; -}; - -struct FarListTitles -{ - int TitleLen; - const wchar_t *Title; - int BottomLen; - const wchar_t *Bottom; -}; - -struct FarListColors -{ - DWORD Flags; - DWORD Reserved; - int ColorCount; - LPBYTE Colors; -}; - -struct FarDialogItem -{ - int Type; - int X1,Y1,X2,Y2; - int Focus; - union - { - DWORD_PTR Reserved; - int Selected; - const wchar_t *History; - const wchar_t *Mask; - struct FarList *ListItems; - int ListPos; - CHAR_INFO *VBuf; - } -#ifdef _FAR_NO_NAMELESS_UNIONS - Param -#endif - ; - DWORD Flags; - int DefaultButton; - - const wchar_t *PtrData; - size_t MaxLen; // terminate 0 not included (if == 0 string size is unlimited) -}; - -struct FarDialogItemData -{ - size_t PtrLength; - wchar_t *PtrData; -}; - -struct FarDialogEvent -{ - HANDLE hDlg; - int Msg; - int Param1; - LONG_PTR Param2; - LONG_PTR Result; -}; - -struct OpenDlgPluginData -{ - int ItemNumber; - HANDLE hDlg; -}; - -struct DialogInfo -{ - int StructSize; - GUID Id; -}; - -#define Dlg_RedrawDialog(Info,hDlg) Info.SendDlgMessage(hDlg,DM_REDRAW,0,0) - -#define Dlg_GetDlgData(Info,hDlg) Info.SendDlgMessage(hDlg,DM_GETDLGDATA,0,0) -#define Dlg_SetDlgData(Info,hDlg,Data) Info.SendDlgMessage(hDlg,DM_SETDLGDATA,0,(LONG_PTR)Data) - -#define Dlg_GetDlgItemData(Info,hDlg,ID) Info.SendDlgMessage(hDlg,DM_GETITEMDATA,0,0) -#define Dlg_SetDlgItemData(Info,hDlg,ID,Data) Info.SendDlgMessage(hDlg,DM_SETITEMDATA,0,(LONG_PTR)Data) - -#define DlgItem_GetFocus(Info,hDlg) Info.SendDlgMessage(hDlg,DM_GETFOCUS,0,0) -#define DlgItem_SetFocus(Info,hDlg,ID) Info.SendDlgMessage(hDlg,DM_SETFOCUS,ID,0) -#define DlgItem_Enable(Info,hDlg,ID) Info.SendDlgMessage(hDlg,DM_ENABLE,ID,TRUE) -#define DlgItem_Disable(Info,hDlg,ID) Info.SendDlgMessage(hDlg,DM_ENABLE,ID,FALSE) -#define DlgItem_IsEnable(Info,hDlg,ID) Info.SendDlgMessage(hDlg,DM_ENABLE,ID,-1) -#define DlgItem_SetText(Info,hDlg,ID,Str) Info.SendDlgMessage(hDlg,DM_SETTEXTPTR,ID,(LONG_PTR)Str) - -#define DlgItem_GetCheck(Info,hDlg,ID) Info.SendDlgMessage(hDlg,DM_GETCHECK,ID,0) -#define DlgItem_SetCheck(Info,hDlg,ID,State) Info.SendDlgMessage(hDlg,DM_SETCHECK,ID,State) - -#define DlgEdit_AddHistory(Info,hDlg,ID,Str) Info.SendDlgMessage(hDlg,DM_ADDHISTORY,ID,(LONG_PTR)Str) - -#define DlgList_AddString(Info,hDlg,ID,Str) Info.SendDlgMessage(hDlg,DM_LISTADDSTR,ID,(LONG_PTR)Str) -#define DlgList_GetCurPos(Info,hDlg,ID) Info.SendDlgMessage(hDlg,DM_LISTGETCURPOS,ID,0) -#define DlgList_SetCurPos(Info,hDlg,ID,NewPos) {struct FarListPos LPos={NewPos,-1};Info.SendDlgMessage(hDlg,DM_LISTSETCURPOS,ID,(LONG_PTR)&LPos);} -#define DlgList_ClearList(Info,hDlg,ID) Info.SendDlgMessage(hDlg,DM_LISTDELETE,ID,0) -#define DlgList_DeleteItem(Info,hDlg,ID,Index) {struct FarListDelete FLDItem={Index,1}; Info.SendDlgMessage(hDlg,DM_LISTDELETE,ID,(LONG_PTR)&FLDItem);} -#define DlgList_SortUp(Info,hDlg,ID) Info.SendDlgMessage(hDlg,DM_LISTSORT,ID,0) -#define DlgList_SortDown(Info,hDlg,ID) Info.SendDlgMessage(hDlg,DM_LISTSORT,ID,1) -#define DlgList_GetItemData(Info,hDlg,ID,Index) Info.SendDlgMessage(hDlg,DM_LISTGETDATA,ID,Index) -#define DlgList_SetItemStrAsData(Info,hDlg,ID,Index,Str) {struct FarListItemData FLID{Index,0,Str,0}; Info.SendDlgMessage(hDlg,DM_LISTSETDATA,ID,(LONG_PTR)&FLID);} - -enum FARDIALOGFLAGS -{ - FDLG_WARNING = 0x00000001, - FDLG_SMALLDIALOG = 0x00000002, - FDLG_NODRAWSHADOW = 0x00000004, - FDLG_NODRAWPANEL = 0x00000008, - FDLG_KEEPCONSOLETITLE = 0x00000020, -}; - -typedef LONG_PTR(WINAPI *FARWINDOWPROC)( - HANDLE hDlg, - int Msg, - int Param1, - LONG_PTR Param2 -); - -typedef LONG_PTR(WINAPI *FARAPISENDDLGMESSAGE)( - HANDLE hDlg, - int Msg, - int Param1, - LONG_PTR Param2 -); - -typedef LONG_PTR(WINAPI *FARAPIDEFDLGPROC)( - HANDLE hDlg, - int Msg, - int Param1, - LONG_PTR Param2 -); - -typedef HANDLE(WINAPI *FARAPIDIALOGINIT)( - INT_PTR PluginNumber, - int X1, - int Y1, - int X2, - int Y2, - const wchar_t *HelpTopic, - struct FarDialogItem *Item, - unsigned int ItemsNumber, - DWORD Reserved, - DWORD Flags, - FARWINDOWPROC DlgProc, - LONG_PTR Param -); - -typedef int (WINAPI *FARAPIDIALOGRUN)( - HANDLE hDlg -); - -typedef void (WINAPI *FARAPIDIALOGFREE)( - HANDLE hDlg -); - -struct FarMenuItem -{ - const wchar_t *Text; - int Selected; - int Checked; - int Separator; -}; - -enum MENUITEMFLAGS -{ - MIF_SELECTED = 0x00010000UL, - MIF_CHECKED = 0x00020000UL, - MIF_SEPARATOR = 0x00040000UL, - MIF_DISABLE = 0x00080000UL, - MIF_GRAYED = 0x00100000UL, - MIF_HIDDEN = 0x00200000UL, -}; - -struct FarMenuItemEx -{ - DWORD Flags; - const wchar_t *Text; - DWORD AccelKey; - DWORD Reserved; - DWORD_PTR UserData; -}; - -enum FARMENUFLAGS -{ - FMENU_SHOWAMPERSAND = 0x00000001, - FMENU_WRAPMODE = 0x00000002, - FMENU_AUTOHIGHLIGHT = 0x00000004, - FMENU_REVERSEAUTOHIGHLIGHT = 0x00000008, - FMENU_USEEXT = 0x00000020, - FMENU_CHANGECONSOLETITLE = 0x00000040, -}; - -typedef int (WINAPI *FARAPIMENU)( - INT_PTR PluginNumber, - int X, - int Y, - int MaxHeight, - DWORD Flags, - const wchar_t *Title, - const wchar_t *Bottom, - const wchar_t *HelpTopic, - const int *BreakKeys, - int *BreakCode, - const struct FarMenuItem *Item, - int ItemsNumber -); - - -enum PLUGINPANELITEMFLAGS -{ - PPIF_PROCESSDESCR = 0x80000000, - PPIF_SELECTED = 0x40000000, - PPIF_USERDATA = 0x20000000, -}; - -struct FAR_FIND_DATA -{ - DWORD dwFileAttributes; - FILETIME ftCreationTime; - FILETIME ftLastAccessTime; - FILETIME ftLastWriteTime; - unsigned __int64 nFileSize; - unsigned __int64 nPackSize; - const wchar_t *lpwszFileName; - const wchar_t *lpwszAlternateFileName; -}; - -struct PluginPanelItem -{ - struct FAR_FIND_DATA FindData; - DWORD Flags; - DWORD NumberOfLinks; - const wchar_t *Description; - const wchar_t *Owner; - const wchar_t * const *CustomColumnData; - int CustomColumnNumber; - DWORD_PTR UserData; - DWORD CRC32; - DWORD_PTR Reserved[2]; -}; - -enum PANELINFOFLAGS -{ - PFLAGS_SHOWHIDDEN = 0x00000001, - PFLAGS_HIGHLIGHT = 0x00000002, - PFLAGS_REVERSESORTORDER = 0x00000004, - PFLAGS_USESORTGROUPS = 0x00000008, - PFLAGS_SELECTEDFIRST = 0x00000010, - PFLAGS_REALNAMES = 0x00000020, - PFLAGS_NUMERICSORT = 0x00000040, - PFLAGS_PANELLEFT = 0x00000080, - PFLAGS_DIRECTORIESFIRST = 0x00000100, - PFLAGS_USECRC32 = 0x00000200, - PFLAGS_CASESENSITIVESORT = 0x00000400, -}; - -enum PANELINFOTYPE -{ - PTYPE_FILEPANEL, - PTYPE_TREEPANEL, - PTYPE_QVIEWPANEL, - PTYPE_INFOPANEL -}; - -struct PanelInfo -{ - int PanelType; - int Plugin; - RECT PanelRect; - int ItemsNumber; - int SelectedItemsNumber; - int CurrentItem; - int TopPanelItem; - int Visible; - int Focus; - int ViewMode; - int ShortNames; - int SortMode; - DWORD Flags; - DWORD Reserved; -}; - - -struct PanelRedrawInfo -{ - int CurrentItem; - int TopPanelItem; -}; - -struct CmdLineSelect -{ - int SelStart; - int SelEnd; -}; - -#define PANEL_NONE ((HANDLE)(-1)) -#define PANEL_ACTIVE ((HANDLE)(-1)) -#define PANEL_PASSIVE ((HANDLE)(-2)) - -enum FILE_CONTROL_COMMANDS -{ - FCTL_CLOSEPLUGIN, - FCTL_GETPANELINFO, - FCTL_UPDATEPANEL, - FCTL_REDRAWPANEL, - FCTL_GETCMDLINE, - FCTL_SETCMDLINE, - FCTL_SETSELECTION, - FCTL_SETVIEWMODE, - FCTL_INSERTCMDLINE, - FCTL_SETUSERSCREEN, - FCTL_SETPANELDIR, - FCTL_SETCMDLINEPOS, - FCTL_GETCMDLINEPOS, - FCTL_SETSORTMODE, - FCTL_SETSORTORDER, - FCTL_GETCMDLINESELECTEDTEXT, - FCTL_SETCMDLINESELECTION, - FCTL_GETCMDLINESELECTION, - FCTL_CHECKPANELSEXIST, - FCTL_SETNUMERICSORT, - FCTL_GETUSERSCREEN, - FCTL_ISACTIVEPANEL, - FCTL_GETPANELITEM, - FCTL_GETSELECTEDPANELITEM, - FCTL_GETCURRENTPANELITEM, - FCTL_GETPANELDIR, - FCTL_GETCOLUMNTYPES, - FCTL_GETCOLUMNWIDTHS, - FCTL_BEGINSELECTION, - FCTL_ENDSELECTION, - FCTL_CLEARSELECTION, - FCTL_SETDIRECTORIESFIRST, - FCTL_GETPANELFORMAT, - FCTL_GETPANELHOSTFILE, - FCTL_SETCASESENSITIVESORT, -}; - -typedef int (WINAPI *FARAPICONTROL)( - HANDLE hPlugin, - int Command, - int Param1, - LONG_PTR Param2 -); - -typedef void (WINAPI *FARAPITEXT)( - int X, - int Y, - int Color, - const wchar_t *Str -); - -typedef HANDLE(WINAPI *FARAPISAVESCREEN)(int X1, int Y1, int X2, int Y2); - -typedef void (WINAPI *FARAPIRESTORESCREEN)(HANDLE hScreen); - - -typedef int (WINAPI *FARAPIGETDIRLIST)( - const wchar_t *Dir, - struct FAR_FIND_DATA **pPanelItem, - int *pItemsNumber -); - -typedef int (WINAPI *FARAPIGETPLUGINDIRLIST)( - INT_PTR PluginNumber, - HANDLE hPlugin, - const wchar_t *Dir, - struct PluginPanelItem **pPanelItem, - int *pItemsNumber -); - -typedef void (WINAPI *FARAPIFREEDIRLIST)(struct FAR_FIND_DATA *PanelItem, int nItemsNumber); -typedef void (WINAPI *FARAPIFREEPLUGINDIRLIST)(struct PluginPanelItem *PanelItem, int nItemsNumber); - -enum VIEWER_FLAGS -{ - VF_NONMODAL = 0x00000001, - VF_DELETEONCLOSE = 0x00000002, - VF_ENABLE_F6 = 0x00000004, - VF_DISABLEHISTORY = 0x00000008, - VF_IMMEDIATERETURN = 0x00000100, - VF_DELETEONLYFILEONCLOSE = 0x00000200, -}; - -typedef int (WINAPI *FARAPIVIEWER)( - const wchar_t *FileName, - const wchar_t *Title, - int X1, - int Y1, - int X2, - int Y2, - DWORD Flags, - UINT CodePage -); - -enum EDITOR_FLAGS -{ - EF_NONMODAL = 0x00000001, - EF_CREATENEW = 0x00000002, - EF_ENABLE_F6 = 0x00000004, - EF_DISABLEHISTORY = 0x00000008, - EF_DELETEONCLOSE = 0x00000010, - EF_IMMEDIATERETURN = 0x00000100, - EF_DELETEONLYFILEONCLOSE = 0x00000200, -}; - -enum EDITOR_EXITCODE -{ - EEC_OPEN_ERROR = 0, - EEC_MODIFIED = 1, - EEC_NOT_MODIFIED = 2, - EEC_LOADING_INTERRUPTED = 3, -}; - -typedef int (WINAPI *FARAPIEDITOR)( - const wchar_t *FileName, - const wchar_t *Title, - int X1, - int Y1, - int X2, - int Y2, - DWORD Flags, - int StartLine, - int StartChar, - UINT CodePage -); - -typedef int (WINAPI *FARAPICMPNAME)( - const wchar_t *Pattern, - const wchar_t *String, - int SkipPath -); - - -typedef const wchar_t*(WINAPI *FARAPIGETMSG)( - INT_PTR PluginNumber, - int MsgId -); - - -enum FarHelpFlags -{ - FHELP_NOSHOWERROR = 0x80000000, - FHELP_SELFHELP = 0x00000000, - FHELP_FARHELP = 0x00000001, - FHELP_CUSTOMFILE = 0x00000002, - FHELP_CUSTOMPATH = 0x00000004, - FHELP_USECONTENTS = 0x40000000, -}; - -typedef BOOL (WINAPI *FARAPISHOWHELP)( - const wchar_t *ModuleName, - const wchar_t *Topic, - DWORD Flags -); - -enum ADVANCED_CONTROL_COMMANDS -{ - ACTL_GETFARVERSION = 0, - ACTL_GETSYSWORDDIV = 2, - ACTL_WAITKEY = 3, - ACTL_GETCOLOR = 4, - ACTL_GETARRAYCOLOR = 5, - ACTL_EJECTMEDIA = 6, - ACTL_KEYMACRO = 7, - ACTL_POSTKEYSEQUENCE = 8, - ACTL_GETWINDOWINFO = 9, - ACTL_GETWINDOWCOUNT = 10, - ACTL_SETCURRENTWINDOW = 11, - ACTL_COMMIT = 12, - ACTL_GETFARHWND = 13, - ACTL_GETSYSTEMSETTINGS = 14, - ACTL_GETPANELSETTINGS = 15, - ACTL_GETINTERFACESETTINGS = 16, - ACTL_GETCONFIRMATIONS = 17, - ACTL_GETDESCSETTINGS = 18, - ACTL_SETARRAYCOLOR = 19, - ACTL_GETPLUGINMAXREADDATA = 21, - ACTL_GETDIALOGSETTINGS = 22, - ACTL_GETSHORTWINDOWINFO = 23, - ACTL_REDRAWALL = 27, - ACTL_SYNCHRO = 28, - ACTL_SETPROGRESSSTATE = 29, - ACTL_SETPROGRESSVALUE = 30, - ACTL_QUIT = 31, - ACTL_GETFARRECT = 32, - ACTL_GETCURSORPOS = 33, - ACTL_SETCURSORPOS = 34, - ACTL_PROGRESSNOTIFY = 35, -}; - - -enum FarSystemSettings -{ - FSS_CLEARROATTRIBUTE = 0x00000001, - FSS_DELETETORECYCLEBIN = 0x00000002, - FSS_USESYSTEMCOPYROUTINE = 0x00000004, - FSS_COPYFILESOPENEDFORWRITING = 0x00000008, - FSS_CREATEFOLDERSINUPPERCASE = 0x00000010, - FSS_SAVECOMMANDSHISTORY = 0x00000020, - FSS_SAVEFOLDERSHISTORY = 0x00000040, - FSS_SAVEVIEWANDEDITHISTORY = 0x00000080, - FSS_USEWINDOWSREGISTEREDTYPES = 0x00000100, - FSS_AUTOSAVESETUP = 0x00000200, - FSS_SCANSYMLINK = 0x00000400, -}; - -enum FarPanelSettings -{ - FPS_SHOWHIDDENANDSYSTEMFILES = 0x00000001, - FPS_HIGHLIGHTFILES = 0x00000002, - FPS_AUTOCHANGEFOLDER = 0x00000004, - FPS_SELECTFOLDERS = 0x00000008, - FPS_ALLOWREVERSESORTMODES = 0x00000010, - FPS_SHOWCOLUMNTITLES = 0x00000020, - FPS_SHOWSTATUSLINE = 0x00000040, - FPS_SHOWFILESTOTALINFORMATION = 0x00000080, - FPS_SHOWFREESIZE = 0x00000100, - FPS_SHOWSCROLLBAR = 0x00000200, - FPS_SHOWBACKGROUNDSCREENSNUMBER = 0x00000400, - FPS_SHOWSORTMODELETTER = 0x00000800, -}; - -enum FarDialogSettings -{ - FDIS_HISTORYINDIALOGEDITCONTROLS = 0x00000001, - FDIS_PERSISTENTBLOCKSINEDITCONTROLS = 0x00000002, - FDIS_AUTOCOMPLETEININPUTLINES = 0x00000004, - FDIS_BSDELETEUNCHANGEDTEXT = 0x00000008, - FDIS_DELREMOVESBLOCKS = 0x00000010, - FDIS_MOUSECLICKOUTSIDECLOSESDIALOG = 0x00000020, -}; - -enum FarInterfaceSettings -{ - FIS_CLOCKINPANELS = 0x00000001, - FIS_CLOCKINVIEWERANDEDITOR = 0x00000002, - FIS_MOUSE = 0x00000004, - FIS_SHOWKEYBAR = 0x00000008, - FIS_ALWAYSSHOWMENUBAR = 0x00000010, - FIS_SHOWTOTALCOPYPROGRESSINDICATOR = 0x00000100, - FIS_SHOWCOPYINGTIMEINFO = 0x00000200, - FIS_USECTRLPGUPTOCHANGEDRIVE = 0x00000800, - FIS_SHOWTOTALDELPROGRESSINDICATOR = 0x00001000, -}; - -enum FarConfirmationsSettings -{ - FCS_COPYOVERWRITE = 0x00000001, - FCS_MOVEOVERWRITE = 0x00000002, - FCS_DRAGANDDROP = 0x00000004, - FCS_DELETE = 0x00000008, - FCS_DELETENONEMPTYFOLDERS = 0x00000010, - FCS_INTERRUPTOPERATION = 0x00000020, - FCS_DISCONNECTNETWORKDRIVE = 0x00000040, - FCS_RELOADEDITEDFILE = 0x00000080, - FCS_CLEARHISTORYLIST = 0x00000100, - FCS_EXIT = 0x00000200, - FCS_OVERWRITEDELETEROFILES = 0x00000400, -}; - -enum FarDescriptionSettings -{ - FDS_UPDATEALWAYS = 0x00000001, - FDS_UPDATEIFDISPLAYED = 0x00000002, - FDS_SETHIDDEN = 0x00000004, - FDS_UPDATEREADONLY = 0x00000008, -}; - -enum FAREJECTMEDIAFLAGS -{ - EJECT_NO_MESSAGE = 0x00000001, - EJECT_LOAD_MEDIA = 0x00000002, -}; - -struct ActlEjectMedia -{ - DWORD Letter; - DWORD Flags; -}; - - -enum FARKEYSEQUENCEFLAGS -{ - KSFLAGS_DISABLEOUTPUT = 0x00000001, - KSFLAGS_NOSENDKEYSTOPLUGINS = 0x00000002, - KSFLAGS_REG_MULTI_SZ = 0x00100000, - KSFLAGS_SILENTCHECK = 0x00000001, -}; - -struct KeySequence -{ - DWORD Flags; - int Count; - const DWORD *Sequence; -}; - -enum FARMACROCOMMAND -{ - MCMD_LOADALL = 0, - MCMD_SAVEALL = 1, - MCMD_POSTMACROSTRING = 2, - MCMD_CHECKMACRO = 4, - MCMD_GETSTATE = 5, - MCMD_GETAREA = 6, -}; - -enum FARMACROAREA -{ - MACROAREA_OTHER = 0, - MACROAREA_SHELL = 1, - MACROAREA_VIEWER = 2, - MACROAREA_EDITOR = 3, - MACROAREA_DIALOG = 4, - MACROAREA_SEARCH = 5, - MACROAREA_DISKS = 6, - MACROAREA_MAINMENU = 7, - MACROAREA_MENU = 8, - MACROAREA_HELP = 9, - MACROAREA_INFOPANEL =10, - MACROAREA_QVIEWPANEL =11, - MACROAREA_TREEPANEL =12, - MACROAREA_FINDFOLDER =13, - MACROAREA_USERMENU =14, - MACROAREA_AUTOCOMPLETION =15, -}; - -enum FARMACROSTATE -{ - MACROSTATE_NOMACRO = 0, - MACROSTATE_EXECUTING = 1, - MACROSTATE_EXECUTING_COMMON = 2, - MACROSTATE_RECORDING = 3, - MACROSTATE_RECORDING_COMMON = 4, -}; - -enum FARMACROPARSEERRORCODE -{ - MPEC_SUCCESS = 0, - MPEC_UNRECOGNIZED_KEYWORD = 1, - MPEC_UNRECOGNIZED_FUNCTION = 2, - MPEC_FUNC_PARAM = 3, - MPEC_NOT_EXPECTED_ELSE = 4, - MPEC_NOT_EXPECTED_END = 5, - MPEC_UNEXPECTED_EOS = 6, - MPEC_EXPECTED_TOKEN = 7, - MPEC_BAD_HEX_CONTROL_CHAR = 8, - MPEC_BAD_CONTROL_CHAR = 9, - MPEC_VAR_EXPECTED =10, - MPEC_EXPR_EXPECTED =11, - MPEC_ZEROLENGTHMACRO =12, - MPEC_INTPARSERERROR =13, - MPEC_CONTINUE_OTL =14, -}; - -struct MacroParseResult -{ - DWORD ErrCode; - COORD ErrPos; - const wchar_t *ErrSrc; -}; - -struct ActlKeyMacro -{ - int Command; - union - { - struct - { - const wchar_t *SequenceText; - DWORD Flags; - DWORD AKey; - } PlainText; - struct MacroParseResult MacroResult; - DWORD_PTR Reserved[3]; - } Param; -}; - - -enum FARCOLORFLAGS -{ - FCLR_REDRAW = 0x00000001, -}; - -struct FarSetColors -{ - DWORD Flags; - int StartIndex; - int ColorCount; - LPBYTE Colors; -}; - -enum WINDOWINFO_TYPE -{ - WTYPE_PANELS=1, - WTYPE_VIEWER, - WTYPE_EDITOR, - WTYPE_DIALOG, - WTYPE_VMENU, - WTYPE_HELP, -}; - -struct WindowInfo -{ - int Pos; - int Type; - int Modified; - int Current; - wchar_t *TypeName; - int TypeNameSize; - wchar_t *Name; - int NameSize; -}; - -enum PROGRESSTATE -{ - PS_NOPROGRESS =0x0, - PS_INDETERMINATE=0x1, - PS_NORMAL =0x2, - PS_ERROR =0x4, - PS_PAUSED =0x8, -}; - -struct PROGRESSVALUE -{ - unsigned __int64 Completed; - unsigned __int64 Total; -}; - -typedef INT_PTR(WINAPI *FARAPIADVCONTROL)( - INT_PTR ModuleNumber, - int Command, - void *Param -); - - -enum VIEWER_CONTROL_COMMANDS -{ - VCTL_GETINFO, - VCTL_QUIT, - VCTL_REDRAW, - VCTL_SETKEYBAR, - VCTL_SETPOSITION, - VCTL_SELECT, - VCTL_SETMODE, -}; - -enum VIEWER_OPTIONS -{ - VOPT_SAVEFILEPOSITION=1, - VOPT_AUTODETECTCODEPAGE=2, -}; - -enum VIEWER_SETMODE_TYPES -{ - VSMT_HEX, - VSMT_WRAP, - VSMT_WORDWRAP, -}; - -enum VIEWER_SETMODEFLAGS_TYPES -{ - VSMFL_REDRAW = 0x00000001, -}; - -struct ViewerSetMode -{ - int Type; - union - { - int iParam; - wchar_t *wszParam; - } Param; - DWORD Flags; - DWORD Reserved; -}; - -struct ViewerSelect -{ - __int64 BlockStartPos; - int BlockLen; -}; - -enum VIEWER_SETPOS_FLAGS -{ - VSP_NOREDRAW = 0x0001, - VSP_PERCENT = 0x0002, - VSP_RELATIVE = 0x0004, - VSP_NORETNEWPOS = 0x0008, -}; - -struct ViewerSetPosition -{ - DWORD Flags; - __int64 StartPos; - __int64 LeftPos; -}; - -struct ViewerMode -{ - UINT CodePage; - int Wrap; - int WordWrap; - int Hex; - DWORD Reserved[4]; -}; - -struct ViewerInfo -{ - int StructSize; - int ViewerID; - const wchar_t *FileName; - __int64 FileSize; - __int64 FilePos; - int WindowSizeX; - int WindowSizeY; - DWORD Options; - int TabSize; - struct ViewerMode CurMode; - __int64 LeftPos; -}; - -typedef int (WINAPI *FARAPIVIEWERCONTROL)( - int Command, - void *Param -); - -enum VIEWER_EVENTS -{ - VE_READ =0, - VE_CLOSE =1, - - VE_GOTFOCUS =6, - VE_KILLFOCUS =7, -}; - - -enum EDITOR_EVENTS -{ - EE_READ =0, - EE_SAVE =1, - EE_REDRAW =2, - EE_CLOSE =3, - - EE_GOTFOCUS =6, - EE_KILLFOCUS =7, -}; - -enum DIALOG_EVENTS -{ - DE_DLGPROCINIT =0, - DE_DEFDLGPROCINIT =1, - DE_DLGPROCEND =2, -}; - -enum SYNCHRO_EVENTS -{ - SE_COMMONSYNCHRO =0, -}; - -#define EEREDRAW_ALL (void*)0 -#define EEREDRAW_CHANGE (void*)1 -#define EEREDRAW_LINE (void*)2 - -enum EDITOR_CONTROL_COMMANDS -{ - ECTL_GETSTRING, - ECTL_SETSTRING, - ECTL_INSERTSTRING, - ECTL_DELETESTRING, - ECTL_DELETECHAR, - ECTL_INSERTTEXT, - ECTL_GETINFO, - ECTL_SETPOSITION, - ECTL_SELECT, - ECTL_REDRAW, - ECTL_TABTOREAL, - ECTL_REALTOTAB, - ECTL_EXPANDTABS, - ECTL_SETTITLE, - ECTL_READINPUT, - ECTL_PROCESSINPUT, - ECTL_ADDCOLOR, - ECTL_GETCOLOR, - ECTL_SAVEFILE, - ECTL_QUIT, - ECTL_SETKEYBAR, - ECTL_PROCESSKEY, - ECTL_SETPARAM, - ECTL_GETBOOKMARKS, - ECTL_TURNOFFMARKINGBLOCK, - ECTL_DELETEBLOCK, - ECTL_ADDSTACKBOOKMARK, - ECTL_PREVSTACKBOOKMARK, - ECTL_NEXTSTACKBOOKMARK, - ECTL_CLEARSTACKBOOKMARKS, - ECTL_DELETESTACKBOOKMARK, - ECTL_GETSTACKBOOKMARKS, - ECTL_UNDOREDO, - ECTL_GETFILENAME, -}; - -enum EDITOR_SETPARAMETER_TYPES -{ - ESPT_TABSIZE, - ESPT_EXPANDTABS, - ESPT_AUTOINDENT, - ESPT_CURSORBEYONDEOL, - ESPT_CHARCODEBASE, - ESPT_CODEPAGE, - ESPT_SAVEFILEPOSITION, - ESPT_LOCKMODE, - ESPT_SETWORDDIV, - ESPT_GETWORDDIV, - ESPT_SHOWWHITESPACE, - ESPT_SETBOM, -}; - - - -struct EditorSetParameter -{ - int Type; - union - { - int iParam; - wchar_t *wszParam; - DWORD Reserved1; - } Param; - DWORD Flags; - DWORD Size; -}; - - -enum EDITOR_UNDOREDO_COMMANDS -{ - EUR_BEGIN, - EUR_END, - EUR_UNDO, - EUR_REDO -}; - - -struct EditorUndoRedo -{ - int Command; - DWORD_PTR Reserved[3]; -}; - -struct EditorGetString -{ - int StringNumber; - const wchar_t *StringText; - const wchar_t *StringEOL; - int StringLength; - int SelStart; - int SelEnd; -}; - - -struct EditorSetString -{ - int StringNumber; - const wchar_t *StringText; - const wchar_t *StringEOL; - int StringLength; -}; - -enum EXPAND_TABS -{ - EXPAND_NOTABS, - EXPAND_ALLTABS, - EXPAND_NEWTABS -}; - - -enum EDITOR_OPTIONS -{ - EOPT_EXPANDALLTABS = 0x00000001, - EOPT_PERSISTENTBLOCKS = 0x00000002, - EOPT_DELREMOVESBLOCKS = 0x00000004, - EOPT_AUTOINDENT = 0x00000008, - EOPT_SAVEFILEPOSITION = 0x00000010, - EOPT_AUTODETECTCODEPAGE= 0x00000020, - EOPT_CURSORBEYONDEOL = 0x00000040, - EOPT_EXPANDONLYNEWTABS = 0x00000080, - EOPT_SHOWWHITESPACE = 0x00000100, - EOPT_BOM = 0x00000200, -}; - - -enum EDITOR_BLOCK_TYPES -{ - BTYPE_NONE, - BTYPE_STREAM, - BTYPE_COLUMN -}; - -enum EDITOR_CURRENTSTATE -{ - ECSTATE_MODIFIED = 0x00000001, - ECSTATE_SAVED = 0x00000002, - ECSTATE_LOCKED = 0x00000004, -}; - - -struct EditorInfo -{ - int EditorID; - int WindowSizeX; - int WindowSizeY; - int TotalLines; - int CurLine; - int CurPos; - int CurTabPos; - int TopScreenLine; - int LeftPos; - int Overtype; - int BlockType; - int BlockStartLine; - DWORD Options; - int TabSize; - int BookMarkCount; - DWORD CurState; - UINT CodePage; - DWORD Reserved[5]; -}; - -struct EditorBookMarks -{ - long *Line; - long *Cursor; - long *ScreenLine; - long *LeftPos; - DWORD Reserved[4]; -}; - -struct EditorSetPosition -{ - int CurLine; - int CurPos; - int CurTabPos; - int TopScreenLine; - int LeftPos; - int Overtype; -}; - - -struct EditorSelect -{ - int BlockType; - int BlockStartLine; - int BlockStartPos; - int BlockWidth; - int BlockHeight; -}; - - -struct EditorConvertPos -{ - int StringNumber; - int SrcPos; - int DestPos; -}; - - -enum EDITORCOLORFLAGS -{ - ECF_TAB1 = 0x10000, -}; - -struct EditorColor -{ - int StringNumber; - int ColorItem; - int StartPos; - int EndPos; - int Color; -}; - -struct EditorSaveFile -{ - const wchar_t *FileName; - const wchar_t *FileEOL; - UINT CodePage; -}; - -typedef int (WINAPI *FARAPIEDITORCONTROL)( - int Command, - void *Param -); - -enum INPUTBOXFLAGS -{ - FIB_ENABLEEMPTY = 0x00000001, - FIB_PASSWORD = 0x00000002, - FIB_EXPANDENV = 0x00000004, - FIB_NOUSELASTHISTORY = 0x00000008, - FIB_BUTTONS = 0x00000010, - FIB_NOAMPERSAND = 0x00000020, - FIB_EDITPATH = 0x01000000, -}; - -typedef int (WINAPI *FARAPIINPUTBOX)( - const wchar_t *Title, - const wchar_t *SubTitle, - const wchar_t *HistoryName, - const wchar_t *SrcText, - wchar_t *DestText, - int DestLength, - const wchar_t *HelpTopic, - DWORD Flags -); - -typedef int (WINAPI *FARAPIPLUGINSCONTROL)( - HANDLE hHandle, - int Command, - int Param1, - LONG_PTR Param2 -); - -typedef int (WINAPI *FARAPIFILEFILTERCONTROL)( - HANDLE hHandle, - int Command, - int Param1, - LONG_PTR Param2 -); - -typedef int (WINAPI *FARAPIREGEXPCONTROL)( - HANDLE hHandle, - int Command, - LONG_PTR Param -); - -// -typedef int (WINAPIV *FARSTDSPRINTF)(wchar_t *Buffer,const wchar_t *Format,...); -typedef int (WINAPIV *FARSTDSNPRINTF)(wchar_t *Buffer,size_t Sizebuf,const wchar_t *Format,...); -typedef int (WINAPIV *FARSTDSSCANF)(const wchar_t *Buffer, const wchar_t *Format,...); -// -typedef void (WINAPI *FARSTDQSORT)(void *base, size_t nelem, size_t width, int (__cdecl *fcmp)(const void *, const void *)); -typedef void (WINAPI *FARSTDQSORTEX)(void *base, size_t nelem, size_t width, int (__cdecl *fcmp)(const void *, const void *,void *userparam),void *userparam); -typedef void *(WINAPI *FARSTDBSEARCH)(const void *key, const void *base, size_t nelem, size_t width, int (__cdecl *fcmp)(const void *, const void *)); -typedef int (WINAPI *FARSTDGETFILEOWNER)(const wchar_t *Computer,const wchar_t *Name,wchar_t *Owner,int Size); -typedef int (WINAPI *FARSTDGETNUMBEROFLINKS)(const wchar_t *Name); -typedef int (WINAPI *FARSTDATOI)(const wchar_t *s); -typedef __int64(WINAPI *FARSTDATOI64)(const wchar_t *s); -typedef wchar_t *(WINAPI *FARSTDITOA64)(__int64 value, wchar_t *string, int radix); -typedef wchar_t *(WINAPI *FARSTDITOA)(int value, wchar_t *string, int radix); -typedef wchar_t *(WINAPI *FARSTDLTRIM)(wchar_t *Str); -typedef wchar_t *(WINAPI *FARSTDRTRIM)(wchar_t *Str); -typedef wchar_t *(WINAPI *FARSTDTRIM)(wchar_t *Str); -typedef wchar_t *(WINAPI *FARSTDTRUNCSTR)(wchar_t *Str,int MaxLength); -typedef wchar_t *(WINAPI *FARSTDTRUNCPATHSTR)(wchar_t *Str,int MaxLength); -typedef wchar_t *(WINAPI *FARSTDQUOTESPACEONLY)(wchar_t *Str); -typedef const wchar_t*(WINAPI *FARSTDPOINTTONAME)(const wchar_t *Path); -typedef int (WINAPI *FARSTDGETPATHROOT)(const wchar_t *Path,wchar_t *Root, int DestSize); -typedef BOOL (WINAPI *FARSTDADDENDSLASH)(wchar_t *Path); -typedef int (WINAPI *FARSTDCOPYTOCLIPBOARD)(const wchar_t *Data); -typedef wchar_t *(WINAPI *FARSTDPASTEFROMCLIPBOARD)(void); -typedef int (WINAPI *FARSTDINPUTRECORDTOKEY)(const INPUT_RECORD *r); -typedef int (WINAPI *FARSTDLOCALISLOWER)(wchar_t Ch); -typedef int (WINAPI *FARSTDLOCALISUPPER)(wchar_t Ch); -typedef int (WINAPI *FARSTDLOCALISALPHA)(wchar_t Ch); -typedef int (WINAPI *FARSTDLOCALISALPHANUM)(wchar_t Ch); -typedef wchar_t (WINAPI *FARSTDLOCALUPPER)(wchar_t LowerChar); -typedef wchar_t (WINAPI *FARSTDLOCALLOWER)(wchar_t UpperChar); -typedef void (WINAPI *FARSTDLOCALUPPERBUF)(wchar_t *Buf,int Length); -typedef void (WINAPI *FARSTDLOCALLOWERBUF)(wchar_t *Buf,int Length); -typedef void (WINAPI *FARSTDLOCALSTRUPR)(wchar_t *s1); -typedef void (WINAPI *FARSTDLOCALSTRLWR)(wchar_t *s1); -typedef int (WINAPI *FARSTDLOCALSTRICMP)(const wchar_t *s1,const wchar_t *s2); -typedef int (WINAPI *FARSTDLOCALSTRNICMP)(const wchar_t *s1,const wchar_t *s2,int n); - -enum PROCESSNAME_FLAGS -{ - PN_CMPNAME = 0x00000000UL, - PN_CMPNAMELIST = 0x00010000UL, - PN_GENERATENAME = 0x00020000UL, - PN_SKIPPATH = 0x01000000UL, -}; - -typedef int (WINAPI *FARSTDPROCESSNAME)(const wchar_t *param1, wchar_t *param2, DWORD size, DWORD flags); - -typedef void (WINAPI *FARSTDUNQUOTE)(wchar_t *Str); - -enum XLATMODE -{ - XLAT_SWITCHKEYBLAYOUT = 0x00000001UL, - XLAT_SWITCHKEYBBEEP = 0x00000002UL, - XLAT_USEKEYBLAYOUTNAME = 0x00000004UL, - XLAT_CONVERTALLCMDLINE = 0x00010000UL, -}; - -typedef size_t (WINAPI *FARSTDKEYTOKEYNAME)(int Key,wchar_t *KeyText,size_t Size); - -typedef wchar_t*(WINAPI *FARSTDXLAT)(wchar_t *Line,int StartPos,int EndPos,DWORD Flags); - -typedef int (WINAPI *FARSTDKEYNAMETOKEY)(const wchar_t *Name); - -typedef int (WINAPI *FRSUSERFUNC)( - const struct FAR_FIND_DATA *FData, - const wchar_t *FullName, - void *Param -); - -enum FRSMODE -{ - FRS_RETUPDIR = 0x01, - FRS_RECUR = 0x02, - FRS_SCANSYMLINK = 0x04, -}; - -typedef void (WINAPI *FARSTDRECURSIVESEARCH)(const wchar_t *InitDir,const wchar_t *Mask,FRSUSERFUNC Func,DWORD Flags,void *Param); -typedef int (WINAPI *FARSTDMKTEMP)(wchar_t *Dest, DWORD size, const wchar_t *Prefix); -typedef void (WINAPI *FARSTDDELETEBUFFER)(void *Buffer); - -enum MKLINKOP -{ - FLINK_HARDLINK = 1, - FLINK_JUNCTION = 2, - FLINK_VOLMOUNT = 3, - FLINK_SYMLINKFILE = 4, - FLINK_SYMLINKDIR = 5, - FLINK_SYMLINK = 6, - - FLINK_SHOWERRMSG = 0x10000, - FLINK_DONOTUPDATEPANEL = 0x20000, -}; -typedef int (WINAPI *FARSTDMKLINK)(const wchar_t *Src,const wchar_t *Dest,DWORD Flags); -typedef int (WINAPI *FARGETREPARSEPOINTINFO)(const wchar_t *Src, wchar_t *Dest,int DestSize); - -enum CONVERTPATHMODES -{ - CPM_FULL, - CPM_REAL, - CPM_NATIVE, -}; - -typedef int (WINAPI *FARCONVERTPATH)(enum CONVERTPATHMODES Mode, const wchar_t *Src, wchar_t *Dest, int DestSize); - -typedef DWORD (WINAPI *FARGETCURRENTDIRECTORY)(DWORD Size,wchar_t* Buffer); - -typedef struct FarStandardFunctions -{ - int StructSize; - - FARSTDATOI atoi; - FARSTDATOI64 atoi64; - FARSTDITOA itoa; - FARSTDITOA64 itoa64; - // - FARSTDSPRINTF sprintf; - FARSTDSSCANF sscanf; - // - FARSTDQSORT qsort; - FARSTDBSEARCH bsearch; - FARSTDQSORTEX qsortex; - // - FARSTDSNPRINTF snprintf; - // - - DWORD_PTR Reserved[8]; - - FARSTDLOCALISLOWER LIsLower; - FARSTDLOCALISUPPER LIsUpper; - FARSTDLOCALISALPHA LIsAlpha; - FARSTDLOCALISALPHANUM LIsAlphanum; - FARSTDLOCALUPPER LUpper; - FARSTDLOCALLOWER LLower; - FARSTDLOCALUPPERBUF LUpperBuf; - FARSTDLOCALLOWERBUF LLowerBuf; - FARSTDLOCALSTRUPR LStrupr; - FARSTDLOCALSTRLWR LStrlwr; - FARSTDLOCALSTRICMP LStricmp; - FARSTDLOCALSTRNICMP LStrnicmp; - - FARSTDUNQUOTE Unquote; - FARSTDLTRIM LTrim; - FARSTDRTRIM RTrim; - FARSTDTRIM Trim; - FARSTDTRUNCSTR TruncStr; - FARSTDTRUNCPATHSTR TruncPathStr; - FARSTDQUOTESPACEONLY QuoteSpaceOnly; - FARSTDPOINTTONAME PointToName; - FARSTDGETPATHROOT GetPathRoot; - FARSTDADDENDSLASH AddEndSlash; - FARSTDCOPYTOCLIPBOARD CopyToClipboard; - FARSTDPASTEFROMCLIPBOARD PasteFromClipboard; - FARSTDKEYTOKEYNAME FarKeyToName; - FARSTDKEYNAMETOKEY FarNameToKey; - FARSTDINPUTRECORDTOKEY FarInputRecordToKey; - FARSTDXLAT XLat; - FARSTDGETFILEOWNER GetFileOwner; - FARSTDGETNUMBEROFLINKS GetNumberOfLinks; - FARSTDRECURSIVESEARCH FarRecursiveSearch; - FARSTDMKTEMP MkTemp; - FARSTDDELETEBUFFER DeleteBuffer; - FARSTDPROCESSNAME ProcessName; - FARSTDMKLINK MkLink; - FARCONVERTPATH ConvertPath; - FARGETREPARSEPOINTINFO GetReparsePointInfo; - FARGETCURRENTDIRECTORY GetCurrentDirectory; -} FARSTANDARDFUNCTIONS; - -struct PluginStartupInfo -{ - int StructSize; - const wchar_t *ModuleName; - INT_PTR ModuleNumber; - const wchar_t *RootKey; - FARAPIMENU Menu; - FARAPIMESSAGE Message; - FARAPIGETMSG GetMsg; - FARAPICONTROL Control; - FARAPISAVESCREEN SaveScreen; - FARAPIRESTORESCREEN RestoreScreen; - FARAPIGETDIRLIST GetDirList; - FARAPIGETPLUGINDIRLIST GetPluginDirList; - FARAPIFREEDIRLIST FreeDirList; - FARAPIFREEPLUGINDIRLIST FreePluginDirList; - FARAPIVIEWER Viewer; - FARAPIEDITOR Editor; - FARAPICMPNAME CmpName; - FARAPITEXT Text; - FARAPIEDITORCONTROL EditorControl; - - FARSTANDARDFUNCTIONS *FSF; - - FARAPISHOWHELP ShowHelp; - FARAPIADVCONTROL AdvControl; - FARAPIINPUTBOX InputBox; - FARAPIDIALOGINIT DialogInit; - FARAPIDIALOGRUN DialogRun; - FARAPIDIALOGFREE DialogFree; - - FARAPISENDDLGMESSAGE SendDlgMessage; - FARAPIDEFDLGPROC DefDlgProc; - DWORD_PTR Reserved; - FARAPIVIEWERCONTROL ViewerControl; - FARAPIPLUGINSCONTROL PluginsControl; - FARAPIFILEFILTERCONTROL FileFilterControl; - FARAPIREGEXPCONTROL RegExpControl; -}; - - -enum PLUGIN_FLAGS -{ - PF_PRELOAD = 0x0001, - PF_DISABLEPANELS = 0x0002, - PF_EDITOR = 0x0004, - PF_VIEWER = 0x0008, - PF_FULLCMDLINE = 0x0010, - PF_DIALOG = 0x0020, -}; - -struct PluginInfo -{ - int StructSize; - DWORD Flags; - const wchar_t * const *DiskMenuStrings; - int *Reserved0; - int DiskMenuStringsNumber; - const wchar_t * const *PluginMenuStrings; - int PluginMenuStringsNumber; - const wchar_t * const *PluginConfigStrings; - int PluginConfigStringsNumber; - const wchar_t *CommandPrefix; - DWORD Reserved; -}; - - - -struct InfoPanelLine -{ - const wchar_t *Text; - const wchar_t *Data; - int Separator; -}; - -struct PanelMode -{ - const wchar_t *ColumnTypes; - const wchar_t *ColumnWidths; - const wchar_t * const *ColumnTitles; - int FullScreen; - int DetailedStatus; - int AlignExtensions; - int CaseConversion; - const wchar_t *StatusColumnTypes; - const wchar_t *StatusColumnWidths; - DWORD Reserved[2]; -}; - - -enum OPENPLUGININFO_FLAGS -{ - OPIF_USEFILTER = 0x00000001, - OPIF_USESORTGROUPS = 0x00000002, - OPIF_USEHIGHLIGHTING = 0x00000004, - OPIF_ADDDOTS = 0x00000008, - OPIF_RAWSELECTION = 0x00000010, - OPIF_REALNAMES = 0x00000020, - OPIF_SHOWNAMESONLY = 0x00000040, - OPIF_SHOWRIGHTALIGNNAMES = 0x00000080, - OPIF_SHOWPRESERVECASE = 0x00000100, - OPIF_COMPAREFATTIME = 0x00000400, - OPIF_EXTERNALGET = 0x00000800, - OPIF_EXTERNALPUT = 0x00001000, - OPIF_EXTERNALDELETE = 0x00002000, - OPIF_EXTERNALMKDIR = 0x00004000, - OPIF_USEATTRHIGHLIGHTING = 0x00008000, - OPIF_USECRC32 = 0x00010000, -}; - - -enum OPENPLUGININFO_SORTMODES -{ - SM_DEFAULT, - SM_UNSORTED, - SM_NAME, - SM_EXT, - SM_MTIME, - SM_CTIME, - SM_ATIME, - SM_SIZE, - SM_DESCR, - SM_OWNER, - SM_COMPRESSEDSIZE, - SM_NUMLINKS, - SM_NUMSTREAMS, - SM_STREAMSSIZE, - SM_FULLNAME, - SM_CHTIME, -}; - - -struct KeyBarTitles -{ - wchar_t *Titles[12]; - wchar_t *CtrlTitles[12]; - wchar_t *AltTitles[12]; - wchar_t *ShiftTitles[12]; - - wchar_t *CtrlShiftTitles[12]; - wchar_t *AltShiftTitles[12]; - wchar_t *CtrlAltTitles[12]; -}; - - -enum OPERATION_MODES -{ - OPM_SILENT =0x0001, - OPM_FIND =0x0002, - OPM_VIEW =0x0004, - OPM_EDIT =0x0008, - OPM_TOPLEVEL =0x0010, - OPM_DESCR =0x0020, - OPM_QUICKVIEW =0x0040, -}; - -struct OpenPluginInfo -{ - int StructSize; - DWORD Flags; - const wchar_t *HostFile; - const wchar_t *CurDir; - const wchar_t *Format; - const wchar_t *PanelTitle; - const struct InfoPanelLine *InfoLines; - int InfoLinesNumber; - const wchar_t * const *DescrFiles; - int DescrFilesNumber; - const struct PanelMode *PanelModesArray; - int PanelModesNumber; - int StartPanelMode; - int StartSortMode; - int StartSortOrder; - const struct KeyBarTitles *KeyBar; - const wchar_t *ShortcutData; - long Reserved; -}; - -enum OPENPLUGIN_OPENFROM -{ - OPEN_FROM_MASK = 0x000000FF, - - OPEN_DISKMENU = 0, - OPEN_PLUGINSMENU = 1, - OPEN_FINDLIST = 2, - OPEN_SHORTCUT = 3, - OPEN_COMMANDLINE = 4, - OPEN_EDITOR = 5, - OPEN_VIEWER = 6, - OPEN_FILEPANEL = 7, - OPEN_DIALOG = 8, - OPEN_ANALYSE = 9, - - OPEN_FROMMACRO_MASK = 0x000F0000, - - OPEN_FROMMACRO = 0x00010000, - OPEN_FROMMACROSTRING = 0x00020000, -}; - -enum FAR_PKF_FLAGS -{ - PKF_CONTROL = 0x00000001, - PKF_ALT = 0x00000002, - PKF_SHIFT = 0x00000004, - PKF_PREPROCESS = 0x00080000, // for "Key", function ProcessKey() -}; - -enum FAR_EVENTS -{ - FE_CHANGEVIEWMODE =0, - FE_REDRAW =1, - FE_IDLE =2, - FE_CLOSE =3, - FE_BREAK =4, - FE_COMMAND =5, - - FE_GOTFOCUS =6, - FE_KILLFOCUS =7, -}; - -enum FAR_PLUGINS_CONTROL_COMMANDS -{ - PCTL_LOADPLUGIN = 0, - PCTL_UNLOADPLUGIN = 1, - PCTL_FORCEDLOADPLUGIN = 2, -}; - -enum FAR_PLUGIN_LOAD_TYPE -{ - PLT_PATH = 0, -}; - -enum FAR_FILE_FILTER_CONTROL_COMMANDS -{ - FFCTL_CREATEFILEFILTER = 0, - FFCTL_FREEFILEFILTER, - FFCTL_OPENFILTERSMENU, - FFCTL_STARTINGTOFILTER, - FFCTL_ISFILEINFILTER, -}; - -enum FAR_FILE_FILTER_TYPE -{ - FFT_PANEL = 0, - FFT_FINDFILE, - FFT_COPY, - FFT_SELECT, - FFT_CUSTOM, -}; - -enum FAR_REGEXP_CONTROL_COMMANDS -{ - RECTL_CREATE=0, - RECTL_FREE, - RECTL_COMPILE, - RECTL_OPTIMIZE, - RECTL_MATCHEX, - RECTL_SEARCHEX, - RECTL_BRACKETSCOUNT -}; - -struct RegExpMatch -{ - int start,end; -}; - -struct RegExpSearch -{ - const wchar_t* Text; - int Position; - int Length; - struct RegExpMatch* Match; - int Count; - void* Reserved; -}; - - -#if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__GNUC__) || defined(__WATCOMC__) -#ifdef __cplusplus -extern "C" -{ -#endif -// Exported Functions - - void WINAPI _export ClosePluginW(HANDLE hPlugin); - int WINAPI _export CompareW(HANDLE hPlugin,const struct PluginPanelItem *Item1,const struct PluginPanelItem *Item2,unsigned int Mode); - int WINAPI _export ConfigureW(int ItemNumber); - int WINAPI _export DeleteFilesW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int OpMode); - void WINAPI _export ExitFARW(void); - void WINAPI _export FreeFindDataW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber); - void WINAPI _export FreeVirtualFindDataW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber); - int WINAPI _export GetFilesW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int Move,const wchar_t **DestPath,int OpMode); - int WINAPI _export GetFindDataW(HANDLE hPlugin,struct PluginPanelItem **pPanelItem,int *pItemsNumber,int OpMode); - int WINAPI _export GetMinFarVersionW(void); - void WINAPI _export GetOpenPluginInfoW(HANDLE hPlugin,struct OpenPluginInfo *Info); - void WINAPI _export GetPluginInfoW(struct PluginInfo *Info); - int WINAPI _export GetVirtualFindDataW(HANDLE hPlugin,struct PluginPanelItem **pPanelItem,int *pItemsNumber,const wchar_t *Path); - int WINAPI _export MakeDirectoryW(HANDLE hPlugin,const wchar_t **Name,int OpMode); - HANDLE WINAPI _export OpenFilePluginW(const wchar_t *Name,const unsigned char *Data,int DataSize,int OpMode); - HANDLE WINAPI _export OpenPluginW(int OpenFrom,INT_PTR Item); - int WINAPI _export ProcessDialogEventW(int Event,void *Param); - int WINAPI _export ProcessEditorEventW(int Event,void *Param); - int WINAPI _export ProcessEditorInputW(const INPUT_RECORD *Rec); - int WINAPI _export ProcessEventW(HANDLE hPlugin,int Event,void *Param); - int WINAPI _export ProcessHostFileW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int OpMode); - int WINAPI _export ProcessKeyW(HANDLE hPlugin,int Key,unsigned int ControlState); - int WINAPI _export ProcessSynchroEventW(int Event,void *Param); - int WINAPI _export ProcessViewerEventW(int Event,void *Param); - int WINAPI _export PutFilesW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int Move,const wchar_t *SrcPath,int OpMode); - int WINAPI _export SetDirectoryW(HANDLE hPlugin,const wchar_t *Dir,int OpMode); - int WINAPI _export SetFindListW(HANDLE hPlugin,const struct PluginPanelItem *PanelItem,int ItemsNumber); - void WINAPI _export SetStartupInfoW(const struct PluginStartupInfo *Info); - -#ifdef __cplusplus -}; -#endif -#endif - -#ifndef _WIN64 -#if defined(__BORLANDC__) -#pragma option -a. -#elif defined(__GNUC__) || (defined(__WATCOMC__) && (__WATCOMC__ < 1100)) || defined(__LCC__) -#pragma pack() -#else -#pragma pack(pop) -#endif -#endif - -#endif /* RC_INVOKED */ - -#endif /* __PLUGIN_HPP__ */ diff --git a/depends/farhelpers/Far2Menu.hpp b/depends/farhelpers/Far2Menu.hpp deleted file mode 100644 index 60585d2..0000000 --- a/depends/farhelpers/Far2Menu.hpp +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef Far2Menu_h__ -#define Far2Menu_h__ - -#ifndef __cplusplus -#error C++ only -#endif - -typedef std::function MenuAction; - -#define OPT_STR_VAL(str) (!str.empty() ? str.c_str() : nullptr) -#define PTR2STR(ptr) (ptr ? ptr : L"") - -class FarMenu -{ -protected: - const PluginStartupInfo* m_SInfo; - - FARMENUFLAGS m_Flags; - intptr_t m_MaxHeight; - std::wstring m_Title; - std::wstring m_Bottom; - std::wstring m_HelpTopic; - - std::vector m_Items; - std::vector m_Actions; - -public: - FarMenu(const PluginStartupInfo* SInfo, const wchar_t* aTitle, const wchar_t* aBottom = nullptr) - { - m_SInfo = SInfo; - - m_Title = PTR2STR(aTitle); - m_Bottom = PTR2STR(aBottom); - - m_Flags = FMENU_USEEXT; - m_MaxHeight = 0; - } - - void SetMaxHeight(intptr_t aMaxHeight) { m_MaxHeight = aMaxHeight; } - void SetFlags(FARMENUFLAGS aFlags) { m_Flags = aFlags; } - void SetHelpTopic(const wchar_t* aHelpTopic) { m_HelpTopic = PTR2STR(aHelpTopic); } - - void AddItem(const wchar_t* aText, MENUITEMFLAGS aFlags = (MENUITEMFLAGS) 0, DWORD_PTR aUserData = 0) - { - AddItemEx(aText, NULL, aFlags, aUserData); - } - - void AddItemEx(const wchar_t* aText, MenuAction aAction, MENUITEMFLAGS aFlags = (MENUITEMFLAGS) 0, DWORD_PTR aUserData = 0) - { - FarMenuItemEx item = {0}; - - item.Text = aText; - item.Flags = aFlags | FMENU_USEEXT; - item.UserData = aUserData; - - m_Items.push_back(item); - m_Actions.push_back(aAction); - } - - void AddSeparator() - { - AddItem(nullptr, MIF_SEPARATOR); - } - - void Clear() { m_Items.clear(); m_Actions.clear(); } - - size_t ItemCount() { return m_Items.size(); } - - // Returns index of selected menu item - intptr_t Run() - { - return m_SInfo->Menu(m_SInfo->ModuleNumber, -1, -1, (int) m_MaxHeight, m_Flags, OPT_STR_VAL(m_Title), OPT_STR_VAL(m_Bottom), OPT_STR_VAL(m_HelpTopic), nullptr, nullptr, (FarMenuItem*) &m_Items[0], (int) m_Items.size()); - } - - bool RunEx() - { - intptr_t rc = Run(); - if (rc >= 0) - { - // Execute binded action - if (rc <= (intptr_t) m_Actions.size()) - { - MenuAction &action = m_Actions[rc]; - FarMenuItemEx &item = m_Items[rc]; - if (action) action(item.UserData); - } - return true; - } - - return false; - } -}; - -#endif // Far2Menu_h__ diff --git a/depends/rhash/rhash.vcxproj b/depends/rhash/rhash.vcxproj index 311cf37..b1ef9da 100644 --- a/depends/rhash/rhash.vcxproj +++ b/depends/rhash/rhash.vcxproj @@ -1,14 +1,6 @@  - - Debug-Far2 - Win32 - - - Debug-Far2 - x64 - Debug-Far3 Win32 @@ -17,14 +9,6 @@ Debug-Far3 x64 - - Release-Far2 - Win32 - - - Release-Far2 - x64 - Release-Far3 Win32 @@ -51,17 +35,6 @@ Unicode v142 - - StaticLibrary - Unicode - true - v142 - - - StaticLibrary - Unicode - v142 - StaticLibrary Unicode @@ -73,17 +46,6 @@ Unicode v142 - - StaticLibrary - Unicode - true - v142 - - - StaticLibrary - Unicode - v142 - @@ -93,35 +55,15 @@ - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ - $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ - $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ - $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ - $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ - $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ - $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ - $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ @@ -130,24 +72,12 @@ $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ - AllRules.ruleset - - - AllRules.ruleset - - AllRules.ruleset AllRules.ruleset - AllRules.ruleset - - - AllRules.ruleset - - AllRules.ruleset @@ -155,74 +85,6 @@ - - - Disabled - .\win32\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - 4267;%(DisableSpecificWarnings) - ..\version.h - - - - - X64 - - - Disabled - .\win32\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - 4267;%(DisableSpecificWarnings) - ..\version.h - - - - - MaxSpeed - true - .\win32\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - MultiThreaded - true - - - Level3 - ProgramDatabase - 4267;%(DisableSpecificWarnings) - ..\version.h - - - - - X64 - - - MaxSpeed - true - .\win32\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - MultiThreaded - true - - - Level3 - ProgramDatabase - 4267;%(DisableSpecificWarnings) - ..\version.h - - Disabled diff --git a/source/IntChecker2-Far2.cpp b/source/IntChecker2-Far2.cpp deleted file mode 100644 index 1f5f4d6..0000000 --- a/source/IntChecker2-Far2.cpp +++ /dev/null @@ -1,1309 +0,0 @@ -// IntChecker2.cpp : Defines the exported functions for the DLL application. -// - -#include "stdafx.h" -#include "far2/plugin.hpp" -#include "Utils.h" -#include "RegistrySettings.h" - -#include "FarCommon.h" -#include "farhelpers/Far2Menu.hpp" - -// --------------------------------------- Service functions ------------------------------------------------- - -static const wchar_t* GetLocMsg(int MsgID) -{ - return FarSInfo.GetMsg(FarSInfo.ModuleNumber, MsgID); -} - -static void DisplayMessage(const wchar_t* headerText, const wchar_t* messageText, const wchar_t* errorItem, bool isError, bool isInteractive) -{ - static const wchar_t* MsgLines[3]; - MsgLines[0] = headerText; - MsgLines[1] = messageText; - MsgLines[2] = errorItem; - - int linesNum = (errorItem) ? 3 : 2; - int flags = 0; - if (isError) flags |= FMSG_WARNING; - if (isInteractive) flags |= FMSG_MB_OK; - - FarSInfo.Message(FarSInfo.ModuleNumber, flags, NULL, MsgLines, linesNum, 0); -} - -static void DisplayMessage(int headerMsgID, int textMsgID, const wchar_t* errorItem, bool isError, bool isInteractive) -{ - DisplayMessage(GetLocMsg(headerMsgID), GetLocMsg(textMsgID), errorItem, isError, isInteractive); -} - -static bool ConfirmMessage(const wchar_t* headerText, const wchar_t* messageText, bool isWarning) -{ - static const wchar_t* MsgLines[2]; - MsgLines[0] = headerText; - MsgLines[1] = messageText; - - int flags = FMSG_MB_YESNO; - if (isWarning) flags |= FMSG_WARNING; - - int resp = FarSInfo.Message(FarSInfo.ModuleNumber, flags, NULL, MsgLines, 2, 0); - return (resp == 0); -} - -static bool ConfirmMessage(int headerMsgID, int textMsgID, bool isWarning) -{ - return ConfirmMessage(GetLocMsg(headerMsgID), GetLocMsg(textMsgID), isWarning); -} - -static bool DlgHlp_GetSelectionState(HANDLE hDlg, int ctrlIndex) -{ - FarDialogItem *dlgItem; - int retVal; - - dlgItem = (FarDialogItem*) malloc(FarSInfo.SendDlgMessage(hDlg, DM_GETDLGITEM, ctrlIndex, NULL)); - FarSInfo.SendDlgMessage(hDlg, DM_GETDLGITEM, ctrlIndex, (LONG_PTR) dlgItem); - retVal = dlgItem->Selected; - free(dlgItem); - - return retVal != 0; -} - -static void DlgHlp_GetEditBoxText(HANDLE hDlg, int ctrlIndex, wstring &buf) -{ - FarDialogItem *dlgItem; - - dlgItem = (FarDialogItem*) malloc(FarSInfo.SendDlgMessage(hDlg, DM_GETDLGITEM, ctrlIndex, NULL)); - FarSInfo.SendDlgMessage(hDlg, DM_GETDLGITEM, ctrlIndex, (LONG_PTR) dlgItem); - - buf = dlgItem->PtrData; - - free(dlgItem); -} - -static bool DlgHlp_GetEditBoxText(HANDLE hDlg, int ctrlIndex, wchar_t* buf, size_t bufSize) -{ - wstring tmpStr; - DlgHlp_GetEditBoxText(hDlg, ctrlIndex, tmpStr); - - if (tmpStr.size() < bufSize) - { - wcscpy_s(buf, bufSize, tmpStr.c_str()); - return true; - } - - return false; -} - -static bool GetPanelDir(HANDLE hPanel, wstring& dirStr) -{ - wchar_t *wszPanelDir; - int nBufSize; - bool ret = false; - - nBufSize = FarSInfo.Control(hPanel, FCTL_GETPANELDIR, 0, NULL); - wszPanelDir = (wchar_t*) malloc((nBufSize+1) * sizeof(wchar_t)); - if (FarSInfo.Control(hPanel, FCTL_GETPANELDIR, nBufSize + 1, (LONG_PTR) wszPanelDir)) - { - dirStr.assign(wszPanelDir); - IncludeTrailingPathDelim(dirStr); - ret = true; - } - - free(wszPanelDir); - return ret; -} - -static bool GetSelectedPanelItemPath(wstring& nameStr) -{ - nameStr.clear(); - - PanelInfo pi = {0}; - if (FarSInfo.Control(PANEL_ACTIVE, FCTL_GETPANELINFO, 0, (LONG_PTR)&pi)) - if ((pi.SelectedItemsNumber == 1) && (pi.PanelType == PTYPE_FILEPANEL)) - { - wstring panelDir; - GetPanelDir(PANEL_ACTIVE, panelDir); - - PluginPanelItem *PPI = (PluginPanelItem*)malloc(FarSInfo.Control(PANEL_ACTIVE, FCTL_GETCURRENTPANELITEM, 0, NULL)); - if (PPI) - { - FarSInfo.Control(PANEL_ACTIVE, FCTL_GETCURRENTPANELITEM, 0, (LONG_PTR)PPI); - nameStr = panelDir + PPI->FindData.lpwszFileName; - free(PPI); - } - } - - return (nameStr.size() > 0); -} - -static void GetSelectedPanelFiles(PanelInfo &pi, wstring &panelDir, StringList &vDest, int64_t &totalSize, bool recursive) -{ - for (int i = 0; i < pi.SelectedItemsNumber; i++) - { - size_t requiredBytes = FarSInfo.Control(PANEL_ACTIVE, FCTL_GETSELECTEDPANELITEM, i, NULL); - PluginPanelItem *PPI = (PluginPanelItem*)malloc(requiredBytes); - if (PPI) - { - FarSInfo.Control(PANEL_ACTIVE, FCTL_GETSELECTEDPANELITEM, i, (LONG_PTR)PPI); - if (wcscmp(PPI->FindData.lpwszFileName, L"..") && wcscmp(PPI->FindData.lpwszFileName, L".")) - { - if ((PPI->FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) - { - vDest.push_back(PPI->FindData.lpwszFileName); - totalSize += PPI->FindData.nFileSize; - } - else - { - wstring strSelectedDir = panelDir + PPI->FindData.lpwszFileName; - PrepareFilesList(strSelectedDir.c_str(), PPI->FindData.lpwszFileName, vDest, totalSize, recursive, nullptr, INVALID_HANDLE_VALUE); - } - } - free(PPI); - } - } -} - -static bool GetFarWindowSize(RectSize &size) -{ - SMALL_RECT farRect; - if (FarSInfo.AdvControl(FarSInfo.ModuleNumber, ACTL_GETFARRECT, &farRect)) - { - size.Assign(farRect); - return true; - } - - return false; -} - -static int AdjustDialogBorder(FarDialogItem *DialogItems, int NumItems) -{ - // Expand right border of the dialog if text is too long to fit - int borderX2 = DialogItems[0].X2; - for (int i = 1; i < NumItems; i++) - { - if (DialogItems[i].Type == DI_CHECKBOX) - { - int itemRigthBorder = DialogItems[i].X1 + 4 + (int) wcslen(DialogItems[i].PtrData) + 1; - if (itemRigthBorder > borderX2) - { - borderX2 = itemRigthBorder; - DialogItems[0].X2 = itemRigthBorder; - } - } - else if (DialogItems[i].Type == DI_COMBOBOX) - { - int rightBorder = DialogItems[i].X2 + 2; - if (rightBorder > borderX2) - { - borderX2 = rightBorder; - DialogItems[0].X2 = rightBorder; - } - } - } - - return borderX2; -} - -// --------------------------------------- Local functions --------------------------------------------------- - -static void LoadSettings() -{ - RegistrySettings regOpts(FarSInfo.RootKey); - if (regOpts.Open()) - { - regOpts.GetValue(L"DetectHashFiles", optDetectHashFiles); - regOpts.GetValue(L"ClearSelection", optClearSelectionOnComplete); - regOpts.GetValue(L"ConfirmAbort", optConfirmAbort); - regOpts.GetValue(L"DefaultHash", optDefaultAlgo); - regOpts.GetValue(L"Prefix", optPrefix, ARRAY_SIZE(optPrefix)); - regOpts.GetValue(L"UsePrefix", optUsePrefix); - regOpts.GetValue(L"AutoExtension", optAutoExtension); - regOpts.GetValue(L"HashInUppercase", optHashUppercase); - regOpts.GetValue(L"RememberLastAlgorithm", optRememberLastUsedAlgo); - regOpts.GetValue(L"DefaultListCodepage", optListDefaultCodepage); - regOpts.GetValue(L"DefaultOutput", optDefaultOutputTarget); - } -} - -static void SaveSettings() -{ - RegistrySettings regOpts(FarSInfo.RootKey); - if (regOpts.Open(true)) - { - regOpts.SetValue(L"DetectHashFiles", optDetectHashFiles); - regOpts.SetValue(L"ClearSelection", optClearSelectionOnComplete); - regOpts.SetValue(L"ConfirmAbort", optConfirmAbort); - regOpts.SetValue(L"DefaultHash", optDefaultAlgo); - regOpts.SetValue(L"Prefix", optPrefix); - regOpts.SetValue(L"UsePrefix", optUsePrefix); - regOpts.SetValue(L"AutoExtension", optAutoExtension); - regOpts.SetValue(L"HashInUppercase", optHashUppercase); - regOpts.SetValue(L"RememberLastAlgorithm", optRememberLastUsedAlgo); - regOpts.SetValue(L"DefaultListCodepage", optListDefaultCodepage); - regOpts.SetValue(L"DefaultOutput", optDefaultOutputTarget); - } -} - -static std::wstring FileSizeToString(int64_t fileSize, bool keepBytes) -{ - //todo: implement analog for FSF.FormatFileSize from Far3 - - std::wstring result = FormatString(L"%lld", fileSize); - - if (keepBytes) - { - int cnt = 0; - for (size_t i = result.length() - 1; i > 0; --i) - { - cnt++; - if (cnt % 3 == 0) - result.insert(i, 1, ' '); - } - } - - return result; -} - -static bool CALLBACK FileHashingProgress(HANDLE context, int64_t bytesProcessed) -{ - if (CheckEsc()) - { - if (optConfirmAbort && ConfirmMessage(GetLocMsg(MSG_DLG_CONFIRM), GetLocMsg(MSG_DLG_ASK_ABORT), true)) - return false; - } - - if (context == NULL) return true; - - ProgressContext* prCtx = (ProgressContext*) context; - if (prCtx->IncreaseProcessedBytes(bytesProcessed)) - { - int nFileProgress = prCtx->GetCurrentFileProgress(); - int nTotalProgress = prCtx->GetTotalProgress(); - - static wchar_t szGeneratingLine[128] = { 0 }; - swprintf_s(szGeneratingLine, ARRAY_SIZE(szGeneratingLine), GetLocMsg(MSG_DLG_CALCULATING), prCtx->HashAlgoName.c_str()); - - std::wstring strFilesNumLine = JoinProgressLine(GetLocMsg(MSG_DLG_PROGRESS_NUMFILES), FormatString(L"%d / %d", prCtx->CurrentFileIndex + 1, prCtx->TotalFilesCount), cntProgressDialogWidth, 5); - std::wstring strBytesLine = JoinProgressLine(GetLocMsg(MSG_DLG_PROGRESS_NUMBYTES), FileSizeToString(prCtx->TotalProcessedBytes, true) + L" / " + FileSizeToString(prCtx->TotalFilesSize, true), cntProgressDialogWidth, 5); - - std::wstring strPBarCurrent = ProgressBarString(nFileProgress, cntProgressDialogWidth); - std::wstring strPBarTotal = ProgressBarString(nTotalProgress, cntProgressDialogWidth); - - int64_t elapsedTime = prCtx->GetElapsedTimeMS(); - int64_t avgSpeed = (elapsedTime > 0) ? (prCtx->TotalProcessedBytes * 1000) / elapsedTime : 0; - - std::wstring elapsedTimeStr = L"Time: " + DurationToString(elapsedTime); - //std::wstring avgSpeedStr = FileSizeToString(avgSpeed, false) + L"/s"; - std::wstring avgSpeedStr = L""; //TODO: reenable speed display after proper formatting function is found - std::wstring strSpeed = JoinProgressLine(elapsedTimeStr, avgSpeedStr, cntProgressDialogWidth, 0); - - static const wchar_t* InfoLines[10]; - InfoLines[0] = GetLocMsg(MSG_DLG_PROCESSING); - InfoLines[1] = szGeneratingLine; - InfoLines[2] = prCtx->GetShortenedPath(); - InfoLines[3] = strPBarCurrent.c_str(); - InfoLines[4] = L"\1"; - InfoLines[5] = strFilesNumLine.c_str(); - InfoLines[6] = strBytesLine.c_str(); - InfoLines[7] = strPBarTotal.c_str(); - InfoLines[8] = L"\1"; - InfoLines[9] = strSpeed.c_str(); - - FarSInfo.Message(FarSInfo.ModuleNumber, 0, NULL, InfoLines, ARRAY_SIZE(InfoLines), 0); - - if (prCtx->TotalFilesSize > 0) - { - PROGRESSVALUE pv; - pv.Completed = prCtx->TotalProcessedBytes; - pv.Total = prCtx->TotalFilesSize; - FarSInfo.AdvControl(FarSInfo.ModuleNumber, ACTL_SETPROGRESSVALUE, &pv); - } - } - - return true; -} - -static void SelectFilesOnPanel(HANDLE hPanel, vector &fileNames, bool exclusive) -{ - if (!exclusive && (fileNames.size() == 0)) return; - - PanelInfo pi = {0}; - FarSInfo.Control(hPanel, FCTL_GETPANELINFO, 0, (LONG_PTR)&pi); - - FarSInfo.Control(hPanel, FCTL_BEGINSELECTION, 0, NULL); - for (int i = 0; i < pi.ItemsNumber; i++) - { - PluginPanelItem *PPI = (PluginPanelItem*) malloc(FarSInfo.Control(hPanel, FCTL_GETPANELITEM, i, NULL)); - if (PPI) - { - FarSInfo.Control(hPanel, FCTL_GETPANELITEM, i, (LONG_PTR)PPI); - bool isNameInList = std::find(fileNames.begin(), fileNames.end(), PPI->FindData.lpwszFileName) != fileNames.end(); - if (isNameInList || exclusive) - { - FarSInfo.Control(hPanel, FCTL_SETSELECTION, i, isNameInList ? TRUE : FALSE); - } - free(PPI); - } - } - FarSInfo.Control(hPanel, FCTL_ENDSELECTION, 0, NULL); - FarSInfo.Control(hPanel, FCTL_REDRAWPANEL, 0, NULL); -} - -static int DisplayHashGenerateError(const std::wstring& fileName) -{ - static const wchar_t* DlgLines[7]; - DlgLines[0] = GetLocMsg(MSG_DLG_ERROR); - DlgLines[1] = GetLocMsg(MSG_DLG_FILE_ERROR); - DlgLines[2] = fileName.c_str(); - DlgLines[3] = GetLocMsg(MSG_BTN_SKIP); - DlgLines[4] = GetLocMsg(MSG_BTN_SKIPALL); - DlgLines[5] = GetLocMsg(MSG_BTN_RETRY); - DlgLines[6] = GetLocMsg(MSG_BTN_CANCEL); - - return FarSInfo.Message(FarSInfo.ModuleNumber, FMSG_WARNING, NULL, DlgLines, ARRAY_SIZE(DlgLines), 4); -} - -static bool RunGeneration(const wstring& filePath, const std::wstring& fileDisplayPath, rhash_ids hashAlgo, bool useHashUppercase, ProgressContext& progressCtx, std::string& hashStr, bool &shouldAbort, bool &shouldSkipAllErrors) -{ - progressCtx.NextFile(fileDisplayPath, GetFileSize_i64(filePath.c_str())); - progressCtx.SetAlgorithm(hashAlgo); - - shouldAbort = false; - - while (true) - { - progressCtx.RestartFile(); - - // Next is hash calculation for both files - GenResult genRetVal = GenerateHash(filePath, hashAlgo, hashStr, useHashUppercase, FileHashingProgress, &progressCtx); - - if (genRetVal == GenResult::Aborted) - { - // Exit silently - shouldAbort = true; - return false; - } - else if (genRetVal == GenResult::Error) - { - int errResp = shouldSkipAllErrors ? EDR_SKIP : DisplayHashGenerateError(filePath); - if (errResp == EDR_RETRY) - continue; - - shouldAbort = (errResp == EDR_ABORT); - shouldSkipAllErrors = shouldSkipAllErrors || (errResp == EDR_SKIPALL); - - return false; - } - - break; - } - - return true; -} - -static void DisplayValidationResults(std::vector &vMismatchList, std::vector &vMissingList, int numSkipped) -{ - if (vMismatchList.size() == 0 && vMissingList.size() == 0) - { - // If everything is fine then just display simple message - static wchar_t wszGoodMessage[256]; - if (numSkipped == 0) - wcscpy_s(wszGoodMessage, ARRAY_SIZE(wszGoodMessage), GetLocMsg(MSG_DLG_NO_MISMATCHES)); - else - swprintf_s(wszGoodMessage, ARRAY_SIZE(wszGoodMessage), L"%s (%d %s)", GetLocMsg(MSG_DLG_NO_MISMATCHES), numSkipped, GetLocMsg(MSG_DLG_NUM_SKIPPED)); - - DisplayMessage(GetLocMsg(MSG_DLG_VALIDATION_COMPLETE), wszGoodMessage, NULL, false, true); - } - else - { - // Otherwise display proper list of invalid/missing files - - vector displayStrings; - - size_t nListIndex = 0; - if (vMismatchList.size() > 0) - { - displayStrings.push_back(FormatString(GetLocMsg(MSG_DLG_MISMATCHED_FILES), vMismatchList.size())); - - for (size_t i = 0; i < vMismatchList.size(); i++) - { - wstring &nextFile = vMismatchList[i]; - displayStrings.push_back(FormatString(L" %s", nextFile.c_str())); - } - } - if (vMissingList.size() > 0) - { - displayStrings.push_back(FormatString(GetLocMsg(MSG_DLG_MISSING_FILES), vMissingList.size())); - - for (size_t i = 0; i < vMissingList.size(); i++) - { - wstring &nextFile = vMissingList[i]; - displayStrings.push_back(FormatString(L" %s", nextFile.c_str())); - } - } - - size_t nNumListItems = displayStrings.size(); - FarListItem* mmListItems = (FarListItem*) malloc(nNumListItems * sizeof(FarListItem)); - FarList mmList = {(int)nNumListItems, mmListItems}; - memset(mmListItems, 0, nNumListItems * sizeof(FarListItem)); - - RectSize listSize(57, 14); - FindBestListBoxSize(displayStrings, GetFarWindowSize, listSize); - - for (size_t i = 0; i < nNumListItems; i++) - { - mmListItems[i].Text = displayStrings[i].c_str(); - } - - int nDlgWidth = listSize.Width + 11; - int nDlgHeight = listSize.Height + 7; - - FarDialogItem DialogItems []={ - /*00*/ {DI_DOUBLEBOX, 3, 1,nDlgWidth-4,nDlgHeight-2, 0, 0, 0,0, GetLocMsg(MSG_DLG_VALIDATION_COMPLETE), 0}, - /*01*/ {DI_LISTBOX, 5, 2,nDlgWidth-6,nDlgHeight-5, 0, (DWORD_PTR) &mmList, DIF_LISTNOCLOSE | DIF_LISTNOBOX, 0, NULL, 0}, - /*02*/ {DI_TEXT, 3,nDlgHeight-4, 0, 0, 0, 0, DIF_BOXCOLOR|DIF_SEPARATOR, 0, L"", 0}, - /*03*/ {DI_BUTTON, 0,nDlgHeight-3, 0, 0, 1, 0, DIF_CENTERGROUP, 1, GetLocMsg(MSG_BTN_CLOSE), 0}, - /*04*/ {DI_BUTTON, 0,nDlgHeight-3, 0, 0, 0, 0, DIF_CENTERGROUP, 0, GetLocMsg(MSG_BTN_CLIPBOARD), 0}, - }; - - HANDLE hDlg = FarSInfo.DialogInit(FarSInfo.ModuleNumber, -1, -1, nDlgWidth, nDlgHeight, NULL, - DialogItems, sizeof(DialogItems) / sizeof(DialogItems[0]), 0, 0, FarSInfo.DefDlgProc, 0); - - int ExitCode = FarSInfo.DialogRun(hDlg); - if (ExitCode == 4) // clipboard - { - CopyTextToClipboard(displayStrings); - } - FarSInfo.DialogFree(hDlg); - free(mmListItems); - - // Select mismatched files that are in the same folder - std::vector vSameFolderFiles; - for (size_t i = 0; i < vMismatchList.size(); i++) - { - wstring &nextFile = vMismatchList[i]; - if (nextFile.find_first_of(L"\\/") == wstring::npos) - vSameFolderFiles.push_back(nextFile); - } - SelectFilesOnPanel(PANEL_ACTIVE, vSameFolderFiles, true); - } -} - -static bool AskValidationFileParams(UINT &codepage, int &ignoreMissingFiles) -{ - const wchar_t* codePageNames[] = {L"UTF-8", L"ANSI", L"OEM"}; - const UINT codePageValues[] = {CP_UTF8, CP_ACP, CP_OEMCP}; - - FarListItem cpListItems[ARRAY_SIZE(codePageNames)] = {0}; - FarList cpDlgList = {ARRAY_SIZE(codePageNames), cpListItems}; - - FarDialogItem DialogItems[] = { - /*00*/ { DI_DOUBLEBOX, 3, 1,30, 6, 0, 0, 0,0, GetLocMsg(MSG_MENU_VALIDATE), 0}, - /*01*/ { DI_TEXT, 5, 2, 0, 0, 0, 0, 0, 0, GetLocMsg(MSG_GEN_CODEPAGE), 0}, - /*02*/ { DI_COMBOBOX, 5, 2, 0, 0, 0, (DWORD_PTR)&cpDlgList, DIF_DROPDOWNLIST, 0, NULL, 0}, - /*03*/ { DI_CHECKBOX, 5, 3, 0, 0, 0, (DWORD_PTR)ignoreMissingFiles, 0, 0, GetLocMsg(MSG_DLG_IGNORE_MISSING), 0 }, - /*04*/ { DI_TEXT, 3, 4, 0, 0, 0, 0, DIF_BOXCOLOR | DIF_SEPARATOR, 0, L"", 0 }, - /*05*/ { DI_BUTTON, 0, 5, 0, 0, 1, 0, DIF_CENTERGROUP, 1, GetLocMsg(MSG_BTN_RUN), 0}, - /*06*/ { DI_BUTTON, 0, 5, 0, 0, 0, 0, DIF_CENTERGROUP, 0, GetLocMsg(MSG_BTN_CANCEL), 0}, - }; - - for (int i = 0; i < ARRAY_SIZE(codePageValues); i++) - { - cpListItems[i].Text = codePageNames[i]; - if (codePageValues[i] == optListDefaultCodepage) - cpListItems[i].Flags = LIF_SELECTED; - } - - // Set proper location for codepage combobox - DialogItems[2].X1 += (int) wcslen(DialogItems[1].PtrData) + 1; - DialogItems[2].X2 += DialogItems[2].X1 + 6; - - // Expand right border of the dialog if text is too long to fit - int borderX2 = AdjustDialogBorder(DialogItems, ARRAY_SIZE(DialogItems)); - - HANDLE hDlg = FarSInfo.DialogInit(FarSInfo.ModuleNumber, -1, -1, borderX2 + 4, 8, L"ValidationParams", - DialogItems, sizeof(DialogItems) / sizeof(DialogItems[0]), 0, 0, FarSInfo.DefDlgProc, 0); - - int nOkID = ARRAY_SIZE(DialogItems) - 2; - - if (hDlg != INVALID_HANDLE_VALUE) - { - int ExitCode = FarSInfo.DialogRun(hDlg); - if (ExitCode == nOkID) // OK was pressed - { - int selectedCodepage = (int) DlgList_GetCurPos(FarSInfo, hDlg, 2); - codepage = codePageValues[selectedCodepage]; - ignoreMissingFiles = (int) DlgItem_GetCheck(FarSInfo, hDlg, 3); - } - FarSInfo.DialogFree(hDlg); - - if (ExitCode == nOkID) return true; - } - - return false; -} - -// Returns true if file is recognized as hash list -static bool RunValidateFiles(const wchar_t* hashListPath, bool silent, bool showParamsDialog) -{ - UINT fileCodepage = optListDefaultCodepage; - int ignoreMissingFiles = optIgnoreMissingFiles; - - if (!silent && showParamsDialog && !AskValidationFileParams(fileCodepage, ignoreMissingFiles)) - return false; - - HashList hashes; - if (!hashes.LoadList(hashListPath, fileCodepage, false) || (hashes.GetCount() == 0)) - { - if (!silent) - DisplayMessage(GetLocMsg(MSG_DLG_ERROR), GetLocMsg(MSG_DLG_NOTVALIDLIST), NULL, true, true); - return false; - } - - int nFilesSkipped = 0; - std::vector vMismatches, vMissing; - std::vector existingFiles; - int64_t totalFilesSize = 0; - - // Win7 only feature - FarSInfo.AdvControl(FarSInfo.ModuleNumber, ACTL_SETPROGRESSSTATE, (void*) PS_INDETERMINATE); - - // Prepare files list - { - FarScreenSave screen; - DisplayMessage(GetLocMsg(MSG_DLG_PROCESSING), GetLocMsg(MSG_DLG_PREPARE_LIST), NULL, false, false); - - int64_t fileSize; - for (size_t i = 0; i < hashes.GetCount(); i++) - { - FileHashInfo fileInfo = hashes.GetFileInfo(i); - - wstring strFullFilePath = ConvertPathToNative(fileInfo.Filename); - if (IsFile(strFullFilePath, &fileSize)) - { - existingFiles.push_back(i); - totalFilesSize += fileSize; - } - else if (!ignoreMissingFiles) - { - vMissing.push_back(fileInfo.Filename); - } - } - } - - if (existingFiles.size() > 0) - { - bool fAborted = false; - { // Scope for ProgressContext object - ProgressContext progressCtx((int)existingFiles.size(), totalFilesSize); - - bool fAutoSkipErrors = false; - for (size_t i = 0; i < existingFiles.size(); i++) - { - FileHashInfo fileInfo = hashes.GetFileInfo(existingFiles[i]); - - wstring strFullFilePath = ConvertPathToNative(fileInfo.Filename); - std::string hashValueStr; - - if (RunGeneration(strFullFilePath, fileInfo.Filename, fileInfo.HashAlgo, false, progressCtx, hashValueStr, fAborted, fAutoSkipErrors)) - { - if (!SameHash(fileInfo.HashStr, hashValueStr)) - vMismatches.push_back(fileInfo.Filename); - } - else if (fAborted) - { - break; - } - else - { - nFilesSkipped++; - } - } //for - } - - if (!fAborted) - DisplayValidationResults(vMismatches, vMissing, nFilesSkipped); - } - else - { - DisplayMessage(GetLocMsg(MSG_DLG_NOFILES_TITLE), GetLocMsg(MSG_DLG_NOFILES_TEXT), NULL, true, true); - } - - FarSInfo.AdvControl(FarSInfo.ModuleNumber, ACTL_SETPROGRESSSTATE, (void*) PS_NOPROGRESS); - FarSInfo.AdvControl(FarSInfo.ModuleNumber, ACTL_PROGRESSNOTIFY, 0); - - return true; -} - -static LONG_PTR WINAPI HashParamsDlgProc(HANDLE hDlg, int Msg, int Param1, LONG_PTR Param2) -{ - const int nFileNameBoxIndex = 14; - - if (Msg == DN_BTNCLICK && optAutoExtension) - { - if (Param2 && (Param1 >= 2) && (Param1 <= 2 + NUMBER_OF_SUPPORTED_HASHES)) - { - int selectedHashIndex = Param1 - 2; - wchar_t wszHashFileName[MAX_PATH]; - - DlgHlp_GetEditBoxText(hDlg, nFileNameBoxIndex, wszHashFileName, ARRAY_SIZE(wszHashFileName)); - - // We should only replace extensions if it exists and is one of auto-extensions - // this way custom names will not be touched when user switch algorithms - wchar_t* extPtr = wcsrchr(wszHashFileName, '.'); - if (extPtr && *extPtr) - { - for (int i = 0; i < NUMBER_OF_SUPPORTED_HASHES; i++) - { - if ((i != selectedHashIndex) && (SupportedHashes[i].DefaultExt == extPtr)) - { - wcscpy_s(extPtr, MAX_PATH - (extPtr - wszHashFileName), SupportedHashes[selectedHashIndex].DefaultExt.c_str()); - FarSInfo.SendDlgMessage(hDlg, DM_SETTEXTPTR, nFileNameBoxIndex, (LONG_PTR)wszHashFileName); - break; - } - } - } - - return TRUE; - } - } - - return FarSInfo.DefDlgProc(hDlg, Msg, Param1, Param2); -} - -static bool AskForHashGenerationParams(rhash_ids &selectedAlgo, bool &recursive, HashOutputTargets &outputTarget, wstring &outputFileName, int &storeAbsPaths) -{ - FarDialogItem DialogItems []={ - /*0*/{DI_DOUBLEBOX, 3, 1, 45,21, 0, 0, 0, 0, GetLocMsg(MSG_GEN_TITLE)}, - - /*1*/{DI_TEXT, 5, 2, 0, 0, 0, 0, 0, 0, GetLocMsg(MSG_GEN_ALGO), 0}, - /*2*/{DI_RADIOBUTTON, 6, 3, 0, 0, 0, (selectedAlgo == RHASH_CRC32), DIF_GROUP, 0, GetLocMsg(MSG_ALGO_CRC)}, - /*3*/{DI_RADIOBUTTON, 6, 4, 0, 0, 0, (selectedAlgo == RHASH_MD5), 0, 0, GetLocMsg(MSG_ALGO_MD5)}, - /*4*/{DI_RADIOBUTTON, 6, 5, 0, 0, 0, (selectedAlgo == RHASH_SHA1), 0, 0, GetLocMsg(MSG_ALGO_SHA1)}, - /*5*/{DI_RADIOBUTTON, 6, 6, 0, 0, 0, (selectedAlgo == RHASH_SHA256), 0, 0, GetLocMsg(MSG_ALGO_SHA256)}, - /*6*/{DI_RADIOBUTTON, 6, 7, 0, 0, 0, (selectedAlgo == RHASH_SHA512), 0, 0, GetLocMsg(MSG_ALGO_SHA512)}, - /*7*/{DI_RADIOBUTTON, 6, 8, 0, 0, 0, (selectedAlgo == RHASH_SHA3_512), 0, 0, GetLocMsg(MSG_ALGO_SHA3_512) }, - /*8*/{DI_RADIOBUTTON, 6, 9, 0, 0, 0, (selectedAlgo == RHASH_WHIRLPOOL), 0, 0, GetLocMsg(MSG_ALGO_WHIRLPOOL)}, - - /*9*/{DI_TEXT, 3,10, 0, 0, 0, 0, DIF_BOXCOLOR|DIF_SEPARATOR, 0, L""}, - /*10*/{DI_TEXT, 5,11, 0, 0, 0, 0, 0, 0, GetLocMsg(MSG_GEN_TARGET), 0}, - /*11*/{DI_RADIOBUTTON, 6,12, 0, 0, 0, 1, DIF_GROUP, 0, GetLocMsg(MSG_GEN_TO_FILE)}, - /*12*/{DI_RADIOBUTTON, 6,14, 0, 0, 0, 0, 0, 0, GetLocMsg(MSG_GEN_TO_SEPARATE)}, - /*13*/{DI_RADIOBUTTON, 6,15, 0, 0, 0, 0, 0, 0, GetLocMsg(MSG_GEN_TO_SCREEN)}, - /*14*/{DI_EDIT, 10,13,38, 0, 1, 0, DIF_EDITEXPAND|DIF_EDITPATH,0, outputFileName.c_str(), 0}, - - /*15*/{DI_TEXT, 3,16, 0, 0, 0, 0, DIF_BOXCOLOR|DIF_SEPARATOR, 0, L""}, - /*16*/{DI_CHECKBOX, 5,17, 0, 0, 0, recursive, 0, 0, GetLocMsg(MSG_GEN_RECURSE)}, - /*17*/{DI_CHECKBOX, 5,18, 0, 0, 0, (DWORD_PTR)storeAbsPaths, 0, 0, GetLocMsg(MSG_GEN_ABSPATH)}, - - /*18*/{DI_TEXT, 3,19, 0, 0, 0, 0, DIF_BOXCOLOR|DIF_SEPARATOR, 0, L"", 0}, - /*19*/{DI_BUTTON, 0,20, 0,13, 0, 0, DIF_CENTERGROUP, 1, GetLocMsg(MSG_BTN_RUN), 0}, - /*20*/{DI_BUTTON, 0,20, 0,13, 0, 0, DIF_CENTERGROUP, 0, GetLocMsg(MSG_BTN_CANCEL), 0}, - }; - size_t numDialogItems = sizeof(DialogItems) / sizeof(DialogItems[0]); - - HANDLE hDlg = FarSInfo.DialogInit(FarSInfo.ModuleNumber, -1, -1, 49, 23, L"GenerateParams", DialogItems, (unsigned) numDialogItems, 0, 0, HashParamsDlgProc, 0); - - bool retVal = false; - if (hDlg != INVALID_HANDLE_VALUE) - { - int ExitCode = FarSInfo.DialogRun(hDlg); - if (ExitCode == numDialogItems - 2) // OK was pressed - { - recursive = DlgHlp_GetSelectionState(hDlg, 16) != 0; - storeAbsPaths = DlgHlp_GetSelectionState(hDlg, 17); - DlgHlp_GetEditBoxText(hDlg, 14, outputFileName); - - for (int i = 0; i < NUMBER_OF_SUPPORTED_HASHES; i++) - { - // Selection radios start from index = 2 - if (DlgHlp_GetSelectionState(hDlg, 2 + i)) - selectedAlgo = SupportedHashes[i].AlgoId; - } - - if (DlgHlp_GetSelectionState(hDlg, 11)) outputTarget = OT_SINGLEFILE; - else if (DlgHlp_GetSelectionState(hDlg, 12)) outputTarget = OT_SEPARATEFILES; - else if (DlgHlp_GetSelectionState(hDlg, 13)) outputTarget = OT_DISPLAY; - - retVal = true; - } - FarSInfo.DialogFree(hDlg); - } - return retVal; -} - -static void DisplayHashListOnScreen(HashList &list) -{ - int numListItems = (int) list.GetCount(); - FarListItem* hashListItems = new FarListItem[numListItems]; - FarList hashDump = {numListItems, hashListItems}; - - std::vector listStrDump; - for (size_t i = 0; i < list.GetCount(); i++) - { - listStrDump.push_back(list.GetFileInfo(i).ToString()); - - wstring &line = listStrDump[i]; - memset(&hashListItems[i], 0, sizeof(FarListItem)); - hashListItems[i].Text = line.c_str(); - } - - RectSize listSize(54, 15); - FindBestListBoxSize(listStrDump, GetFarWindowSize, listSize); - - int nDlgWidth = listSize.Width + 11; - int nDlgHeight = listSize.Height + 7; - - FarDialogItem DialogItems []={ - /*00*/ {DI_DOUBLEBOX, 3, 1,nDlgWidth-4,nDlgHeight-2, 0, 0, 0,0, GetLocMsg(MSG_DLG_CALC_COMPLETE), 0}, - /*01*/ {DI_LISTBOX, 5, 2,listSize.Width+5,listSize.Height+2, 0, (DWORD_PTR)&hashDump, DIF_LISTNOCLOSE | DIF_LISTNOBOX, 0, NULL, 0}, - /*02*/ {DI_TEXT, 3,nDlgHeight-4, 0, 0, 0, 0, DIF_BOXCOLOR|DIF_SEPARATOR, 0, L"", 0}, - /*03*/ {DI_BUTTON, 0,nDlgHeight-3, 0, 0, 1, 0, DIF_CENTERGROUP, 1, GetLocMsg(MSG_BTN_CLOSE), 0}, - /*04*/ {DI_BUTTON, 0,nDlgHeight-3, 0, 0, 0, 0, DIF_CENTERGROUP, 0, GetLocMsg(MSG_BTN_CLIPBOARD), 0}, - }; - - HANDLE hDlg = FarSInfo.DialogInit(FarSInfo.ModuleNumber, -1, -1, nDlgWidth, nDlgHeight, NULL, - DialogItems, sizeof(DialogItems) / sizeof(DialogItems[0]), 0, 0, FarSInfo.DefDlgProc, 0); - - if (hDlg != INVALID_HANDLE_VALUE) - { - int ExitCode = FarSInfo.DialogRun(hDlg); - if (ExitCode == 4) // clipboard - { - CopyTextToClipboard(listStrDump); - } - FarSInfo.DialogFree(hDlg); - } - - delete [] hashListItems; -} - -static void RunGenerateHashes() -{ - // Check panel for compatibility - PanelInfo pi = {0}; - if (!FarSInfo.Control(PANEL_ACTIVE, FCTL_GETPANELINFO, 0, (LONG_PTR)&pi) || (pi.SelectedItemsNumber <= 0)) - { - DisplayMessage(GetLocMsg(MSG_DLG_ERROR), GetLocMsg(MSG_DLG_NO_FILES_SELECTED), NULL, true, true); - return; - } - - // Generation params - rhash_ids genAlgo = (rhash_ids) optDefaultAlgo; - bool recursive = true; - HashOutputTargets outputTarget = OT_SINGLEFILE; - wstring outputFile(L"hashlist"); - UINT outputFileCodepage = optListDefaultCodepage; - int storeAbsPaths = 0; - - HashAlgoInfo *selectedHashInfo = GetAlgoInfo(genAlgo); - if (optAutoExtension) outputFile += selectedHashInfo->DefaultExt; - - // If only one file is selected then offer it's name as base for hash file name - if (pi.SelectedItemsNumber == 1) - { - wstring strSelectedFile; - if (GetSelectedPanelItemPath(strSelectedFile) && (strSelectedFile != L"..")) - { - outputFile = ExtractFileName(strSelectedFile) + selectedHashInfo->DefaultExt; - } - } - - while(true) - { - if (!AskForHashGenerationParams(genAlgo, recursive, outputTarget, outputFile, storeAbsPaths)) - return; - - if (outputTarget == OT_SINGLEFILE) - { - // Check if hash file already exists - if (IsFile(outputFile)) - { - wchar_t wszMsgText[256] = {0}; - swprintf_s(wszMsgText, ARRAY_SIZE(wszMsgText), GetLocMsg(MSG_DLG_OVERWRITE_FILE_TEXT), outputFile.c_str()); - - if (!ConfirmMessage(GetLocMsg(MSG_DLG_OVERWRITE_FILE), wszMsgText, true)) - continue; - } - // Check if we can write target file - else if (!CanCreateFile(outputFile.c_str())) - { - DisplayMessage(MSG_DLG_ERROR, MSG_DLG_CANT_SAVE_HASHLIST, outputFile.c_str(), true, true); - continue; - } - } - - break; - } - - StringList filesToProcess; - int64_t totalFilesSize = 0; - HashList hashes; - wstring strPanelDir; - - // Win7 only feature - FarSInfo.AdvControl(FarSInfo.ModuleNumber, ACTL_SETPROGRESSSTATE, (void*) PS_INDETERMINATE); - - // Prepare files list - { - FarScreenSave screen; - DisplayMessage(GetLocMsg(MSG_DLG_PROCESSING), GetLocMsg(MSG_DLG_PREPARE_LIST), NULL, false, false); - - GetPanelDir(PANEL_ACTIVE, strPanelDir); - GetSelectedPanelFiles(pi, strPanelDir, filesToProcess, totalFilesSize, recursive); - } - - { - // Perform hashing - ProgressContext progressCtx((int)filesToProcess.size(), totalFilesSize); - progressCtx.SetAlgorithm(genAlgo); - - bool continueSave = true; - bool fAutoSkipErrors = false; - for (auto cit = filesToProcess.begin(); cit != filesToProcess.end(); cit++) - { - wstring strNextFile = *cit; - wstring strFullPath = strPanelDir + strNextFile; - - std::string hashValueStr; - bool fShouldAbort = false; - - if (RunGeneration(strFullPath, strNextFile, genAlgo, optHashUppercase != FALSE, progressCtx, hashValueStr, fShouldAbort, fAutoSkipErrors)) - { - hashes.SetFileHash(storeAbsPaths ? strFullPath : strNextFile, hashValueStr, genAlgo); - } - else if (fShouldAbort) - { - continueSave = false; - break; - } - } - - FarSInfo.AdvControl(FarSInfo.ModuleNumber, ACTL_SETPROGRESSSTATE, (void*)PS_NOPROGRESS); - FarSInfo.AdvControl(FarSInfo.ModuleNumber, ACTL_PROGRESSNOTIFY, 0); - - if (!continueSave) return; - } - - // Display/save hash list - bool saveSuccess = false; - if (outputTarget == OT_SINGLEFILE) - { - saveSuccess = hashes.SaveList(outputFile.c_str(), outputFileCodepage); - if (!saveSuccess) - { - DisplayMessage(MSG_DLG_ERROR, MSG_DLG_CANT_SAVE_HASHLIST, outputFile.c_str(), true, true); - } - } - else if (outputTarget == OT_SEPARATEFILES) - { - int numGood, numBad; - saveSuccess = hashes.SaveListSeparate(strPanelDir.c_str(), outputFileCodepage, numGood, numBad); - } - else if (outputTarget == OT_DISPLAY) - { - saveSuccess = true; - DisplayHashListOnScreen(hashes); - } - else - { - // Something went wrong. This should not happen. - DisplayMessage(L"Error", L"Invalid output target", nullptr, true, true); - } - - // Clear selection if requested - if (saveSuccess && optClearSelectionOnComplete) - { - for (int i = pi.SelectedItemsNumber - 1; i >=0; i--) - FarSInfo.Control(PANEL_ACTIVE, FCTL_CLEARSELECTION, i, NULL); - } - - if (optRememberLastUsedAlgo) - { - optDefaultAlgo = genAlgo; - SaveSettings(); - } - - FarSInfo.Control(PANEL_ACTIVE, FCTL_REDRAWPANEL, 0, NULL); -} - -static bool AskForCompareParams(rhash_ids &selectedAlgo, bool &recursive) -{ - FarListItem algoListItems[2] = { {LIF_SELECTED, L"CRC32", 0}, {0, L"SHA1", 0}}; - FarList algoDlgList = { 2, &algoListItems[0] }; - - const wchar_t* algoLabel = GetLocMsg(MSG_GEN_ALGO); - const int labelSize = wcslen(algoLabel); - - FarDialogItem DialogItems [] = { - /*0*/{ DI_DOUBLEBOX, 3, 1,41, 7, 0, 0, 0, 0, GetLocMsg(MSG_DLG_COMPARE) }, - - /*1*/{ DI_TEXT, 5, 2, 0, 0, 0, 0, 0, 0, algoLabel, 0 }, - /*2*/{ DI_COMBOBOX, labelSize + 6, 2, labelSize + 16, 0, 0, (DWORD_PTR)&algoDlgList, DIF_DROPDOWNLIST, 0, NULL, 0 }, - - /*3*/{ DI_TEXT, 3, 3, 0, 0, 0, 0, DIF_BOXCOLOR | DIF_SEPARATOR, 0, L"" }, - /*4*/{ DI_CHECKBOX, 5, 4, 0, 0, 0, recursive, 0, 0, GetLocMsg(MSG_GEN_RECURSE) }, - - /*5*/{ DI_TEXT, 3, 5, 0, 0, 0, 0, DIF_BOXCOLOR|DIF_SEPARATOR, 0, L"", 0 }, - /*6*/{ DI_BUTTON, 0, 6, 0, 6, 0, 0, DIF_CENTERGROUP, 1, GetLocMsg(MSG_BTN_RUN), 0 }, - /*7*/{ DI_BUTTON, 0, 6, 0, 6, 0, 0, DIF_CENTERGROUP, 0, GetLocMsg(MSG_BTN_CANCEL), 0 } - }; - size_t numDialogItems = sizeof(DialogItems) / sizeof(DialogItems[0]); - - HANDLE hDlg = FarSInfo.DialogInit(FarSInfo.ModuleNumber, -1, -1, 45, 9, L"CompareParams", &DialogItems[0], numDialogItems, 0, 0, FarSInfo.DefDlgProc, 0); - - bool retVal = false; - if (hDlg != INVALID_HANDLE_VALUE) - { - int ExitCode = FarSInfo.DialogRun(hDlg); - if (ExitCode == numDialogItems - 2) // OK was pressed - { - recursive = DlgHlp_GetSelectionState(hDlg, 4) != 0; - - auto algoIndex = DlgList_GetCurPos(FarSInfo, hDlg, 2); - selectedAlgo = (algoIndex == 0) ? RHASH_CRC32 : RHASH_SHA1; - - retVal = true; - } - FarSInfo.DialogFree(hDlg); - } - return retVal; -} - -static void RunComparePanels() -{ - PanelInfo piActv = { 0 }, piPasv = { 0 }; - if (!FarSInfo.Control(PANEL_ACTIVE, FCTL_GETPANELINFO, 0, (LONG_PTR) &piActv) - || !FarSInfo.Control(PANEL_PASSIVE, FCTL_GETPANELINFO, 0, (LONG_PTR) &piPasv)) - return; - - if (piActv.PanelType != PTYPE_FILEPANEL || piPasv.PanelType != PTYPE_FILEPANEL || piActv.Plugin || piPasv.Plugin) - { - DisplayMessage(GetLocMsg(MSG_DLG_ERROR), GetLocMsg(MSG_DLG_FILE_PANEL_REQUIRED), NULL, true, true); - return; - } - - // Nothing selected on the panel - if (piActv.SelectedItemsNumber == 0) return; - - wstring strActivePanelDir, strPassivePanelDir; - - rhash_ids cmpAlgo = (rhash_ids) optDefaultAlgo; - bool recursive = true; - - GetPanelDir(PANEL_ACTIVE, strActivePanelDir); - GetPanelDir(PANEL_PASSIVE, strPassivePanelDir); - - if (strActivePanelDir == strPassivePanelDir) - { - DisplayMessage(GetLocMsg(MSG_DLG_ERROR), GetLocMsg(MSG_DLG_NO_COMPARE_SELF), NULL, true, true); - return; - } - - if (!AskForCompareParams(cmpAlgo, recursive)) - return; - - StringList vSelectedFiles; - int64_t totalFilesSize = 0; - - FarSInfo.AdvControl(FarSInfo.ModuleNumber, ACTL_SETPROGRESSSTATE, (void*) PS_INDETERMINATE); - - // Prepare files list - { - FarScreenSave screen; - DisplayMessage(GetLocMsg(MSG_DLG_PROCESSING), GetLocMsg(MSG_DLG_PREPARE_LIST), NULL, false, false); - - GetSelectedPanelFiles(piActv, strActivePanelDir, vSelectedFiles, totalFilesSize, true); - } - - // No suitable items selected for comparison - if (vSelectedFiles.size() == 0) return; - - std::vector vMismatches, vMissing; - int nFilesSkipped = 0; - bool fAborted = false; - bool fSkipAllErrors = false; - - { - ProgressContext progressCtx((int)vSelectedFiles.size() * 2, totalFilesSize * 2); - - for (auto cit = vSelectedFiles.begin(); cit != vSelectedFiles.end(); cit++) - { - wstring strNextFile = *cit; - - wstring strActvPath = strActivePanelDir + strNextFile; - wstring strPasvPath = strPassivePanelDir + strNextFile; - - int64_t nActivePanelFileSize = GetFileSize_i64(strActvPath.c_str()); - int64_t nPassivePanelFileSize; - - // Does opposite file exists at all? - if (!IsFile(strPasvPath, &nPassivePanelFileSize)) - { - vMissing.push_back(strNextFile); - progressCtx.CurrentFileIndex += 2; - progressCtx.TotalProcessedBytes += nActivePanelFileSize * 2; - continue; - } - - // For speed compare file sizes first - if (nActivePanelFileSize != nPassivePanelFileSize) - { - vMismatches.push_back(strNextFile); - progressCtx.CurrentFileIndex += 2; - progressCtx.TotalProcessedBytes += nActivePanelFileSize * 2; - continue; - } - - std::string strHashValueActive; - std::string strHashValuePassive; - - if (RunGeneration(strActvPath, strActvPath, cmpAlgo, false, progressCtx, strHashValueActive, fAborted, fSkipAllErrors) - && RunGeneration(strPasvPath, strPasvPath, cmpAlgo, false, progressCtx, strHashValuePassive, fAborted, fSkipAllErrors)) - { - if (!SameHash(strHashValueActive, strHashValuePassive)) - vMismatches.push_back(strNextFile); - } - else - { - if (fAborted) - break; - else - nFilesSkipped++; - } - } - - FarSInfo.AdvControl(FarSInfo.ModuleNumber, ACTL_SETPROGRESSSTATE, (void*)PS_NOPROGRESS); - FarSInfo.AdvControl(FarSInfo.ModuleNumber, ACTL_PROGRESSNOTIFY, 0); - } - - if (!fAborted) - { - DisplayValidationResults(vMismatches, vMissing, nFilesSkipped); - } - - if (optRememberLastUsedAlgo) - { - optDefaultAlgo = cmpAlgo; - SaveSettings(); - } -} - -void RunCompareWithClipboard(std::wstring &selectedFile) -{ - std::string clipText; - if (!GetTextFromClipboard(clipText)) - { - DisplayMessage(GetLocMsg(MSG_DLG_ERROR), GetLocMsg(MSG_DLG_CLIP_ERROR), NULL, true, true); - return; - } - - TrimStr(clipText); - - std::vector algoIndicies = DetectHashAlgo(clipText); - - if (algoIndicies.size() == 0) - { - DisplayMessage(GetLocMsg(MSG_DLG_ERROR), GetLocMsg(MSG_DLG_LOOKS_NO_HASH), NULL, true, true); - return; - } - - int selectedAlgoIndex = algoIndicies[0]; - if (algoIndicies.size() > 1) - { - FarMenu algoMenu(&FarSInfo, L"Select algorithm"); - for (size_t i = 0; i < algoIndicies.size(); i++) - { - algoMenu.AddItem(SupportedHashes[algoIndicies[i]].AlgoName.c_str()); - } - intptr_t selItem = algoMenu.Run(); - if (selItem < 0) return; - - selectedAlgoIndex = algoIndicies[selItem]; - } - - rhash_ids algo = SupportedHashes[selectedAlgoIndex].AlgoId; - std::string strHashValue; - bool fAborted = false, fSkipAllErrors = false; - - ProgressContext progressCtx(1, GetFileSize_i64(selectedFile.c_str())); - - if (RunGeneration(selectedFile, selectedFile, algo, false, progressCtx, strHashValue, fAborted, fSkipAllErrors)) - { - if (SameHash(strHashValue, clipText)) - DisplayMessage(GetLocMsg(MSG_DLG_CALC_COMPLETE), GetLocMsg(MSG_DLG_FILE_CLIP_MATCH), NULL, false, true); - else - DisplayMessage(GetLocMsg(MSG_DLG_CALC_COMPLETE), GetLocMsg(MSG_DLG_FILE_CLIP_MISMATCH), NULL, true, true); - } - - FarSInfo.AdvControl(FarSInfo.ModuleNumber, ACTL_SETPROGRESSSTATE, (void*) PS_NOPROGRESS); - FarSInfo.AdvControl(FarSInfo.ModuleNumber, ACTL_PROGRESSNOTIFY, 0); -} - -// ------------------------------------- Exported functions -------------------------------------------------- - -int WINAPI GetMinFarVersionW(void) -{ - return FARMANAGERVERSION; -} - -void WINAPI SetStartupInfoW(const struct PluginStartupInfo *Info) -{ - FarSInfo = *Info; - FSF = *Info->FSF; - FarSInfo.FSF = &FSF; - - LoadSettings(); -} - -void WINAPI ExitFARW( void ) -{ - // -} - -void WINAPI GetPluginInfoW(struct PluginInfo *Info) -{ - Info->StructSize = sizeof(PluginInfo); - Info->Flags = 0; - - static const wchar_t *PluginMenuStrings[1]; - PluginMenuStrings[0] = GetLocMsg(MSG_PLUGIN_NAME); - static const wchar_t *PluginConfigStrings[1]; - PluginConfigStrings[0] = GetLocMsg(MSG_PLUGIN_CONFIG_NAME); - - Info->PluginMenuStrings = PluginMenuStrings; - Info->PluginMenuStringsNumber = sizeof(PluginMenuStrings) / sizeof(PluginMenuStrings[0]); - Info->PluginConfigStrings = PluginConfigStrings; - Info->PluginConfigStringsNumber = sizeof(PluginConfigStrings) / sizeof(PluginConfigStrings[0]); - Info->CommandPrefix = optPrefix; -} - -int WINAPI ConfigureW(int ItemNumber) -{ - FarListItem algoListItems[NUMBER_OF_SUPPORTED_HASHES] = {0}; - FarList algoDlgList = {NUMBER_OF_SUPPORTED_HASHES, algoListItems}; - - const wchar_t* codePageNames[] = {L"UTF-8", L"ANSI", L"OEM"}; - const UINT codePageValues[] = {CP_UTF8, CP_ACP, CP_OEMCP}; - - FarListItem cpListItems[ARRAY_SIZE(codePageNames)] = {0}; - FarList cpDlgList = {ARRAY_SIZE(codePageNames), cpListItems}; - - FarDialogItem DialogItems []={ - /*00*/ {DI_DOUBLEBOX, 3, 1,40,15, 0, 0, 0,0, GetLocMsg(MSG_CONFIG_TITLE), 0}, - /*01*/ {DI_TEXT, 5, 2, 0, 0, 0, 0, 0, 0, GetLocMsg(MSG_CONFIG_DEFAULT_ALGO), 0}, - /*02*/ {DI_COMBOBOX, 5, 3,20, 0, 0, (DWORD_PTR)&algoDlgList, DIF_DROPDOWNLIST, 0, NULL, 0}, - /*03*/ {DI_CHECKBOX, 5, 4, 0, 0, 0, (DWORD_PTR)optRememberLastUsedAlgo, 0,0, GetLocMsg(MSG_CONFIG_REMEMBER_LAST_ALGO), 0}, - /*04*/ {DI_TEXT, 3, 5, 0, 0, 0, 0, DIF_BOXCOLOR|DIF_SEPARATOR, 0, L"", 0}, - /*05*/ {DI_CHECKBOX, 5, 6, 0, 0, 0, (DWORD_PTR)optUsePrefix, 0,0, GetLocMsg(MSG_CONFIG_PREFIX), 0}, - /*06*/ {DI_EDIT, 8, 7,24, 0, 0, 0, 0,0, optPrefix, 0}, - /*07*/ {DI_CHECKBOX, 5, 8, 0, 0, 0, (DWORD_PTR)optConfirmAbort, 0,0, GetLocMsg(MSG_CONFIG_CONFIRM_ABORT), 0}, - /*08*/ {DI_CHECKBOX, 5, 9, 0, 0, 0, (DWORD_PTR)optClearSelectionOnComplete, 0,0, GetLocMsg(MSG_CONFIG_CLEAR_SELECTION), 0}, - /*09*/ {DI_CHECKBOX, 5,10, 0, 0, 0, (DWORD_PTR)optAutoExtension, 0,0, GetLocMsg(MSG_CONFIG_AUTOEXT), 0}, - /*10*/ {DI_CHECKBOX, 5,11, 0, 0, 0, (DWORD_PTR)optHashUppercase, 0,0, GetLocMsg(MSG_CONFIG_UPPERCASE), 0}, - /*11*/ {DI_TEXT, 5,12, 0, 0, 0, 0, 0, 0, GetLocMsg(MSG_CONFIG_DEFAULT_CP), 0}, - /*12*/ {DI_COMBOBOX, 5,12, 0, 0, 0, (DWORD_PTR)&cpDlgList, DIF_DROPDOWNLIST, 0, NULL, 0}, - /*13*/ {DI_TEXT, 3,13, 0, 0, 0, 0, DIF_BOXCOLOR|DIF_SEPARATOR, 0, L"", 0}, - /*14*/ {DI_BUTTON, 0,14, 0, 0, 0, 0, DIF_CENTERGROUP, 1, GetLocMsg(MSG_BTN_OK), 0}, - /*15*/ {DI_BUTTON, 0,14, 0, 0, 1, 0, DIF_CENTERGROUP, 0, GetLocMsg(MSG_BTN_CANCEL), 0}, - }; - int DialogItemsCount = ARRAY_SIZE(DialogItems); - - for (int i = 0; i < NUMBER_OF_SUPPORTED_HASHES; i++) - { - algoListItems[i].Text = SupportedHashes[i].AlgoName.c_str(); - if (SupportedHashes[i].AlgoId == optDefaultAlgo) - algoListItems[i].Flags = LIF_SELECTED; - } - - for (int i = 0; i < ARRAY_SIZE(codePageValues); i++) - { - cpListItems[i].Text = codePageNames[i]; - if (codePageValues[i] == optListDefaultCodepage) - cpListItems[i].Flags = LIF_SELECTED; - } - - // Set proper location for codepage combobox - DialogItems[12].X1 += (int) wcslen(DialogItems[11].PtrData) + 1; - DialogItems[12].X2 += DialogItems[12].X1 + 6; - - // Expand right border of the dialog if test is too long to fit - int borderX2 = AdjustDialogBorder(DialogItems, DialogItemsCount); - - HANDLE hDlg = FarSInfo.DialogInit(FarSInfo.ModuleNumber, -1, -1, borderX2 + 4, DialogItemsCount + 1, L"IntCheckerConfig", DialogItems, DialogItemsCount, 0, 0, FarSInfo.DefDlgProc, 0); - - int nOkID = DialogItemsCount - 2; - - if (hDlg != INVALID_HANDLE_VALUE) - { - int ExitCode = FarSInfo.DialogRun(hDlg); - if (ExitCode == nOkID) // OK was pressed - { - optRememberLastUsedAlgo = DlgHlp_GetSelectionState(hDlg, 4); - optUsePrefix = DlgHlp_GetSelectionState(hDlg, 5); - DlgHlp_GetEditBoxText(hDlg, 6, optPrefix, ARRAY_SIZE(optPrefix)); - optConfirmAbort = DlgHlp_GetSelectionState(hDlg, 7); - optClearSelectionOnComplete = DlgHlp_GetSelectionState(hDlg, 8); - optAutoExtension = DlgHlp_GetSelectionState(hDlg, 9); - optHashUppercase = DlgHlp_GetSelectionState(hDlg, 10); - - int selectedAlgo = (int) DlgList_GetCurPos(FarSInfo, hDlg, 2); - optDefaultAlgo = SupportedHashes[selectedAlgo].AlgoId; - - int selectedCodepage = (int) DlgList_GetCurPos(FarSInfo, hDlg, 12); - optListDefaultCodepage = codePageValues[selectedCodepage]; - - SaveSettings(); - } - FarSInfo.DialogFree(hDlg); - - if (ExitCode == nOkID) return TRUE; - } - - return FALSE; -} - -HANDLE WINAPI OpenPluginW(int OpenFrom, INT_PTR Item) -{ - if (OpenFrom == OPEN_COMMANDLINE) - { - if (optUsePrefix) - { - // We are from prefix - if (!RunValidateFiles((wchar_t*) Item, true, false)) - DisplayMessage(GetLocMsg(MSG_DLG_ERROR), GetLocMsg(MSG_DLG_NOTVALIDLIST), NULL, true, true); - } - } - else if (OpenFrom == OPEN_PLUGINSMENU) - { - // We are from regular plug-ins menu - - PanelInfo pi = {0}; - if (!FarSInfo.Control(PANEL_ACTIVE, FCTL_GETPANELINFO, 0, (LONG_PTR)&pi) || (pi.PanelType != PTYPE_FILEPANEL) || ((pi.Plugin != 0) && !(pi.Flags & PFLAGS_REALNAMES))) - { - return INVALID_HANDLE_VALUE; - } - - FarMenu openMenu(&FarSInfo, GetLocMsg(MSG_PLUGIN_NAME)); - - openMenu.AddItemEx(GetLocMsg(MSG_MENU_GENERATE), std::bind(RunGenerateHashes)); - openMenu.AddItemEx(GetLocMsg(MSG_MENU_COMPARE), std::bind(RunComparePanels)); - - wstring selectedFilePath; - if ((pi.SelectedItemsNumber == 1) && GetSelectedPanelItemPath(selectedFilePath) && IsFile(selectedFilePath)) - { - //TODO: use optDetectHashFiles - openMenu.AddItemEx(GetLocMsg(MSG_MENU_VALIDATE), std::bind(RunValidateFiles, selectedFilePath.c_str(), false, false)); - openMenu.AddItemEx(GetLocMsg(MSG_MENU_VALIDATE_WITH_PARAMS), std::bind(RunValidateFiles, selectedFilePath.c_str(), false, true)); - openMenu.AddItemEx(GetLocMsg(MSG_MENU_COMPARE_CLIP), std::bind(RunCompareWithClipboard, selectedFilePath)); - } - - openMenu.RunEx(); - } // OpenFrom check - - return INVALID_HANDLE_VALUE; -} - -HANDLE WINAPI OpenFilePluginW(const wchar_t *Name, const unsigned char *Data, int DataSize, int OpMode) -{ - return INVALID_HANDLE_VALUE; -} diff --git a/source/IntChecker2-Far2.def b/source/IntChecker2-Far2.def deleted file mode 100644 index 8e5db3c..0000000 --- a/source/IntChecker2-Far2.def +++ /dev/null @@ -1,9 +0,0 @@ -LIBRARY "IntChecker2" - -EXPORTS - GetMinFarVersionW - SetStartupInfoW - GetPluginInfoW - ConfigureW - OpenPluginW - ExitFARW \ No newline at end of file diff --git a/source/IntChecker2.vcxproj b/source/IntChecker2.vcxproj index dd5f69c..9da6ca3 100644 --- a/source/IntChecker2.vcxproj +++ b/source/IntChecker2.vcxproj @@ -1,14 +1,6 @@  - - Debug-Far2 - Win32 - - - Debug-Far2 - x64 - Debug-Far3 Win32 @@ -17,14 +9,6 @@ Debug-Far3 x64 - - Release-Far2 - Win32 - - - Release-Far2 - x64 - Release-Far3 Win32 @@ -51,17 +35,6 @@ Unicode v142 - - DynamicLibrary - Unicode - true - v142 - - - DynamicLibrary - Unicode - v142 - DynamicLibrary Unicode @@ -73,17 +46,6 @@ Unicode v142 - - DynamicLibrary - Unicode - true - v142 - - - DynamicLibrary - Unicode - v142 - @@ -94,43 +56,15 @@ - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - C:\Tools\Far-DBG\Far2\Plugins\!Personal\$(ProjectName)\ - $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ - true - false - $(SolutionDir)\bin\$(Configuration)-$(Platform)\ - $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ - true - false - $(SolutionDir)\bin\$(Configuration)-$(Platform)\ - $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ - false - false - $(SolutionDir)\bin\$(Configuration)-$(Platform)\ - $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ - false - false C:\Tools\Far-DBG\Far3\Plugins\!Personal\$(ProjectName)\ $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ true @@ -147,24 +81,12 @@ $(SolutionDir)\obj\$(Configuration)-$(Platform)\$(ProjectName)\ false false - AllRules.ruleset - - - AllRules.ruleset - - AllRules.ruleset AllRules.ruleset - AllRules.ruleset - - - AllRules.ruleset - - AllRules.ruleset @@ -175,105 +97,6 @@ false - - - Disabled - ..\depends\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;INTCHECKER2_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - Use - Level3 - EditAndContinue - stdcpp17 - - - IntChecker2-Far2.def - true - Windows - MachineX86 - Shlwapi.lib;wintrust.lib;crypt32.lib;%(AdditionalDependencies) - false - - - - - - X64 - - - Disabled - ..\depends\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;INTCHECKER2_EXPORTS;BOTAN_SHARED;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - Use - Level3 - ProgramDatabase - stdcpp17 - - - IntChecker2-Far2.def - true - Windows - MachineX64 - Shlwapi.lib;wintrust.lib;crypt32.lib;%(AdditionalDependencies) - - - - - - MaxSpeed - true - ..\depends\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;INTCHECKER2_EXPORTS;BOTAN_SHARED;%(PreprocessorDefinitions) - MultiThreaded - true - Use - Level3 - ProgramDatabase - stdcpp17 - - - IntChecker2-Far2.def - Windows - true - true - MachineX86 - $(IntDir)$(TargetName).lib - Shlwapi.lib;wintrust.lib;crypt32.lib;%(AdditionalDependencies) - false - - - - - - X64 - - - MaxSpeed - true - ..\depends\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;INTCHECKER2_EXPORTS;BOTAN_SHARED;%(PreprocessorDefinitions) - MultiThreaded - true - Use - Level3 - ProgramDatabase - stdcpp17 - - - IntChecker2-Far2.def - Windows - true - true - MachineX64 - $(IntDir)$(TargetName).lib - Shlwapi.lib;wintrust.lib;crypt32.lib;%(AdditionalDependencies) - false - - - Disabled @@ -378,24 +201,12 @@ - - - false - - - false false false - - - false - - - false false @@ -404,25 +215,10 @@ false - - true - true - true - - - true - true - true - true - - + - Create - Create Create Create - Create - Create Create Create @@ -431,7 +227,6 @@ - Document copy /y %(Identity) $(OutDir) > nul @@ -467,7 +262,6 @@ - @@ -475,7 +269,6 @@ - diff --git a/source/IntChecker2.vcxproj.filters b/source/IntChecker2.vcxproj.filters index 4027d7d..a400cf1 100644 --- a/source/IntChecker2.vcxproj.filters +++ b/source/IntChecker2.vcxproj.filters @@ -41,18 +41,12 @@ Source Files - - Source Files - Source Files Source Files - - Source Files - Source Files @@ -61,9 +55,6 @@ Source Files - - Source Files - Source Files\m4 @@ -82,9 +73,6 @@ Header Files - - Header Files - Header Files @@ -112,9 +100,6 @@ Header Files\depends\far3 - - Header Files\depends\helpers - Header Files\depends\helpers diff --git a/source/IntChecker2.vcxproj.user b/source/IntChecker2.vcxproj.user index 2b3252e..2094315 100644 --- a/source/IntChecker2.vcxproj.user +++ b/source/IntChecker2.vcxproj.user @@ -1,9 +1,5 @@  - - C:\Tools\Far-DBG\Far2\Far.exe - WindowsLocalDebugger - C:\Tools\Far-DBG\Far3\Far.exe WindowsLocalDebugger diff --git a/source/RegistrySettings.cpp b/source/RegistrySettings.cpp deleted file mode 100644 index 6e632c6..0000000 --- a/source/RegistrySettings.cpp +++ /dev/null @@ -1,131 +0,0 @@ -#include "stdafx.h" -#include "RegistrySettings.h" - -static std::wstring ConvertString(const char* Input) -{ - int nNumWChars = MultiByteToWideChar(CP_ACP, 0, Input, -1, NULL, NULL); - wchar_t* buf = new wchar_t[nNumWChars + 1]; - MultiByteToWideChar(CP_ACP, 0, Input, -1, buf, nNumWChars + 1); - std::wstring strResult(buf); - delete [] buf; - - return strResult; -} - -////////////////////////////////////////////////////////////////////////// - -#define SETTINGS_KEY_REGISTRY L"IntChecker" - -RegistrySettings::RegistrySettings( const wchar_t* RootKey ) -{ - m_strRegKeyName = RootKey; - m_strRegKeyName.append(L"\\"); - m_strRegKeyName.append(SETTINGS_KEY_REGISTRY); - - m_hkRegKey = 0; - m_fCanWrite = false; -} - -RegistrySettings::~RegistrySettings() -{ - if (m_hkRegKey != 0) - { - RegCloseKey(m_hkRegKey); - m_hkRegKey = 0; - } -} - -bool RegistrySettings::Open(bool CanWrite) -{ - if (m_hkRegKey != 0) - return true; - - LSTATUS retVal; - - if (CanWrite) - retVal = RegCreateKey(HKEY_CURRENT_USER, m_strRegKeyName.c_str(), &m_hkRegKey); - else - retVal = RegOpenKey(HKEY_CURRENT_USER, m_strRegKeyName.c_str(), &m_hkRegKey); - - m_fCanWrite = CanWrite; - return (retVal == ERROR_SUCCESS); -} - -bool RegistrySettings::GetValue( const wchar_t* ValueName, int &Output ) -{ - if (!m_hkRegKey) return false; - - int Value; - DWORD dwValueSize = sizeof(Value); - - LSTATUS retVal = RegQueryValueEx(m_hkRegKey, ValueName, NULL, NULL, (LPBYTE) &Value, &dwValueSize); - if (retVal == ERROR_SUCCESS) - { - Output = Value; - return true; - } - - return false; -} - -bool RegistrySettings::GetValue( const wchar_t* ValueName, wchar_t *Output, size_t OutputMaxSize ) -{ - if (!m_hkRegKey) return false; - - DWORD dwValueSize = (DWORD) OutputMaxSize; - LSTATUS retVal = RegQueryValueEx(m_hkRegKey, ValueName, NULL, NULL, (LPBYTE) Output, &dwValueSize); - return (retVal == ERROR_SUCCESS); -} - -bool RegistrySettings::GetValue( const char* ValueName, char *Output, size_t OutputMaxSize ) -{ - if (!m_hkRegKey) return false; - - DWORD dwValueSize = (DWORD) OutputMaxSize; - LSTATUS retVal = RegQueryValueExA(m_hkRegKey, ValueName, NULL, NULL, (LPBYTE) Output, &dwValueSize); - return (retVal == ERROR_SUCCESS); -} - -bool RegistrySettings::GetValue( const wchar_t* ValueName, bool &Output ) -{ - if (!m_hkRegKey) return false; - - int nValue; - if (GetValue(ValueName, nValue)) - { - Output = (nValue != 0); - return true; - } - return false; -} - -bool RegistrySettings::SetValue( const wchar_t* ValueName, int Value ) -{ - if (!m_fCanWrite || !m_hkRegKey) return false; - - LSTATUS retVal = RegSetValueEx(m_hkRegKey, ValueName, 0, REG_DWORD, (LPBYTE) &Value, sizeof(Value)); - return (retVal == ERROR_SUCCESS); -} - -bool RegistrySettings::SetValue( const wchar_t* ValueName, const wchar_t *Value ) -{ - if (!m_fCanWrite || !m_hkRegKey) return false; - - size_t nDataSize = (wcslen(Value) + 1) * sizeof(wchar_t); - LSTATUS retVal = RegSetValueEx(m_hkRegKey, ValueName, 0, REG_SZ, (LPBYTE) Value, (DWORD) nDataSize); - return (retVal == ERROR_SUCCESS); -} - -bool RegistrySettings::SetValue( const char* ValueName, const char *Value ) -{ - if (!m_fCanWrite || !m_hkRegKey) return false; - - size_t nDataSize = (strlen(Value) + 1) * sizeof(char); - LSTATUS retVal = RegSetValueExA(m_hkRegKey, ValueName, 0, REG_SZ, (LPBYTE) Value, (DWORD) nDataSize); - return (retVal == ERROR_SUCCESS); -} - -bool RegistrySettings::SetValue( const wchar_t* ValueName, bool Value ) -{ - return SetValue(ValueName, Value ? 1 : 0); -} diff --git a/source/RegistrySettings.h b/source/RegistrySettings.h deleted file mode 100644 index fb2d63e..0000000 --- a/source/RegistrySettings.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef RegistrySettings_h__ -#define RegistrySettings_h__ - -class RegistrySettings -{ -private: - std::wstring m_strRegKeyName; - HKEY m_hkRegKey; - bool m_fCanWrite; - - // Make class non-copyable - RegistrySettings(const RegistrySettings &other) = delete; - RegistrySettings& operator =(const RegistrySettings &other) = delete; - -public: - RegistrySettings(const wchar_t* RootKey); - ~RegistrySettings(); - - bool Open(bool CanWrite = false); - - bool GetValue(const wchar_t* ValueName, int &Output); - bool GetValue(const wchar_t* ValueName, bool &Output); - bool GetValue(const wchar_t* ValueName, wchar_t *Output, size_t OutputMaxSize); - bool GetValue(const char* ValueName, char *Output, size_t OutputMaxSize); - - bool SetValue(const wchar_t* ValueName, int Value); - bool SetValue(const wchar_t* ValueName, bool Value); - bool SetValue(const wchar_t* ValueName, const wchar_t *Value); - bool SetValue(const char* ValueName, const char *Value); -}; - -#endif // RegistrySettings_h__ \ No newline at end of file diff --git a/source/m4/FILE_ID.DIZ.m4 b/source/m4/FILE_ID.DIZ.m4 index c6f97d7..a90b67c 100644 --- a/source/m4/FILE_ID.DIZ.m4 +++ b/source/m4/FILE_ID.DIZ.m4 @@ -1,6 +1,6 @@ m4_include(`version.m4i')m4_dnl Integrity Checker PLUGIN_VERSION -Plugin for FAR 2.0, 3.0 +Plugin for 3.0 --------------------------- This plugin allows creation and diff --git a/source/m4/readme_pl.txt.m4 b/source/m4/readme_pl.txt.m4 index 5384a67..1cae880 100644 --- a/source/m4/readme_pl.txt.m4 +++ b/source/m4/readme_pl.txt.m4 @@ -19,7 +19,7 @@ CRC32, MD5, SHA1, SHA-256, SHA-512, SHA3-512, Whirlpool Wtyczka bazuje na kodzie programu RHash (https://github.com/rhash/RHash). 2. Wymagania. -Minimalna wersja FAR do pracy z wtyczkÄ… to 2.0.1807 i 3.0.5886 +Minimalna wersja FAR do pracy z wtyczkÄ… to 3.0.5886 3. Gwarancja. Wtyczka jest udostÄ™pniana "jak jest" (bez gwarancji). Autor nie odpowiada diff --git a/source/m4/readme_ru.txt.m4 b/source/m4/readme_ru.txt.m4 index 9e68469..8fd3430 100644 --- a/source/m4/readme_ru.txt.m4 +++ b/source/m4/readme_ru.txt.m4 @@ -18,7 +18,7 @@ CRC32, MD5, SHA1, SHA-256, SHA-512, SHA3-512, Whirlpool Ïëàãèí áàçèðóåòñÿ íà êîäå ïðîãðàììû RHash (https://github.com/rhash/RHash). 2. Òðåáîâàíèÿ. -Ìèíèìàëüíàÿ âåðñèÿ FAR-à äëÿ ðàáîòû ïëàãèíà 2.0.1807 è 3.0.5886 +Ìèíèìàëüíàÿ âåðñèÿ FAR-à äëÿ ðàáîòû ïëàãèíà 3.0.5886 3. Ãàðàíòèè. Ïëàãèí ïðåäîñòàâëÿåòñÿ ïî ïðèíöèïó "as-is" áåç êàêèõ-ëèáî ãàðàíòèé,