2005-09-15 09:58:31 -04:00
|
|
|
#ifndef EL__DOCUMENT_VIEW_H
|
|
|
|
#define EL__DOCUMENT_VIEW_H
|
|
|
|
|
|
|
|
#include "terminal/draw.h"
|
|
|
|
#include "util/lists.h"
|
|
|
|
#include "util/box.h"
|
|
|
|
|
2020-10-05 14:14:55 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
struct document;
|
|
|
|
struct view_state;
|
|
|
|
|
|
|
|
struct document_view {
|
|
|
|
LIST_HEAD(struct document_view);
|
|
|
|
|
2021-01-02 10:20:27 -05:00
|
|
|
char *name;
|
|
|
|
char **search_word;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
struct session *session;
|
|
|
|
struct document *document;
|
|
|
|
struct view_state *vs;
|
|
|
|
|
2018-09-09 13:14:56 -04:00
|
|
|
struct el_box box; /**< pos and size of window */
|
2007-07-27 12:45:02 -04:00
|
|
|
int last_x, last_y; /**< last pos of window */
|
2005-09-15 09:58:31 -04:00
|
|
|
int depth;
|
|
|
|
int used;
|
2020-04-28 13:13:36 -04:00
|
|
|
int prev_y;
|
2005-09-15 09:58:31 -04:00
|
|
|
};
|
|
|
|
|
2006-05-27 21:08:46 -04:00
|
|
|
#define get_old_current_link(doc_view) \
|
|
|
|
(((doc_view) \
|
|
|
|
&& (doc_view)->vs->old_current_link >= 0 \
|
|
|
|
&& (doc_view)->vs->old_current_link < (doc_view)->document->nlinks) \
|
|
|
|
? &(doc_view)->document->links[(doc_view)->vs->old_current_link] : NULL)
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
#define get_current_link(doc_view) \
|
|
|
|
(((doc_view) \
|
|
|
|
&& (doc_view)->vs->current_link >= 0 \
|
|
|
|
&& (doc_view)->vs->current_link < (doc_view)->document->nlinks) \
|
|
|
|
? &(doc_view)->document->links[(doc_view)->vs->current_link] : NULL)
|
|
|
|
|
2020-10-05 14:14:55 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
#endif
|