Release 4.10 tools/perf/ui/tui/progress.c
#include "../cache.h"
#include "../progress.h"
#include "../libslang.h"
#include "../ui.h"
#include "tui.h"
#include "../browser.h"
static void tui_progress__update(struct ui_progress *p)
{
int bar, y;
/*
* FIXME: We should have a per UI backend way of showing progress,
* stdio will just show a percentage as NN%, etc.
*/
if (use_browser <= 0)
return;
if (p->total == 0)
return;
ui__refresh_dimensions(false);
pthread_mutex_lock(&ui__lock);
y = SLtt_Screen_Rows / 2 - 2;
SLsmg_set_color(0);
SLsmg_draw_box(y, 0, 3, SLtt_Screen_Cols);
SLsmg_gotorc(y++, 1);
SLsmg_write_string((char *)p->title);
SLsmg_fill_region(y, 1, 1, SLtt_Screen_Cols - 2, ' ');
SLsmg_set_color(HE_COLORSET_SELECTED);
bar = ((SLtt_Screen_Cols - 2) * p->curr) / p->total;
SLsmg_fill_region(y, 1, 1, bar, ' ');
SLsmg_refresh();
pthread_mutex_unlock(&ui__lock);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
arnaldo carvalho de melo | arnaldo carvalho de melo | 129 | 87.76% | 5 | 71.43% |
patrick palka | patrick palka | 16 | 10.88% | 1 | 14.29% |
namhyung kim | namhyung kim | 2 | 1.36% | 1 | 14.29% |
| Total | 147 | 100.00% | 7 | 100.00% |
static void tui_progress__finish(void)
{
int y;
if (use_browser <= 0)
return;
ui__refresh_dimensions(false);
pthread_mutex_lock(&ui__lock);
y = SLtt_Screen_Rows / 2 - 2;
SLsmg_set_color(0);
SLsmg_fill_region(y, 0, 3, SLtt_Screen_Cols, ' ');
SLsmg_refresh();
pthread_mutex_unlock(&ui__lock);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
arnaldo carvalho de melo | arnaldo carvalho de melo | 64 | 100.00% | 1 | 100.00% |
| Total | 64 | 100.00% | 1 | 100.00% |
static struct ui_progress_ops tui_progress__ops =
{
.update = tui_progress__update,
.finish = tui_progress__finish,
};
void tui_progress__init(void)
{
ui_progress__ops = &tui_progress__ops;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
namhyung kim | namhyung kim | 9 | 75.00% | 1 | 50.00% |
arnaldo carvalho de melo | arnaldo carvalho de melo | 3 | 25.00% | 1 | 50.00% |
| Total | 12 | 100.00% | 2 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
arnaldo carvalho de melo | arnaldo carvalho de melo | 217 | 84.11% | 7 | 70.00% |
namhyung kim | namhyung kim | 25 | 9.69% | 2 | 20.00% |
patrick palka | patrick palka | 16 | 6.20% | 1 | 10.00% |
| Total | 258 | 100.00% | 10 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.