[FarGroup/FarManager] master: LuaFAR: refactoring (b5abe8f58)

0 views
Skip to first unread message

farg...@farmanager.com

unread,
Jun 11, 2024, 6:15:43 PMJun 11
to farco...@googlegroups.com
Repository : https://github.com/FarGroup/FarManager
On branch : master
Link : https://github.com/FarGroup/FarManager/commit/b5abe8f582738b5a8e31077df22e7f10b09042f6

>---------------------------------------------------------------

commit b5abe8f582738b5a8e31077df22e7f10b09042f6
Author: Shmuel Zeigerman <solo...@gmail.com>
Date: Wed Jun 12 01:02:19 2024 +0300

LuaFAR: refactoring


>---------------------------------------------------------------

b5abe8f582738b5a8e31077df22e7f10b09042f6
plugins/luamacro/_globalinfo.lua | 2 +-
plugins/luamacro/changelog | 4 +
plugins/luamacro/luafar/service.c | 176 +++++++++++++++++++-------------------
plugins/luamacro/luafar/version.h | 2 +-
4 files changed, 94 insertions(+), 90 deletions(-)

diff --git a/plugins/luamacro/_globalinfo.lua b/plugins/luamacro/_globalinfo.lua
index b74939e83..4189a485c 100644
--- a/plugins/luamacro/_globalinfo.lua
+++ b/plugins/luamacro/_globalinfo.lua
@@ -1,6 +1,6 @@
function export.GetGlobalInfo()
return {
- Version = { 3, 0, 0, 841 },
+ Version = { 3, 0, 0, 842 },
MinFarVersion = { 3, 0, 0, 6327 },
Guid = win.Uuid("4EBBEFC8-2084-4B7F-94C0-692CE136894D"),
Title = "LuaMacro",
diff --git a/plugins/luamacro/changelog b/plugins/luamacro/changelog
index c3d17bb8e..a490b3793 100644
--- a/plugins/luamacro/changelog
+++ b/plugins/luamacro/changelog
@@ -1,3 +1,7 @@
+shmuel 2024-06-12 01:00:14+03:00 - build 842
+
+1. LuaFAR: refactoring
+
shmuel 2024-06-09 21:52:16+03:00 - build 841

1. LuaFAR: make tostring on bit64 output in hex.
diff --git a/plugins/luamacro/luafar/service.c b/plugins/luamacro/luafar/service.c
index f501f0fdd..da427e698 100644
--- a/plugins/luamacro/luafar/service.c
+++ b/plugins/luamacro/luafar/service.c
@@ -3665,75 +3665,75 @@ static int DoSendDlgMessage (lua_State *L, intptr_t Msg, int delta)
return 1;
}

-#define DlgMethod(name,msg,delta) \
-static int dlg_##name(lua_State *L) { return DoSendDlgMessage(L,msg,delta); }
+#define DlgMethod(name,msg) \
+static int dlg_##name(lua_State *L) { return DoSendDlgMessage(L,msg,1); }

static int far_SendDlgMessage(lua_State *L) { return DoSendDlgMessage(L,0,0); }

-DlgMethod( AddHistory, DM_ADDHISTORY, 1)
-DlgMethod( Close, DM_CLOSE, 1)
-DlgMethod( EditUnchangedFlag, DM_EDITUNCHANGEDFLAG, 1)
-DlgMethod( Enable, DM_ENABLE, 1)
-DlgMethod( EnableRedraw, DM_ENABLEREDRAW, 1)
-DlgMethod( GetCheck, DM_GETCHECK, 1)
-DlgMethod( GetComboboxEvent, DM_GETCOMBOBOXEVENT, 1)
-DlgMethod( GetConstTextPtr, DM_GETCONSTTEXTPTR, 1)
-DlgMethod( GetCursorPos, DM_GETCURSORPOS, 1)
-DlgMethod( GetCursorSize, DM_GETCURSORSIZE, 1)
-DlgMethod( GetDialogInfo, DM_GETDIALOGINFO, 1)
-DlgMethod( GetDialogTitle, DM_GETDIALOGTITLE, 1)
-DlgMethod( GetDlgData, DM_GETDLGDATA, 1)
-DlgMethod( GetDlgItem, DM_GETDLGITEM, 1)
-DlgMethod( GetDlgRect, DM_GETDLGRECT, 1)
-DlgMethod( GetDropdownOpened, DM_GETDROPDOWNOPENED, 1)
-DlgMethod( GetEditPosition, DM_GETEDITPOSITION, 1)
-DlgMethod( GetFocus, DM_GETFOCUS, 1)
-DlgMethod( GetItemData, DM_GETITEMDATA, 1)
-DlgMethod( GetItemPosition, DM_GETITEMPOSITION, 1)
-DlgMethod( GetSelection, DM_GETSELECTION, 1)
-DlgMethod( GetText, DM_GETTEXT, 1)
-DlgMethod( Key, DM_KEY, 1)
-DlgMethod( ListAdd, DM_LISTADD, 1)
-DlgMethod( ListAddStr, DM_LISTADDSTR, 1)
-DlgMethod( ListDelete, DM_LISTDELETE, 1)
-DlgMethod( ListFindString, DM_LISTFINDSTRING, 1)
-DlgMethod( ListGetCurPos, DM_LISTGETCURPOS, 1)
-DlgMethod( ListGetData, DM_LISTGETDATA, 1)
-DlgMethod( ListGetDataSize, DM_LISTGETDATASIZE, 1)
-DlgMethod( ListGetItem, DM_LISTGETITEM, 1)
-DlgMethod( ListGetTitles, DM_LISTGETTITLES, 1)
-DlgMethod( ListInfo, DM_LISTINFO, 1)
-DlgMethod( ListInsert, DM_LISTINSERT, 1)
-DlgMethod( ListSet, DM_LISTSET, 1)
-DlgMethod( ListSetCurPos, DM_LISTSETCURPOS, 1)
-DlgMethod( ListSetData, DM_LISTSETDATA, 1)
-DlgMethod( ListSetTitles, DM_LISTSETTITLES, 1)
-DlgMethod( ListSort, DM_LISTSORT, 1)
-DlgMethod( ListUpdate, DM_LISTUPDATE, 1)
-DlgMethod( MoveDialog, DM_MOVEDIALOG, 1)
-DlgMethod( Redraw, DM_REDRAW, 1)
-DlgMethod( ResizeDialog, DM_RESIZEDIALOG, 1)
-DlgMethod( Set3State, DM_SET3STATE, 1)
-DlgMethod( SetCheck, DM_SETCHECK, 1)
-DlgMethod( SetComboboxEvent, DM_SETCOMBOBOXEVENT, 1)
-DlgMethod( SetCursorPos, DM_SETCURSORPOS, 1)
-DlgMethod( SetCursorSize, DM_SETCURSORSIZE, 1)
-DlgMethod( SetDlgData, DM_SETDLGDATA, 1)
-DlgMethod( SetDlgItem, DM_SETDLGITEM, 1)
-DlgMethod( SetDropdownOpened, DM_SETDROPDOWNOPENED, 1)
-DlgMethod( SetEditPosition, DM_SETEDITPOSITION, 1)
-DlgMethod( SetFocus, DM_SETFOCUS, 1)
-DlgMethod( SetHistory, DM_SETHISTORY, 1)
-DlgMethod( SetInputNotify, DM_SETINPUTNOTIFY, 1)
-DlgMethod( SetItemData, DM_SETITEMDATA, 1)
-DlgMethod( SetItemPosition, DM_SETITEMPOSITION, 1)
-DlgMethod( SetMaxTextLength, DM_SETMAXTEXTLENGTH, 1)
-DlgMethod( SetSelection, DM_SETSELECTION, 1)
-DlgMethod( SetText, DM_SETTEXT, 1)
-DlgMethod( SetTextPtr, DM_SETTEXTPTR, 1)
-DlgMethod( ShowDialog, DM_SHOWDIALOG, 1)
-DlgMethod( ShowItem, DM_SHOWITEM, 1)
-DlgMethod( User, DM_USER, 1)
+DlgMethod( AddHistory, DM_ADDHISTORY)
+DlgMethod( Close, DM_CLOSE)
+DlgMethod( EditUnchangedFlag, DM_EDITUNCHANGEDFLAG)
+DlgMethod( Enable, DM_ENABLE)
+DlgMethod( EnableRedraw, DM_ENABLEREDRAW)
+DlgMethod( GetCheck, DM_GETCHECK)
+DlgMethod( GetComboboxEvent, DM_GETCOMBOBOXEVENT)
+DlgMethod( GetConstTextPtr, DM_GETCONSTTEXTPTR)
+DlgMethod( GetCursorPos, DM_GETCURSORPOS)
+DlgMethod( GetCursorSize, DM_GETCURSORSIZE)
+DlgMethod( GetDialogInfo, DM_GETDIALOGINFO)
+DlgMethod( GetDialogTitle, DM_GETDIALOGTITLE)
+DlgMethod( GetDlgData, DM_GETDLGDATA)
+DlgMethod( GetDlgItem, DM_GETDLGITEM)
+DlgMethod( GetDlgRect, DM_GETDLGRECT)
+DlgMethod( GetDropdownOpened, DM_GETDROPDOWNOPENED)
+DlgMethod( GetEditPosition, DM_GETEDITPOSITION)
+DlgMethod( GetFocus, DM_GETFOCUS)
+DlgMethod( GetItemData, DM_GETITEMDATA)
+DlgMethod( GetItemPosition, DM_GETITEMPOSITION)
+DlgMethod( GetSelection, DM_GETSELECTION)
+DlgMethod( GetText, DM_GETTEXT)
+DlgMethod( Key, DM_KEY)
+DlgMethod( ListAdd, DM_LISTADD)
+DlgMethod( ListAddStr, DM_LISTADDSTR)
+DlgMethod( ListDelete, DM_LISTDELETE)
+DlgMethod( ListFindString, DM_LISTFINDSTRING)
+DlgMethod( ListGetCurPos, DM_LISTGETCURPOS)
+DlgMethod( ListGetData, DM_LISTGETDATA)
+DlgMethod( ListGetDataSize, DM_LISTGETDATASIZE)
+DlgMethod( ListGetItem, DM_LISTGETITEM)
+DlgMethod( ListGetTitles, DM_LISTGETTITLES)
+DlgMethod( ListInfo, DM_LISTINFO)
+DlgMethod( ListInsert, DM_LISTINSERT)
+DlgMethod( ListSet, DM_LISTSET)
+DlgMethod( ListSetCurPos, DM_LISTSETCURPOS)
+DlgMethod( ListSetData, DM_LISTSETDATA)
+DlgMethod( ListSetTitles, DM_LISTSETTITLES)
+DlgMethod( ListSort, DM_LISTSORT)
+DlgMethod( ListUpdate, DM_LISTUPDATE)
+DlgMethod( MoveDialog, DM_MOVEDIALOG)
+DlgMethod( Redraw, DM_REDRAW)
+DlgMethod( ResizeDialog, DM_RESIZEDIALOG)
+DlgMethod( Set3State, DM_SET3STATE)
+DlgMethod( SetCheck, DM_SETCHECK)
+DlgMethod( SetComboboxEvent, DM_SETCOMBOBOXEVENT)
+DlgMethod( SetCursorPos, DM_SETCURSORPOS)
+DlgMethod( SetCursorSize, DM_SETCURSORSIZE)
+DlgMethod( SetDlgData, DM_SETDLGDATA)
+DlgMethod( SetDlgItem, DM_SETDLGITEM)
+DlgMethod( SetDropdownOpened, DM_SETDROPDOWNOPENED)
+DlgMethod( SetEditPosition, DM_SETEDITPOSITION)
+DlgMethod( SetFocus, DM_SETFOCUS)
+DlgMethod( SetHistory, DM_SETHISTORY)
+DlgMethod( SetInputNotify, DM_SETINPUTNOTIFY)
+DlgMethod( SetItemData, DM_SETITEMDATA)
+DlgMethod( SetItemPosition, DM_SETITEMPOSITION)
+DlgMethod( SetMaxTextLength, DM_SETMAXTEXTLENGTH)
+DlgMethod( SetSelection, DM_SETSELECTION)
+DlgMethod( SetText, DM_SETTEXT)
+DlgMethod( SetTextPtr, DM_SETTEXTPTR)
+DlgMethod( ShowDialog, DM_SHOWDIALOG)
+DlgMethod( ShowItem, DM_SHOWITEM)
+DlgMethod( User, DM_USER)

int PushDNParams (lua_State *L, intptr_t Msg, intptr_t Param1, void *Param2)
{
@@ -5044,31 +5044,31 @@ static int DoAdvControl (lua_State *L, int Command, int Delta)
return 1;
}

-#define AdvCommand(name,command,delta) \
-static int adv_##name(lua_State *L) { return DoAdvControl(L,command,delta); }
+#define AdvCommand(name,command) \
+static int adv_##name(lua_State *L) { return DoAdvControl(L,command,1); }

static int far_AdvControl(lua_State *L) { return DoAdvControl(L,0,0); }

-AdvCommand( Commit, ACTL_COMMIT, 1)
-AdvCommand( GetArrayColor, ACTL_GETARRAYCOLOR, 1)
-AdvCommand( GetColor, ACTL_GETCOLOR, 1)
-AdvCommand( GetCursorPos, ACTL_GETCURSORPOS, 1)
-AdvCommand( GetFarHwnd, ACTL_GETFARHWND, 1)
-AdvCommand( GetFarmanagerVersion, ACTL_GETFARMANAGERVERSION, 1)
-AdvCommand( GetFarRect, ACTL_GETFARRECT, 1)
-AdvCommand( GetWindowCount, ACTL_GETWINDOWCOUNT, 1)
-AdvCommand( GetWindowInfo, ACTL_GETWINDOWINFO, 1)
-AdvCommand( GetWindowType, ACTL_GETWINDOWTYPE, 1)
-AdvCommand( ProgressNotify, ACTL_PROGRESSNOTIFY, 1)
-AdvCommand( Quit, ACTL_QUIT, 1)
-AdvCommand( RedrawAll, ACTL_REDRAWALL, 1)
-AdvCommand( SetArrayColor, ACTL_SETARRAYCOLOR, 1)
-AdvCommand( SetCurrentWindow, ACTL_SETCURRENTWINDOW, 1)
-AdvCommand( SetCursorPos, ACTL_SETCURSORPOS, 1)
-AdvCommand( SetProgressState, ACTL_SETPROGRESSSTATE, 1)
-AdvCommand( SetProgressValue, ACTL_SETPROGRESSVALUE, 1)
-AdvCommand( Synchro, ACTL_SYNCHRO, 1)
-AdvCommand( Waitkey, ACTL_WAITKEY, 1)
+AdvCommand( Commit, ACTL_COMMIT)
+AdvCommand( GetArrayColor, ACTL_GETARRAYCOLOR)
+AdvCommand( GetColor, ACTL_GETCOLOR)
+AdvCommand( GetCursorPos, ACTL_GETCURSORPOS)
+AdvCommand( GetFarHwnd, ACTL_GETFARHWND)
+AdvCommand( GetFarmanagerVersion, ACTL_GETFARMANAGERVERSION)
+AdvCommand( GetFarRect, ACTL_GETFARRECT)
+AdvCommand( GetWindowCount, ACTL_GETWINDOWCOUNT)
+AdvCommand( GetWindowInfo, ACTL_GETWINDOWINFO)
+AdvCommand( GetWindowType, ACTL_GETWINDOWTYPE)
+AdvCommand( ProgressNotify, ACTL_PROGRESSNOTIFY)
+AdvCommand( Quit, ACTL_QUIT)
+AdvCommand( RedrawAll, ACTL_REDRAWALL)
+AdvCommand( SetArrayColor, ACTL_SETARRAYCOLOR)
+AdvCommand( SetCurrentWindow, ACTL_SETCURRENTWINDOW)
+AdvCommand( SetCursorPos, ACTL_SETCURSORPOS)
+AdvCommand( SetProgressState, ACTL_SETPROGRESSSTATE)
+AdvCommand( SetProgressValue, ACTL_SETPROGRESSVALUE)
+AdvCommand( Synchro, ACTL_SYNCHRO)
+AdvCommand( Waitkey, ACTL_WAITKEY)

static int far_MacroLoadAll(lua_State* L)
{
diff --git a/plugins/luamacro/luafar/version.h b/plugins/luamacro/luafar/version.h
index fd5c1b5d9..181809198 100644
--- a/plugins/luamacro/luafar/version.h
+++ b/plugins/luamacro/luafar/version.h
@@ -1,3 +1,3 @@
#include <farversion.hpp>

-#define PLUGIN_BUILD 841
+#define PLUGIN_BUILD 842


Reply all
Reply to author
Forward
0 new messages