@@ -2000,6 +2000,9 @@ namespace BinaryNinja {
20002000 */
20012001 bool OpenUrl(const std::string& url);
20022002
2003+ typedef std::function<bool(size_t, size_t)> ProgressFunction;
2004+ bool DefaultProgressFunction(size_t, size_t);
2005+
20032006 /*! Run a given task in a background thread, and show an updating progress bar which the user can cancel
20042007
20052008 @threadsafe
@@ -2011,7 +2014,7 @@ namespace BinaryNinja {
20112014 to cancel, and the task should handle this appropriately.
20122015 \return True if not cancelled
20132016 */
2014- bool RunProgressDialog(const std::string& title, bool canCancel, std::function<void(std::function<bool(size_t, size_t)> progress)> task);
2017+ bool RunProgressDialog(const std::string& title, bool canCancel, std::function<void(ProgressFunction progress)> task);
20152018
20162019 /*!
20172020 Split a single progress function into equally sized subparts.
@@ -2030,8 +2033,8 @@ namespace BinaryNinja {
20302033 \param subpartCount Total number of subparts
20312034 \return A function that will call originalFn() within a modified progress region
20322035 */
2033- std::function<bool(size_t, size_t)> SplitProgress(
2034- std::function<bool(size_t, size_t)> originalFn, size_t subpart, size_t subpartCount);
2036+ ProgressFunction SplitProgress(
2037+ ProgressFunction originalFn, size_t subpart, size_t subpartCount);
20352038
20362039
20372040 /*!
@@ -2052,8 +2055,8 @@ namespace BinaryNinja {
20522055 \param subpartWeights Weights of subparts, described above
20532056 \return A function that will call originalFn() within a modified progress region
20542057 */
2055- std::function<bool(size_t, size_t)> SplitProgress(
2056- std::function<bool(size_t, size_t)> originalFn, size_t subpart, std::vector<double> subpartWeights);
2058+ ProgressFunction SplitProgress(
2059+ ProgressFunction originalFn, size_t subpart, std::vector<double> subpartWeights);
20572060
20582061 struct ProgressContext
20592062 {
0 commit comments