perf tools: Remove dependency on libnewt
[platform/adaptation/renesas_rcar/renesas_kernel.git] / tools / perf / ui / tui / setup.c
index 81efa19..b940148 100644 (file)
@@ -1,4 +1,3 @@
-#include <newt.h>
 #include <signal.h>
 #include <stdbool.h>
 
@@ -88,13 +87,6 @@ int ui__getch(int delay_secs)
        return SLkp_getkey();
 }
 
-static void newt_suspend(void *d __maybe_unused)
-{
-       newtSuspend();
-       raise(SIGTSTP);
-       newtResume();
-}
-
 static void ui__signal(int sig)
 {
        ui__exit(false);
@@ -106,7 +98,17 @@ int ui__init(void)
 {
        int err;
 
-       newtInit();
+       SLutf8_enable(-1);
+       SLtt_get_terminfo();
+       SLtt_get_screen_size();
+
+       err = SLsmg_init_smg();
+       if (err < 0)
+               goto out;
+       err = SLang_init_tty(0, 0, 0);
+       if (err < 0)
+               goto out;
+
        err = SLkp_init();
        if (err < 0) {
                pr_err("TUI initialization failed.\n");
@@ -115,7 +117,6 @@ int ui__init(void)
 
        SLkp_define_keysym((char *)"^(kB)", SL_KEY_UNTAB);
 
-       newtSetSuspendCallback(newt_suspend, NULL);
        ui_helpline__init();
        ui_browser__init();
        ui_progress__init();