diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-10-25 11:52:05 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-10-26 11:06:05 -0400 |
commit | 2ba908ecfc4697dd856a526a9d4d4bd28e64a9cd (patch) | |
tree | c905d3c0a31c4686e4dd893fa9365ea5008370db | |
parent | 71172ed97cd4cd45c6ae70e594ba351798d11909 (diff) |
perf ui: Reimplement ui_helpline using libslang
Just another step in stopping the use of libnewt in perf.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.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-gh7e1v2z7pzqmok02r6zvp17@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/ui/helpline.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/perf/util/ui/helpline.c b/tools/perf/util/ui/helpline.c index f36d2ff509ed..600243d766c0 100644 --- a/tools/perf/util/ui/helpline.c +++ b/tools/perf/util/ui/helpline.c | |||
@@ -1,20 +1,22 @@ | |||
1 | #define _GNU_SOURCE | 1 | #define _GNU_SOURCE |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | #include <newt.h> | ||
5 | 4 | ||
6 | #include "../debug.h" | 5 | #include "../debug.h" |
7 | #include "helpline.h" | 6 | #include "helpline.h" |
8 | #include "ui.h" | 7 | #include "ui.h" |
8 | #include "libslang.h" | ||
9 | 9 | ||
10 | void ui_helpline__pop(void) | 10 | void ui_helpline__pop(void) |
11 | { | 11 | { |
12 | newtPopHelpLine(); | ||
13 | } | 12 | } |
14 | 13 | ||
15 | void ui_helpline__push(const char *msg) | 14 | void ui_helpline__push(const char *msg) |
16 | { | 15 | { |
17 | newtPushHelpLine(msg); | 16 | SLsmg_gotorc(SLtt_Screen_Rows - 1, 0); |
17 | SLsmg_set_color(0); | ||
18 | SLsmg_write_nstring((char *)msg, SLtt_Screen_Cols); | ||
19 | SLsmg_refresh(); | ||
18 | } | 20 | } |
19 | 21 | ||
20 | void ui_helpline__vpush(const char *fmt, va_list ap) | 22 | void ui_helpline__vpush(const char *fmt, va_list ap) |
@@ -63,7 +65,7 @@ int ui_helpline__show_help(const char *format, va_list ap) | |||
63 | 65 | ||
64 | if (ui_helpline__last_msg[backlog - 1] == '\n') { | 66 | if (ui_helpline__last_msg[backlog - 1] == '\n') { |
65 | ui_helpline__puts(ui_helpline__last_msg); | 67 | ui_helpline__puts(ui_helpline__last_msg); |
66 | newtRefresh(); | 68 | SLsmg_refresh(); |
67 | backlog = 0; | 69 | backlog = 0; |
68 | } | 70 | } |
69 | pthread_mutex_unlock(&ui__lock); | 71 | pthread_mutex_unlock(&ui__lock); |