diff options
author | Anatol Pomozov <anatol.pomozov@gmail.com> | 2020-04-17 19:36:38 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2020-05-09 03:58:39 +0200 |
commit | b96e0df4dceaa2677baa1a3563211950708d3e63 (patch) | |
tree | 00a5b415673f78eb4ad8bfa2dda037ff3744f35e /src/pacman/callback.h | |
parent | c78eb48d915dc22146073162dda08ddf73c4a508 (diff) | |
download | pacman-b96e0df4dceaa2677baa1a3563211950708d3e63.tar.gz pacman-b96e0df4dceaa2677baa1a3563211950708d3e63.tar.xz |
Implement multibar UI
Multiplexed download requires ability to draw UI for multiple active progress
bars. To implement it we use ANSI codes to move cursor up/down and then
redraw the required progress bar.
`pacman_multibar_ui.active_downloads` field represents the list of active
downloads that correspond to progress bars.
`struct pacman_progress_bar` is a data structure for a progress bar.
In some cases (e.g. database downloads) we want to keep progress bars in order.
In some other cases (package downloads) we want to move completed items to the
top of the screen. Function `multibar_move_completed_up` allows to configure
such behavior.
Per discussion in the maillist we do not want to show download progress for
signature files.
Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src/pacman/callback.h')
-rw-r--r-- | src/pacman/callback.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pacman/callback.h b/src/pacman/callback.h index 6d92e86b..09d544a6 100644 --- a/src/pacman/callback.h +++ b/src/pacman/callback.h @@ -20,6 +20,7 @@ #ifndef PM_CALLBACK_H #define PM_CALLBACK_H +#include <stdbool.h> #include <sys/types.h> /* off_t */ #include <alpm.h> @@ -44,4 +45,7 @@ void cb_download(const char *filename, alpm_download_event_type_t event, __attribute__((format(printf, 2, 0))) void cb_log(alpm_loglevel_t level, const char *fmt, va_list args); +/* specify if multibar UI should move completed bars to the top of the screen */ +void multibar_move_completed_up(bool value); + #endif /* PM_CALLBACK_H */ |