From 4355930066694459826289901552944087990236 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Mon, 10 Feb 2025 23:02:37 -0500 Subject: Add typedef for ProgressFunction and add DefaultProgressFunction --- binaryninjaapi.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index ac7cbea9..c80b2510 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -2000,6 +2000,9 @@ namespace BinaryNinja { */ bool OpenUrl(const std::string& url); + typedef std::function ProgressFunction; + bool DefaultProgressFunction(size_t, size_t); + /*! Run a given task in a background thread, and show an updating progress bar which the user can cancel @threadsafe @@ -2011,7 +2014,7 @@ namespace BinaryNinja { to cancel, and the task should handle this appropriately. \return True if not cancelled */ - bool RunProgressDialog(const std::string& title, bool canCancel, std::function progress)> task); + bool RunProgressDialog(const std::string& title, bool canCancel, std::function task); /*! Split a single progress function into equally sized subparts. @@ -2030,8 +2033,8 @@ namespace BinaryNinja { \param subpartCount Total number of subparts \return A function that will call originalFn() within a modified progress region */ - std::function SplitProgress( - std::function originalFn, size_t subpart, size_t subpartCount); + ProgressFunction SplitProgress( + ProgressFunction originalFn, size_t subpart, size_t subpartCount); /*! @@ -2052,8 +2055,8 @@ namespace BinaryNinja { \param subpartWeights Weights of subparts, described above \return A function that will call originalFn() within a modified progress region */ - std::function SplitProgress( - std::function originalFn, size_t subpart, std::vector subpartWeights); + ProgressFunction SplitProgress( + ProgressFunction originalFn, size_t subpart, std::vector subpartWeights); struct ProgressContext { -- cgit v1.3.1