File tree Expand file tree Collapse file tree 4 files changed +30
-1
lines changed
Expand file tree Collapse file tree 4 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,11 @@ class StackCatchable
216216 bool (*mTestFunction )(Dynamic e);
217217};
218218
219+ #if defined(HXCPP_SCRIPTABLE) && (HXCPP_API_LEVEL >= 500)
220+ // This is the function to call when a new script has been loaded.
221+ // Signature: Void -> Void
222+ extern Dynamic g_onScriptLoadedFunction;
223+ #endif
219224
220225
221226#endif // HXCPP_DEBUGGER
@@ -298,6 +303,9 @@ void __hxcpp_dbg_setNewStackFrameFunction(Dynamic function);
298303void __hxcpp_dbg_setNewThreadInfoFunction (Dynamic function);
299304void __hxcpp_dbg_setAddParameterToStackFrameFunction (Dynamic function);
300305void __hxcpp_dbg_setAddStackFrameToThreadInfoFunction (Dynamic function);
306+ #if defined(HXCPP_SCRIPTABLE) && (HXCPP_API_LEVEL >= 500)
307+ void __hxcpp_dbg_setOnScriptLoadedFunction (Dynamic function);
308+ #endif
301309
302310bool __hxcpp_dbg_fix_critical_error (String inErr);
303311
@@ -351,6 +359,9 @@ inline void __hxcpp_dbg_setNewStackFrameFunction(Dynamic) { }
351359inline void __hxcpp_dbg_setNewThreadInfoFunction (Dynamic) { }
352360inline void __hxcpp_dbg_setAddParameterToStackFrameFunction (Dynamic) { }
353361inline void __hxcpp_dbg_setAddStackFrameToThreadInfoFunction (Dynamic) { }
362+ #if defined(HXCPP_SCRIPTABLE) && (HXCPP_API_LEVEL >= 500)
363+ inline void __hxcpp_dbg_setOnScriptLoadedFunction (Dynamic) { }
364+ #endif
354365
355366// The following functions are called by Thread.cpp to notify of thread
356367// created and terminated
Original file line number Diff line number Diff line change @@ -56,6 +56,9 @@ static Dynamic g_addParameterToStackFrameFunction;
5656// Signature: inThreadInfo : Dynamic -> inStackFrame : Dynamic -> Void
5757static Dynamic g_addStackFrameToThreadInfoFunction;
5858
59+ #if defined(HXCPP_SCRIPTABLE) && (HXCPP_API_LEVEL >= 500)
60+ Dynamic g_onScriptLoadedFunction{};
61+ #endif
5962
6063// This is the thread number of the debugger thread, extracted from
6164// information about the thread that called
@@ -1454,6 +1457,15 @@ void __hxcpp_dbg_setAddStackFrameToThreadInfoFunction(Dynamic function)
14541457}
14551458
14561459
1460+ #if defined(HXCPP_SCRIPTABLE) && (HXCPP_API_LEVEL >= 500)
1461+ void __hxcpp_dbg_setOnScriptLoadedFunction (Dynamic function)
1462+ {
1463+ hx::g_onScriptLoadedFunction = function;
1464+ GCAddRoot (&(hx::g_onScriptLoadedFunction.mPtr ));
1465+ }
1466+ #endif
1467+
1468+
14571469Dynamic __hxcpp_dbg_checkedThrow (Dynamic toThrow)
14581470{
14591471 if (!hx::CanBeCaught (toThrow))
Original file line number Diff line number Diff line change @@ -111,6 +111,12 @@ void CppiaModule::registerDebugger()
111111 for (hx::UnorderedSet<int >::const_iterator i = allFileIds.begin (); i!=allFileIds.end (); ++i)
112112 addScriptableFile (strings[*i]);
113113
114+ #if (HXCPP_API_LEVEL >= 500)
115+ if (hx::g_onScriptLoadedFunction != null{}) {
116+ hx::g_onScriptLoadedFunction ();
117+ }
118+ #endif
119+
114120 #endif
115121}
116122
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ typedef Linkers = Hash<Linker>;
4545
4646class BuildTool
4747{
48- public inline static var SupportedVersion = 430 ;
48+ public inline static var SupportedVersion = 500 ;
4949
5050 var mDefines : Hash <String >;
5151 var mCurrentIncludeFile : String ;
You can’t perform that action at this time.
0 commit comments