- 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 */
-};
-
-
-
-/* Initialize world.wmeta and ncurses on terminal screen. All struct members
- * initialize to 0 (.pad = NULL), except for .screen (= initscr()).
- */
-extern void init_wmeta_and_ncurses();
-
-/* Initialize a Win child "wp" of "wmeta" to "title", "height" and "width" and
- * appoint "func"() as its .draw. Initialize other members to 0.
- *
- * Pass 0 for "width" to make the window as wide as the terminal screen. Pass 0
- * for "height" for the maximum allowed height: one cell smaller than that of
- * the terminal screen. Pass negative values for either of them to make the
- * window width/height so many cells smaller than what 0 would set. Values that
- * that would reduce the window height or width to less than 1 cell according to
- * the aforementioned rules set the height/width as if they were set to 0.
- */
-extern void init_win(struct Win ** wp, char * title, int16_t height,
- int16_t width, void * func);
-
-/* Free memory initianized Win structs. */
-extern void free_win(struct Win * win);
-
-/* Append/suspend window "w" to/from chain of visible windows below "wmeta".
- * Appended windows will become active. Suspended active windows will move the
- * active window selection to their successor in the window chain or, failing
- * that, their predecessor, or, failing that, to 0 (no window active).
- */
-extern void append_win(struct Win * w);
-extern void suspend_win(struct Win * w);
-
-/* Apply scrolling offset "new_offset" to virtual screen if it is equal/greater
- * 0 and does not push the view (further) beyond the virtual screen's border. If
- * the view is already beyond the virtual screen's border due to it having
- * shrunk after suspension of windows, only allow screen scrolling leftwards.
- */
-extern void reset_pad_offset(uint16_t new_offset);
-
-/* Apply "size" to the active window if it provides a minimum size of 1x1 cells
- * and is in height at least one cell smaller than the screen's vertical height
- * (to provide space for the title bar). Does nothing if no window is active.
- */
-extern void resize_active_win(struct yx_uint16 size);
-
-/* Cycle active window selection forwards ("dir" == "f") or backwards (any
- * other "dir"). Wrap around in the windows chain if start / end of it is met.
- * Does nothing if no window is active.
- */
-extern void cycle_active_win(char dir);
-
-/* Move active window forwards ("dir" == "f") or backwards (any other "dir") in
- * the window chain. Wrap around in the window chain if start / end of it is
- * met. Does nothing if no window is active.
+ 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 linebreak; /* linebreaking modes: 0: wide; 1: long; 2: compact */
+ uint8_t view; /* window view mode: 0: use .id- set default draw function */
+}; /* 1/2: use one of the two config view draw function */
+
+
+
+/* Get position of id "c" in world.winDB.order*/
+extern uint8_t get_win_pos_in_order(char c);
+
+/* Get Win after window identified by "c" or NULL if there is none. */
+extern struct Win * get_win_after(char c);
+
+/* Return yx offset to focus map of "mapsize" on "position" in "frame_size". */
+extern uint16_t center_offset(uint16_t position,
+ uint32_t mapsize, uint32_t frame_size);
+
+/* Get Win of "id". */
+extern struct Win * get_win_by_id(char id);
+
+/* 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.