get rid of slang
[apps/madmutt.git] / lib-ui / resize.c
index 82fe316..fe0e965 100644 (file)
@@ -7,29 +7,20 @@
  * please see the file GPL in the top level source directory.
  */
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#if defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM)
-
-#include <lib-ui/curses.h>
+#include <lib-lib/lib-lib.h>
 
-#include "mutt.h"
+#if defined(HAVE_RESIZETERM)
 
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
 #include <termios.h>
-
 #ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#else
-# ifdef HAVE_IOCTL_H
-# include <ioctl.h>
-# endif
+#  include <sys/ioctl.h>
+#elif defined(HAVE_IOCTL_H)
+#  include <ioctl.h>
 #endif
 
+#include <lib-ui/curses.h>
+#include "mutt.h"
+
 /* this routine should be called after receiving SIGWINCH */
 void mutt_resize_screen (void)
 {
@@ -37,41 +28,31 @@ void mutt_resize_screen (void)
   int fd;
   struct winsize w;
 
-#ifdef HAVE_RESIZETERM
-  int SLtt_Screen_Rows, SLtt_Screen_Cols;
-#endif
+  int rows, cols;
 
-  SLtt_Screen_Rows = -1;
-  SLtt_Screen_Cols = -1;
+  rows = -1;
+  cols = -1;
   if ((fd = open ("/dev/tty", O_RDONLY)) != -1) {
     if (ioctl (fd, TIOCGWINSZ, &w) != -1) {
-      SLtt_Screen_Rows = w.ws_row;
-      SLtt_Screen_Cols = w.ws_col;
+      rows = w.ws_row;
+      cols = w.ws_col;
     }
     close (fd);
   }
-  if (SLtt_Screen_Rows <= 0) {
+  if (rows <= 0) {
     if ((cp = getenv ("LINES")) != NULL) {
-      SLtt_Screen_Rows = atoi (cp);
+      rows = atoi (cp);
     }
     else
-      SLtt_Screen_Rows = 24;
+      rows = 24;
   }
-  if (SLtt_Screen_Cols <= 0) {
+  if (cols <= 0) {
     if ((cp = getenv ("COLUMNS")) != NULL)
-      SLtt_Screen_Cols = atoi (cp);
+      cols = atoi (cp);
     else
-      SLtt_Screen_Cols = 80;
+      cols = 80;
   }
-#ifdef USE_SLANG_CURSES
-  delwin (stdscr);
-  SLsmg_reset_smg ();
-  SLsmg_init_smg ();
-  stdscr = newwin (0, 0, 0, 0);
-  keypad (stdscr, TRUE);
-#else
-  resizeterm (SLtt_Screen_Rows, SLtt_Screen_Cols);
-#endif
+  resizeterm (rows, cols);
 }
 
-#endif /* defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM) */
+#endif /* defined(HAVE_RESIZETERM) */