diff options
Diffstat (limited to 'tools/perf/ui/gtk/progress.c')
-rw-r--r-- | tools/perf/ui/gtk/progress.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/perf/ui/gtk/progress.c b/tools/perf/ui/gtk/progress.c index 482bcf3..b656655 100644 --- a/tools/perf/ui/gtk/progress.c +++ b/tools/perf/ui/gtk/progress.c @@ -7,14 +7,14 @@ static GtkWidget *dialog; static GtkWidget *progress; -static void gtk_progress_update(u64 curr, u64 total, const char *title) +static void gtk_ui_progress__update(struct ui_progress *p) { - double fraction = total ? 1.0 * curr / total : 0.0; + double fraction = p->total ? 1.0 * p->curr / p->total : 0.0; char buf[1024]; if (dialog == NULL) { GtkWidget *vbox = gtk_vbox_new(TRUE, 5); - GtkWidget *label = gtk_label_new(title); + GtkWidget *label = gtk_label_new(p->title); dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL); progress = gtk_progress_bar_new(); @@ -32,7 +32,7 @@ static void gtk_progress_update(u64 curr, u64 total, const char *title) } gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress), fraction); - snprintf(buf, sizeof(buf), "%"PRIu64" / %"PRIu64, curr, total); + snprintf(buf, sizeof(buf), "%"PRIu64" / %"PRIu64, p->curr, p->total); gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress), buf); /* we didn't call gtk_main yet, so do it manually */ @@ -40,7 +40,7 @@ static void gtk_progress_update(u64 curr, u64 total, const char *title) gtk_main_iteration(); } -static void gtk_progress_finish(void) +static void gtk_ui_progress__finish(void) { /* this will also destroy all of its children */ gtk_widget_destroy(dialog); @@ -48,12 +48,12 @@ static void gtk_progress_finish(void) dialog = NULL; } -static struct ui_progress gtk_progress_fns = { - .update = gtk_progress_update, - .finish = gtk_progress_finish, +static struct ui_progress_ops gtk_ui_progress__ops = { + .update = gtk_ui_progress__update, + .finish = gtk_ui_progress__finish, }; -void perf_gtk__init_progress(void) +void gtk_ui_progress__init(void) { - progress_fns = >k_progress_fns; + ui_progress__ops = >k_ui_progress__ops; } |