1 #if !defined( VIEWER_H )
5 * Functions necessary to display a deck of slides in different color modes
6 * using ncurses. Only white, red, and blue are supported, as they can be
7 * faded in 256 color mode.
8 * Copyright (C) 2018 Michael Goehler
10 * This file is part of mdp.
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 * function: ncurses_display initializes ncurses, defines colors, calculates
27 * window geometry and handles key strokes
28 * function: add_line detects inline markdown formating and prints line char
30 * function: fade_in, fade_out implementing color fading in 256 color mode
31 * function: int_length to calculate decimal length of slide count
35 #define _GNU_SOURCE // enable ncurses wchar support
36 #define _XOPEN_SOURCE_EXTENDED 1 // enable ncurses wchar support
49 #define CP_WHITE 1 // 255
50 #define CP_BLUE 2 // 123
51 #define CP_RED 3 // 213
52 #define CP_YELLOW 4 // 208
53 #define CP_BLACK 5 // CP_WHITE with foreground and background swapped
55 #define FADE_DELAY 15000 // micro seconds
56 #define GOTO_SLIDE_DELAY 5 // tenths of seconds
58 int ncurses_display(deck_t *deck, int notrans, int nofade, int invert, int reload, int noreload, int slidenum);
59 void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colors);
60 void inline_display(WINDOW *window, const wchar_t *c, const int colors);
61 void fade_out(WINDOW *window, int trans, int colors, int invert);
62 void fade_in(WINDOW *window, int trans, int colors, int invert);
63 int int_length (int val);
64 int get_slide_number(char init);
65 void setup_list_strings(void);
67 #endif // !defined( VIEWER_H )