Skip to content

Commit b08aa98

Browse files
committed
ifwinactive
1 parent 193bb47 commit b08aa98

7 files changed

+62
-25
lines changed

AutoHotkeyx.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ param = nameHinstanceP.argv ; // Naveen: v6.1 Script options in nameHinstanceP.n
292292
// top part is something that's very involved and requires user interaction:
293293
Hotkey::ManifestAllHotkeysHotstringsHooks(); // We want these active now in case auto-execute never returns (e.g. loop)
294294
g_script.mIsReadyToExecute = true; // This is done only now for error reporting purposes in Hotkey.cpp.
295-
295+
g_script.xifwinactive = NULL ;
296296
// Run the auto-execute part at the top of the script (this call might never return):
297297
ResultType result = g_script.AutoExecSection();
298298
// If no hotkeys are in effect, the user hasn't requested a hook to be activated, and the script

ahkmingw_linux.depend

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# depslib dependency file v1.0
2-
1252041773 source:/home/naveen/source/ahkmingw/AutoHotkey.cpp
2+
1252539185 source:/home/naveen/source/ahkmingw/AutoHotkey.cpp
33
"stdafx.h"
44
"globaldata.h"
55
"application.h"
@@ -42,7 +42,7 @@
4242
<pshpack1.h>
4343
<pshpack4.h>
4444

45-
1252537421 /home/naveen/source/ahkmingw/script.h
45+
1252882618 /home/naveen/source/ahkmingw/script.h
4646
"stdafx.h"
4747
"defines.h"
4848
"SimpleHeap.h"
@@ -710,7 +710,7 @@
710710

711711
1252537421 /home/naveen/source/ahkmingw/exports.h
712712

713-
1252537421 source:/home/naveen/source/ahkmingw/exports.cpp
713+
1252882617 source:/home/naveen/source/ahkmingw/exports.cpp
714714
"stdafx.h"
715715
"globaldata.h"
716716
"application.h"
@@ -724,3 +724,11 @@
724724
"exports.h"
725725
"script.h"
726726

727+
1252539185 source:/home/naveen/source/ahkmingw/AutoHotkeyx.cpp
728+
"stdafx.h"
729+
"globaldata.h"
730+
"application.h"
731+
"window.h"
732+
"exports.h"
733+
<process.h>
734+

ahkmingw_linux.layout

+34-19
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,58 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
22
<CodeBlocks_layout_file>
3-
<ActiveTarget name="xDebug" />
4-
<File name="AutoHotkey.cpp" open="1" top="1" tabpos="1">
5-
<Cursor position="0" topLine="0" />
3+
<ActiveTarget name="XDebugDll" />
4+
<File name="AutoHotkey.cpp" open="1" top="0" tabpos="1">
5+
<Cursor position="17576" topLine="304" />
66
</File>
7-
<File name="application.cpp" open="0" top="0" tabpos="0">
8-
<Cursor position="112923" topLine="1777" />
7+
<File name="AutoHotkeyx.cpp" open="1" top="0" tabpos="3">
8+
<Cursor position="14941" topLine="276" />
9+
</File>
10+
<File name="application.cpp" open="1" top="0" tabpos="10">
11+
<Cursor position="52170" topLine="795" />
912
</File>
1013
<File name="application.h" open="0" top="0" tabpos="0">
1114
<Cursor position="6765" topLine="116" />
1215
</File>
13-
<File name="globaldata.cpp" open="0" top="0" tabpos="0">
14-
<Cursor position="42026" topLine="740" />
16+
<File name="defines.h" open="1" top="0" tabpos="12">
17+
<Cursor position="31570" topLine="503" />
18+
</File>
19+
<File name="exports.cpp" open="1" top="0" tabpos="5">
20+
<Cursor position="687" topLine="5" />
21+
</File>
22+
<File name="exports.h" open="1" top="0" tabpos="14">
23+
<Cursor position="968" topLine="0" />
1524
</File>
16-
<File name="globaldata.h" open="0" top="0" tabpos="0">
17-
<Cursor position="878" topLine="14" />
25+
<File name="globaldata.cpp" open="1" top="0" tabpos="4">
26+
<Cursor position="7514" topLine="152" />
27+
</File>
28+
<File name="globaldata.h" open="1" top="0" tabpos="7">
29+
<Cursor position="852" topLine="13" />
1830
</File>
1931
<File name="hook.h" open="0" top="0" tabpos="0">
2032
<Cursor position="2564" topLine="25" />
2133
</File>
22-
<File name="keyboard_mouse.h" open="0" top="0" tabpos="0">
23-
<Cursor position="15424" topLine="308" />
34+
<File name="hotkey.cpp" open="1" top="0" tabpos="11">
35+
<Cursor position="2664" topLine="58" />
36+
</File>
37+
<File name="keyboard_mouse.h" open="1" top="0" tabpos="6">
38+
<Cursor position="15427" topLine="311" />
2439
</File>
25-
<File name="script.cpp" open="1" top="0" tabpos="2">
26-
<Cursor position="349040" topLine="6908" />
40+
<File name="script.cpp" open="1" top="1" tabpos="2">
41+
<Cursor position="483066" topLine="9541" />
2742
</File>
28-
<File name="script.h" open="0" top="0" tabpos="0">
29-
<Cursor position="136" topLine="0" />
43+
<File name="script.h" open="1" top="0" tabpos="8">
44+
<Cursor position="119007" topLine="2315" />
3045
</File>
31-
<File name="script2.cpp" open="0" top="0" tabpos="0">
32-
<Cursor position="248717" topLine="5231" />
46+
<File name="script2.cpp" open="1" top="0" tabpos="9">
47+
<Cursor position="282545" topLine="5977" />
3348
</File>
3449
<File name="util.h" open="0" top="0" tabpos="0">
3550
<Cursor position="24330" topLine="505" />
3651
</File>
3752
<File name="var.h" open="0" top="0" tabpos="0">
3853
<Cursor position="4337" topLine="84" />
3954
</File>
40-
<File name="window.cpp" open="0" top="0" tabpos="0">
41-
<Cursor position="80229" topLine="1522" />
55+
<File name="window.cpp" open="1" top="0" tabpos="13">
56+
<Cursor position="25629" topLine="488" />
4257
</File>
4358
</CodeBlocks_layout_file>

exports.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ if ( !(var = g_script.FindOrAddVar(name, strlen(name))) )
1616
return -1; // Realistically should never happen.
1717
var->Assign(value);
1818
return 0; // success
19+
}
20+
21+
EXPORT int ximportfunc(ahkx_int_str func)
22+
{
23+
g_script.xifwinactive = func ;
24+
return 0;
1925
}
2026
EXPORT unsigned int ahkFindFunc(char *funcname)
2127
{

script.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -9546,8 +9546,14 @@ ResultType Line::EvaluateCondition() // __forceinline on this reduces benchmarks
95469546
if_condition = !WinExist(g, FOUR_ARGS, false, true); // Seems best to update last-used even here.
95479547
break;
95489548
case ACT_IFWINACTIVE:
9549+
{
95499550
if_condition = (WinActive(g, FOUR_ARGS, true) != NULL);
9551+
if (!if_condition) // ahkx N11
9552+
if (g_script.xifwinactive)
9553+
if_condition = g_script.xifwinactive(ARG1);
9554+
95509555
break;
9556+
}
95519557
case ACT_IFWINNOTACTIVE:
95529558
if_condition = !WinActive(g, FOUR_ARGS, true);
95539559
break;

script.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -2316,7 +2316,7 @@ class GuiType
23162316
static DWORD ControlGetListViewMode(HWND aWnd);
23172317
};
23182318

2319-
2319+
typedef int (* ahkx_int_str)(char *ahkx_str); // ahkx N11
23202320

23212321
class Script
23222322
{
@@ -2331,7 +2331,7 @@ class Script
23312331
Line *mTempLine; // for use with dll Execute # Naveen N9
23322332
Label *mTempLabel; // for use with dll Execute # Naveen N9
23332333
Func *mTempFunc; // for use with dll Execute # Naveen N9
2334-
2334+
ahkx_int_str xifwinactive ; // ahkx N11
23352335
Var **mVar, **mLazyVar; // Array of pointers-to-variable, allocated upon first use and later expanded as needed.
23362336
int mVarCount, mVarCountMax, mLazyVarCount; // Count of items in the above array as well as the maximum capacity.
23372337
WinGroup *mFirstGroup, *mLastGroup; // The first and last variables in the linked list.

tag

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
git add . ; git commit -a -m $2
2+
git tag $1

0 commit comments

Comments
 (0)