- struct yx_uint16 padsize; /* virtual screen size */
- WINDOW * screen; /* ncurses' pointer to the terminal screen */
- WINDOW * pad; /* ncurses pad of virtual screen */
- struct Win * chain_start; /* first Win in chain; its _prev == 0 */
- struct Win * chain_end; /* last Win in chain; its _next == 0 */
- struct Win * active; /* Win highlighted/selected for manipulation */
- uint16_t pad_offset; /* number of cells view is moved to the right */
-};
-
-
+ struct KeyBindingDB kb; /* window-specific keybindings */
+ char * title; /* title to be used in window title bar */
+ struct yx_uint16 target_center; /* saves .center when toggling .view */
+ struct yx_uint16 frame_size; /* size of window/frame to see winmap through*/
+ struct yx_uint16 start; /* upper left corner of window in v_screen */
+ struct yx_uint16 center; /* winnap cell to center frame on if < winmap */
+ struct yx_uint16 winmap_size; /* delimits .winmap, sorts it into lines */
+ chtype * winmap; /* window content in sequence of chtype's to write */
+ int16_t target_height; /* window size / .frame_size description in config */
+ int16_t target_width; /* file format, i.e. values <= 0 may be used */
+ char id; /* Win identifier; also maps to default window drawing function. */
+ uint8_t target_height_type; /* 0: read .height/.width as positive size; */
+ uint8_t target_width_type; /* 1: as negative diff to v_screen size */
+ uint8_t view; /* winde view mode: 0: use default draw function set by .id */
+}; /* 1/2: use one of the two config view draw function */
+
+
+
+/* Return yx offset to focus map of "mapsize" on "position" in "frame_size". */
+extern uint16_t center_offset(uint16_t position,
+ uint16_t mapsize, uint16_t frame_size);
+
+/* Get Win of "id". */
+extern struct Win * get_win_by_id(char id);
+
+/* Read/write individual Win (identified by "c") and world.windb.order /
+ * world.windb.active from/to "file". Follow writing with "delim" delimiter.
+ * Use "line" and "linemax" as expected by try_fgets().
+ */
+extern uint8_t read_winconf_from_file(char * line, uint32_t linemax,
+ FILE * file);
+extern void write_winconf_of_id_to_file(FILE * file, char c, char * delim);
+extern void read_order_wins_visible_active(char * line, uint32_t linemax,
+ FILE * file);
+extern void write_order_wins_visible_active(FILE * file, char * delim);
+
+/* Builds virtual sreen from .t_screen's size, fits win's sizes to them.*/
+extern void make_v_screen_and_init_win_sizes();
+
+/* Free all WinDB data. */
+extern void free_windb();
+
+/* The SIGWINCH handler winch_called() merely sets world.winch to 1. This info
+ * is used by io_loop() to call reset_windows_on_winch(), which adapts the
+ * currently loaded interface configuration to the new .t_screen size.
+ */
+extern void winch_called();
+extern void reset_windows_on_winch();