- !strcmp(cat, "class") ? COLOR_CLASS :
- !strcmp(cat, "ec") ? COLOR_EC :
- !strcmp(cat, "work") ? COLOR_WORK : COLOR_OTHER ;
+ match(cat, "class") ? COLOR_CLASS :
+ match(cat, "ec") ? COLOR_EC :
+ match(cat, "work") ? COLOR_WORK : COLOR_OTHER ;
+}
+
+static int view_set(int num)
+{
+ if (ACTIVE != num) {
+ ACTIVE = num;
+ set_enum("view", 0, "active", ACTIVE,
+ names, N_ELEMENTS(names));
+ view_draw();
+ }
+ return 1;
+}
+
+/* Curses functions */
+void wmvresize(WINDOW *win, int top, int left, int rows, int cols)
+{
+ int y = getpary(win);
+ if (top < y)
+ mvderwin(win, top, left);
+ wresize(win, rows, cols);
+ if (top > y)
+ mvderwin(win, top, left);
+}
+
+void wshrink(WINDOW *win, int top)
+{
+ int x = getparx(win);
+ int y = getpary(win);
+ int r = getmaxy(win);
+ int c = getmaxx(win);
+ int rows = r + (y - top);
+ if (top < y) mvderwin(win, top, x);
+ if (rows != r) wresize(win, rows, c);
+ if (top > y) mvderwin(win, top, x);