+/*
+ * Match "crosswin()", but using line-drawing characters. This could be done
+ * a little simpler using box(), but the reason for this example is to test
+ * hline/vline and addch with line-drawing vs the copy/overlay functions.
+ */
+static void
+crossbox(WINDOW *win)
+{
+ int y1, x1;
+ int ymax, xmax;
+
+ getmaxyx(win, y1, x1);
+
+ ymax = (y1 + 1);
+ xmax = (x1 + 1);
+
+ mvwhline(win, 0, (xmax / 3), ACS_HLINE, (xmax / 3));
+ mvwhline(win, ymax / 3, 0, ACS_HLINE, xmax);
+ mvwhline(win, ((2 * ymax) / 3) - 1, 0, ACS_HLINE, xmax);
+ mvwhline(win, y1 - 1, (xmax / 3), ACS_HLINE, (xmax / 3));
+
+ mvwvline(win, (ymax / 3), 0, ACS_VLINE, (ymax / 3));
+ mvwvline(win, 0, xmax / 3, ACS_VLINE, ymax);
+ mvwvline(win, 0, ((2 * xmax) / 3) - 1, ACS_VLINE, ymax);
+ mvwvline(win, (ymax / 3), x1 - 1, ACS_VLINE, (ymax / 3));
+
+ mvwaddch(win, 0, (xmax / 3), ACS_ULCORNER);
+ mvwaddch(win, 0, ((2 * xmax) / 3) - 1, ACS_URCORNER);
+ mvwaddch(win, y1 - 1, (xmax / 3), ACS_LLCORNER);
+ mvwaddch(win, y1 - 1, ((2 * xmax) / 3) - 1, ACS_LRCORNER);
+
+ mvwaddch(win, (ymax / 3), 0, ACS_ULCORNER);
+ mvwaddch(win, ((2 * ymax) / 3) - 1, 0, ACS_LLCORNER);
+ mvwaddch(win, (ymax / 3), x1 - 1, ACS_URCORNER);
+ mvwaddch(win, ((2 * ymax) / 3) - 1, x1 - 1, ACS_LRCORNER);
+
+ mvwaddch(win, (ymax / 3), (xmax / 3), ACS_PLUS);
+ mvwaddch(win, (ymax / 3), ((2 * xmax) / 3) - 1, ACS_PLUS);
+ mvwaddch(win, ((2 * ymax) / 3) - 1, ((2 * xmax) / 3) - 1, ACS_PLUS);
+ mvwaddch(win, ((2 * ymax) / 3) - 1, (xmax / 3), ACS_PLUS);
+}
+
+typedef enum {
+ otBASE_refresh = 0
+ ,otBASE_fill
+ ,otBASE_draw
+ ,otBASE_clear
+ ,otBASE_copy
+} otBASE;
+
+#define OVERLAP_FLAVORS 6
+
+typedef enum {
+ otFILL_normal = 0
+ ,otFILL_bold
+ ,otFILL_color
+ ,otFILL_bright
+} otFILL;
+
+#define LimitFILL() UseColors ? 4 : 2
+
+typedef enum {
+ otDRAW_text_cross = 0
+ ,otDRAW_line_box
+ ,otDRAW_line_cross
+ ,otDRAW_set_bg
+ ,otDRAW_reset_bg
+} otDRAW;
+
+#define LimitDRAW() UseColors ? 5 : 3
+
+typedef enum {
+ otCOPY_overwrite = 0
+ ,otCOPY_merge
+ ,otCOPY_force
+ ,otCOPY_overlay
+} otCOPY;
+
+#define LimitCOPY() 4