1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-16 01:08:31 -04:00
elinks/src/document/view.h
Miciah Dashiel Butler Masters c91c763d49 Eliminate link_bg
Instead of saving the old link colours when selecting a link and using that
to restore them when unselecting it, just copy the data from the document.

 - Eliminate struct link_bg and the .link_bg and .link_bg_n members
   of struct document_view.

 - Eliminate the free_link routine and don't call it from draw_doc,
   clear_link, or detach_formatted.

 - Add a .old_current_link member to struct view_state and initialise it in
   init_vs.

 - Don't save link_bg in draw_current_link.

 - Rewrite clear_link to use the document data instead of link_bg.

 - Modify init_link_drawing not to allocate ling_bg and to return a pointer
   to a static variable for the template character.
2006-05-28 01:08:46 +00:00

41 lines
971 B
C

#ifndef EL__DOCUMENT_VIEW_H
#define EL__DOCUMENT_VIEW_H
#include "terminal/draw.h"
#include "util/lists.h"
#include "util/box.h"
struct document;
struct view_state;
struct document_view {
LIST_HEAD(struct document_view);
unsigned char *name;
unsigned char **search_word;
struct session *session;
struct document *document;
struct view_state *vs;
struct box box; /* pos and size of window */
int last_x, last_y; /* last pos of window */
int depth;
int used;
};
#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)
#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)
#endif