From 996e52ae84361efc2ce25d6fcfe8830af6b88d35 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Tue, 28 Aug 2007 09:52:37 +0300 Subject: [PATCH] Doc comments about coordinate systems. So that I may better understand Witek's patches. --- src/terminal/window.h | 9 +++++++++ src/viewer/text/vs.h | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/terminal/window.h b/src/terminal/window.h index 1490a7c5..1d47d270 100644 --- a/src/terminal/window.h +++ b/src/terminal/window.h @@ -22,9 +22,18 @@ enum window_type { typedef void (window_handler_T)(struct window *, struct term_event *); +/** A window in the terminal screen. This structure does not know the + * position and size of the window, and no functions are provided for + * drawing into a window. Instead, when window.handler draws the + * window, it should decide the position and size of the window, and + * then draw directly to the terminal, taking care not to draw outside + * the window. Windows generally do not have their own coordinate + * systems; they get mouse events in the coordinate system of the + * terminal. */ struct window { LIST_HEAD(struct window); /*!< terminal.windows is the sentinel. */ + /** Whether this is a normal window or a tab window. */ enum window_type type; /** The window event handler */ diff --git a/src/viewer/text/vs.h b/src/viewer/text/vs.h index fbf8b90e..87343411 100644 --- a/src/viewer/text/vs.h +++ b/src/viewer/text/vs.h @@ -18,7 +18,16 @@ struct view_state { struct form_state *form_info; int form_info_len; - int x, y; + /** Horizontal scrolling. If @c x is e.g. 2, then the + * leftmost two columns of the document have been scrolled out + * of sight. @c x should never be negative. */ + int x; + + /** Vertical scrolling. If @c y is e.g. 1, then the first + * line of the document has been scrolled out of sight. @c y + * should never be negative. */ + int y; + int current_link; int old_current_link;