]> Pileus Git - lackey/blobdiff - src/screen.c
Add copyright
[lackey] / src / screen.c
index f31a738b08c44a6b40e3c72ff0fe76949605060d..c0aa8f4ffa753c07062b9d91e625666aa64e8b33 100644 (file)
@@ -1,7 +1,25 @@
+/*
+ * Copyright (C) 2012 Andy Spencer <andy753421@gmail.com>
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
 #include <string.h>
 #include <ncurses.h>
 #include "main.h"
 #include "screen.h"
+#include "util.h"
 
 /* Types */
 typedef struct {
@@ -37,7 +55,7 @@ void draw_header(void)
        for (int i = 0; i < N_ELEMENTS(views); i++) {
                if (i == active)
                        attron(A_BOLD);
-               printw(" %s", views[i].name);
+               printw("%s ", views[i].name);
                if (i == active)
                        attroff(A_BOLD);
        }
@@ -57,11 +75,21 @@ void screen_init(void)
        }
 }
 
+/* Screen draw */
+void screen_resize(void)
+{
+       for (int i = 0; i < N_ELEMENTS(views); i++)
+               if (views[i].init)
+                       wresize(views[i].win, LINES-2, COLS);
+}
+
 /* Screen draw */
 void screen_draw(void)
 {
        draw_header();
+       werase(views[active].win);
        views[active].draw();
+       wrefresh(views[active].win);
 }
 
 /* Screen set */