1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-30 03:26:23 -04:00

More doc comments about coordinates.

This commit is contained in:
Kalle Olavi Niemitalo 2007-08-29 09:57:18 +03:00 committed by Witold Filipczyk
parent ff7dfd74bc
commit e6a3008117
3 changed files with 20 additions and 1 deletions

View File

@ -47,8 +47,20 @@ struct window {
/** The terminal (and screen) that hosts the window */ /** The terminal (and screen) that hosts the window */
struct terminal *term; struct terminal *term;
/** Used for tabs focus detection. */ /** For ::WINDOW_TAB, the position and size in the tab bar.
* Updated while the tab bar is being drawn, and read if the
* user clicks there with the mouse. */
int xpos, width; int xpos, width;
/** The position of something that has focus in the window.
* Any popup menus are drawn near this position.
* In tab windows, during ::NAVIGATE_CURSOR_ROUTING, this is
* also the position of the cursor that the user can move;
* there is no separate cursor position for each frame.
* In dialog boxes, this is typically the top left corner of
* the focused widget, while the cursor is somewhere within
* the widget.
* @see set_window_ptr, get_parent_ptr, set_cursor */
int x, y; int x, y;
/** For delayed tab resizing */ /** For delayed tab resizing */

View File

@ -1096,6 +1096,11 @@ enter(struct session *ses, struct document_view *doc_view, int do_reload)
return activate_link(ses, doc_view, link, do_reload); return activate_link(ses, doc_view, link, do_reload);
} }
/** Get the link at the coordinates @a x and @a y, or NULL if none.
* The coordinates are relative to the document view; not to the
* terminal, nor to the document. So (0, 0) means whatever part of
* the document has been scrolled to the top left corner of the
* document view. */
struct link * struct link *
get_link_at_coordinates(struct document_view *doc_view, int x, int y) get_link_at_coordinates(struct document_view *doc_view, int x, int y)
{ {

View File

@ -28,6 +28,8 @@ struct view_state {
* should never be negative. */ * should never be negative. */
int y; int y;
/** The index of the focused link in the document.links array,
* or -1 of none. */
int current_link; int current_link;
int old_current_link; int old_current_link;