about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-06-15 17:54:47 +0100
committerJames Booth <boothj5@gmail.com>2015-06-15 17:54:47 +0100
commita849b200b368a74da18291e875b3e6d37ea729f2 (patch)
treea205560ed6bac544e9eb070fc756a4945acd8ffc
parente9aa4ea0845b2e387a6512402d73fbc31b7bd393 (diff)
downloadprofani-tty-a849b200b368a74da18291e875b3e6d37ea729f2.tar.gz
Added win_clear() function
-rw-r--r--src/command/commands.c3
-rw-r--r--src/ui/core.c6
-rw-r--r--src/ui/inputwin.c3
-rw-r--r--src/ui/ui.h1
-rw-r--r--src/ui/window.c7
-rw-r--r--src/ui/window.h2
-rw-r--r--src/ui/windows.c8
-rw-r--r--src/ui/windows.h1
8 files changed, 13 insertions, 18 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 5d0f7a16..28cba7d7 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -3229,7 +3229,8 @@ cmd_tiny(gchar **args, struct cmd_help_t help)
 gboolean
 cmd_clear(gchar **args, struct cmd_help_t help)
 {
-    ui_clear_current();
+    ProfWin *win = wins_get_current();
+    win_clear(win);
     return TRUE;
 }
 
diff --git a/src/ui/core.c b/src/ui/core.c
index 3b29c094..e2efcb55 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -1083,12 +1083,6 @@ ui_untrust(const char * const barejid)
 }
 
 void
-ui_clear_current(void)
-{
-    wins_clear_current();
-}
-
-void
 ui_close_win(int index)
 {
     ProfWin *window = wins_get_by_num(index);
diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c
index caea8ea9..6ef829a7 100644
--- a/src/ui/inputwin.c
+++ b/src/ui/inputwin.c
@@ -422,7 +422,8 @@ _inp_rl_getc(FILE *stream)
 static int
 _inp_rl_clear_handler(int count, int key)
 {
-    ui_clear_current();
+    ProfWin *win = wins_get_current();
+    win_clear(win);
     return 0;
 }
 
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 7a2c956b..8e5ca6ab 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -88,7 +88,6 @@ int ui_close_all_wins(void);
 int ui_close_read_wins(void);
 
 // current window actions
-void ui_clear_current(void);
 win_type_t ui_current_win_type(void);
 gboolean ui_current_win_is_otr(void);
 
diff --git a/src/ui/window.c b/src/ui/window.c
index 95b5e996..d6446ff1 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -459,6 +459,13 @@ win_sub_page_up(ProfWin *window)
 }
 
 void
+win_clear(ProfWin *window)
+{
+    werase(window->layout->win);
+    win_update_virtual(window);
+}
+
+void
 win_mouse(ProfWin *window, const wint_t ch, const int result)
 {
     int rows = getmaxy(stdscr);
diff --git a/src/ui/window.h b/src/ui/window.h
index e4d9ca33..8e5d17e8 100644
--- a/src/ui/window.h
+++ b/src/ui/window.h
@@ -192,6 +192,8 @@ void win_mark_received(ProfWin *window, const char * const id);
 int win_unread(ProfWin *window);
 gboolean win_has_active_subwin(ProfWin *window);
 
+void win_clear(ProfWin *window);
+
 void win_page_up(ProfWin *window);
 void win_page_down(ProfWin *window);
 void win_sub_page_down(ProfWin *window);
diff --git a/src/ui/windows.c b/src/ui/windows.c
index f3f6967b..cb0f00de 100644
--- a/src/ui/windows.c
+++ b/src/ui/windows.c
@@ -378,14 +378,6 @@ wins_close_by_num(int i)
     }
 }
 
-void
-wins_clear_current(void)
-{
-    ProfWin *window = wins_get_current();
-    werase(window->layout->win);
-    win_update_virtual(window);
-}
-
 gboolean
 wins_is_current(ProfWin *window)
 {
diff --git a/src/ui/windows.h b/src/ui/windows.h
index 4cc527ca..4c753c03 100644
--- a/src/ui/windows.h
+++ b/src/ui/windows.h
@@ -68,7 +68,6 @@ int wins_get_num(ProfWin *window);
 int wins_get_current_num(void);
 void wins_close_current(void);
 void wins_close_by_num(int i);
-void wins_clear_current(void);
 gboolean wins_is_current(ProfWin *window);
 int wins_get_total_unread(void);
 void wins_resize_all(void);