+/*
+ * 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 {
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);
}
}
}
+/* 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 */