/*
- * Copyright (C) 2012 Andy Spencer <andy753421@gmail.com>
- *
+ * Copyright (C) 2012-2013 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/>.
*/
int y = 0;
int h[4] = {};
+ /* Load cal data */
+ cal_load(YEAR, 0, 0, 366);
+
/* Determine heights */
for (int m = 0; m < 12; m++) {
int weeks = weeks_in_month(YEAR, m);
int sum = h[0]+h[1]+h[2]+h[3];
/* Print Header */
+ if (COMPACT) wattron(win, A_REVERSE | A_BOLD);
+ if (COMPACT) mvwhline(win, y, 0, A_REVERSE | A_BOLD, COLS);
mvwprintw(win, y++, COLS/2-2, "%d", YEAR);
+ if (COMPACT) wattroff(win, A_REVERSE | A_BOLD);
/* Print Months */
for (int m = 0; m < 12; m++) {
}
/* Refresh */
- werase(win);
- year_draw();
- wrefresh(win);
- return 0;
+ if (dir || y != YEAR) {
+ werase(win);
+ year_draw();
+ wrefresh(win);
+ }
+ return dir || y != YEAR;
}