Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4779a2e9 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf ui: Rename ui_progress to ui_progress_ops

Reserving 'struct ui_progress' to the per progress instances, not to the
particular set of operations used to implmenet a progress bar in the
current UI (GTK, TUI, etc).

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-zjqbfp9gx3yo45s0rp9uv42n@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 74af377b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -487,6 +487,7 @@ ifndef NO_SLANG
  LIB_OBJS += $(OUTPUT)ui/tui/util.o
  LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
  LIB_OBJS += $(OUTPUT)ui/tui/progress.o
  LIB_H += ui/tui/tui.h
  LIB_H += ui/browser.h
  LIB_H += ui/browsers/map.h
  LIB_H += ui/keysyms.h
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window);
int perf_gtk__deactivate_context(struct perf_gtk_context **ctx);

void perf_gtk__init_helpline(void);
void perf_gtk__init_progress(void);
void gtk_ui_progress__init(void);
void perf_gtk__init_hpp(void);

void perf_gtk__signal(int sig);
+7 −7
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
static GtkWidget *dialog;
static GtkWidget *progress;

static void gtk_progress_update(u64 curr, u64 total, const char *title)
static void gtk_ui_progress__update(u64 curr, u64 total, const char *title)
{
	double fraction = total ? 1.0 * curr / total : 0.0;
	char buf[1024];
@@ -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 = &gtk_progress_fns;
	ui_progress__ops = &gtk_ui_progress__ops;
}
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ int perf_gtk__init(void)
{
	perf_error__register(&perf_gtk_eops);
	perf_gtk__init_helpline();
	perf_gtk__init_progress();
	gtk_ui_progress__init();
	perf_gtk__init_hpp();

	return gtk_init_check(NULL, NULL) ? 0 : -1;
+9 −9
Original line number Diff line number Diff line
#include "../cache.h"
#include "progress.h"

static void nop_progress_update(u64 curr __maybe_unused,
static void null_progress__update(u64 curr __maybe_unused,
				  u64 total __maybe_unused,
				  const char *title __maybe_unused)
{
}

static struct ui_progress default_progress_fns =
static struct ui_progress_ops null_progress__ops =
{
	.update		= nop_progress_update,
	.update = null_progress__update,
};

struct ui_progress *progress_fns = &default_progress_fns;
struct ui_progress_ops *ui_progress__ops = &null_progress__ops;

void ui_progress__update(u64 curr, u64 total, const char *title)
{
	return progress_fns->update(curr, total, title);
	return ui_progress__ops->update(curr, total, title);
}

void ui_progress__finish(void)
{
	if (progress_fns->finish)
		progress_fns->finish();
	if (ui_progress__ops->finish)
		ui_progress__ops->finish();
}
Loading