Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Oct 29, 2023
1 parent f69edb5 commit 7e01c0e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 23 deletions.
Binary file modified luafar/manuals/luafar2m_manual.chm
Binary file not shown.
19 changes: 0 additions & 19 deletions luafar/src/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -4428,10 +4428,6 @@ int DoAdvControl (lua_State *L, int Command, int Delta)
default:
return luaL_argerror(L, 1, "command not supported");

case ACTL_GETFARHWND:
int1 = PSInfo.AdvControl(pd->ModuleNumber, Command, NULL);
return lua_pushlightuserdata(L, (void*)int1), 1;

case ACTL_GETCONFIRMATIONS:
case ACTL_GETDESCSETTINGS:
case ACTL_GETDIALOGSETTINGS:
Expand Down Expand Up @@ -4476,17 +4472,6 @@ int DoAdvControl (lua_State *L, int Command, int Delta)
PSInfo.AdvControl(pd->ModuleNumber, Command, buf);
return push_utf8_string(L,buf,-1), 1;

case ACTL_EJECTMEDIA: {
struct ActlEjectMedia em;
luaL_checktype(L, pos2, LUA_TTABLE);
lua_getfield(L, pos2, "Letter");
em.Letter = lua_isstring(L,-1) ? lua_tostring(L,-1)[0] : '\0';
lua_getfield(L, pos2, "Flags");
em.Flags = CheckFlags(L,-1);
lua_pushboolean(L, PSInfo.AdvControl(pd->ModuleNumber, Command, &em));
return 1;
}

case ACTL_GETARRAYCOLOR: {
int i;
int size = PSInfo.AdvControl(pd->ModuleNumber, Command, NULL);
Expand Down Expand Up @@ -4612,14 +4597,12 @@ int adv_##name(lua_State *L) { return DoAdvControl(L,command,delta); }
int far_AdvControl(lua_State *L) { return DoAdvControl(L,0,0); }

AdvCommand( Commit, ACTL_COMMIT, 1)
AdvCommand( EjectMedia, ACTL_EJECTMEDIA, 1)
AdvCommand( GetArrayColor, ACTL_GETARRAYCOLOR, 1)
AdvCommand( GetColor, ACTL_GETCOLOR, 1)
AdvCommand( GetConfirmations, ACTL_GETCONFIRMATIONS, 1)
AdvCommand( GetCursorPos, ACTL_GETCURSORPOS, 1)
AdvCommand( GetDescSettings, ACTL_GETDESCSETTINGS, 1)
AdvCommand( GetDialogSettings, ACTL_GETDIALOGSETTINGS, 1)
AdvCommand( GetFarHwnd, ACTL_GETFARHWND, 1)
AdvCommand( GetFarRect, ACTL_GETFARRECT, 1)
AdvCommand( GetFarVersion, ACTL_GETFARVERSION, 1)
AdvCommand( GetInterfaceSettings, ACTL_GETINTERFACESETTINGS, 1)
Expand Down Expand Up @@ -5909,14 +5892,12 @@ static const luaL_Reg dialog_methods[] = {
static const luaL_Reg actl_funcs[] =
{
{"Commit", adv_Commit},
{"EjectMedia", adv_EjectMedia},
{"GetArrayColor", adv_GetArrayColor},
{"GetColor", adv_GetColor},
{"GetConfirmations", adv_GetConfirmations},
{"GetCursorPos", adv_GetCursorPos},
{"GetDescSettings", adv_GetDescSettings},
{"GetDialogSettings", adv_GetDialogSettings},
{"GetFarHwnd", adv_GetFarHwnd},
{"GetFarRect", adv_GetFarRect},
{"GetFarVersion", adv_GetFarVersion},
{"GetInterfaceSettings", adv_GetInterfaceSettings},
Expand Down
4 changes: 0 additions & 4 deletions luamacro/src/macrotest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1427,8 +1427,6 @@ end
local function test_AdvControl_Misc()
local t

assert_udata(far.AdvControl("ACTL_GETFARHWND"))

assert_eq (far.AdvControl("ACTL_GETFARVERSION"):sub(1,1), "2")
assert_eq (far.AdvControl("ACTL_GETFARVERSION",true), 2)

Expand All @@ -1450,15 +1448,13 @@ end

local function test_ACTL()
assert_func ( actl.Commit)
assert_func ( actl.EjectMedia)
assert_table ( actl.GetArrayColor())
assert_range ( #actl.GetArrayColor(),142,152)
assert_num ( actl.GetColor("COL_DIALOGBOXTITLE"))
assert_num ( actl.GetConfirmations())
assert_table ( actl.GetCursorPos())
assert_num ( actl.GetDescSettings())
assert_num ( actl.GetDialogSettings())
assert_udata ( actl.GetFarHwnd())
assert_table ( actl.GetFarRect())
assert_str ( actl.GetFarVersion())
assert_num ( actl.GetFarVersion(true))
Expand Down

0 comments on commit 7e01c0e

Please sign in to comment.