ELinks 0.18.0
document.h File Reference
#include "document/options.h"
#include "intl/charsets.h"
#include "main/object.h"
#include "main/timer.h"
#include "protocol/uri.h"
#include "util/color.h"
#include "util/lists.h"
#include "util/box.h"
Include dependency graph for document.h:

Data Structures

struct  node
 Nodes are used for marking areas of text on the document canvas as searchable. More...
 
struct  sixel
 
struct  line
 The document line consisting of the chars ready to be copied to the terminal screen. More...
 
struct  point
 
struct  tag
 
struct  script_event_hook
 
struct  link
 
struct  search
 A searchable character on the document canvas. More...
 
struct  document
 

Macros

#define get_link_index(document, link)   (link - document->links)
 
#define link_is_textinput(link)    ((link)->type == LINK_FIELD || (link)->type == LINK_AREA)
 
#define link_is_form(link)    ((link)->type != LINK_HYPERTEXT && (link)->type != LINK_MAP)
 
#define get_link_form_control(link)    (link_is_form(link) ? (link)->data.form_control : NULL)
 
#define get_link_name(link)    (!link_is_form(link) ? (link)->data.name : NULL)
 
#define document_has_frames(document_)   ((document_) && (document_)->frame_desc)
 
#define document_has_iframes(document_)   ((document_) && (document_)->iframe_desc)
 
#define accesskey_string_to_unicode(s)   (((s)[0] && !(s)[1] && isprint((s)[0])) ? (s)[0] : 0)
 

Enumerations

enum  cp_status { CP_STATUS_NONE , CP_STATUS_SERVER , CP_STATUS_ASSUMED , CP_STATUS_IGNORED }
 Codepage status. More...
 
enum  clipboard_status { CLIPBOARD_NONE , CLIPBOARD_FIRST_POINT , CLIPBOARD_SECOND_POINT }
 Clipboard state. More...
 
enum  link_type {
  LINK_HYPERTEXT , LINK_MAP , LINK_BUTTON , LINK_CHECKBOX ,
  LINK_SELECT , LINK_FIELD , LINK_AREA
}
 
enum  script_event_hook_type {
  SEVHOOK_ONCLICK , SEVHOOK_ONDBLCLICK , SEVHOOK_ONMOUSEOVER , SEVHOOK_ONHOVER ,
  SEVHOOK_ONFOCUS , SEVHOOK_ONMOUSEOUT , SEVHOOK_ONBLUR , SEVHOOK_ONKEYDOWN ,
  SEVHOOK_ONKEYUP , SEVHOOK_ONKEYPRESS , SEVHOOK_ONKEYPRESS_BODY
}
 

Functions

void done_link_members (struct link *link)
 Free's the allocated members of the link.
 
unsigned long get_document_css_magic (struct document *document)
 Calculates css magic from available CSS imports.
 
void update_cached_document_options (struct session *ses)
 
struct documentget_cached_document (struct cache_entry *cached, struct document_options *options)
 
void reset_document (struct document *document)
 
int get_format_cache_size (void)
 
int get_format_cache_used_count (void)
 
int get_format_cache_refresh_count (void)
 
void shrink_format_cache (int)
 
int get_link_number_by_offset (struct document *document, int offset)
 
int find_tag (struct document *document, char *name, int namelen)
 

Variables

const char * script_event_hook_name []
 
struct module document_module
 

Macro Definition Documentation

◆ accesskey_string_to_unicode

#define accesskey_string_to_unicode ( s)    (((s)[0] && !(s)[1] && isprint((s)[0])) ? (s)[0] : 0)
Todo
FIXME: support for entities and all Unicode characters. (Unpaired surrogates should be rejected, so that the ECMAScript interface can convert the access key to UTF-16.) For now, we only support simple printable character.

◆ document_has_frames

#define document_has_frames ( document_)    ((document_) && (document_)->frame_desc)

◆ document_has_iframes

#define document_has_iframes ( document_)    ((document_) && (document_)->iframe_desc)

◆ get_link_form_control

#define get_link_form_control ( link)     (link_is_form(link) ? (link)->data.form_control : NULL)

◆ get_link_index

#define get_link_index ( document,
link )   (link - document->links)

◆ get_link_name

#define get_link_name ( link)     (!link_is_form(link) ? (link)->data.name : NULL)

◆ link_is_form

#define link_is_form ( link)     ((link)->type != LINK_HYPERTEXT && (link)->type != LINK_MAP)

◆ link_is_textinput

#define link_is_textinput ( link)     ((link)->type == LINK_FIELD || (link)->type == LINK_AREA)

Enumeration Type Documentation

◆ clipboard_status

Clipboard state.

Enumerator
CLIPBOARD_NONE 
CLIPBOARD_FIRST_POINT 
CLIPBOARD_SECOND_POINT 

◆ cp_status

enum cp_status

Codepage status.

Enumerator
CP_STATUS_NONE 
CP_STATUS_SERVER 
CP_STATUS_ASSUMED 
CP_STATUS_IGNORED 

◆ link_type

enum link_type
Enumerator
LINK_HYPERTEXT 
LINK_MAP 
LINK_BUTTON 
LINK_CHECKBOX 
LINK_SELECT 
LINK_FIELD 
LINK_AREA 

◆ script_event_hook_type

Enumerator
SEVHOOK_ONCLICK 
SEVHOOK_ONDBLCLICK 
SEVHOOK_ONMOUSEOVER 
SEVHOOK_ONHOVER 
SEVHOOK_ONFOCUS 
SEVHOOK_ONMOUSEOUT 
SEVHOOK_ONBLUR 
SEVHOOK_ONKEYDOWN 
SEVHOOK_ONKEYUP 
SEVHOOK_ONKEYPRESS 
SEVHOOK_ONKEYPRESS_BODY 

Function Documentation

◆ done_link_members()

void done_link_members ( struct link * link)

Free's the allocated members of the link.

◆ find_tag()

int find_tag ( struct document * document,
char * name,
int namelen )

◆ get_cached_document()

struct document * get_cached_document ( struct cache_entry * cached,
struct document_options * options )

◆ get_document_css_magic()

unsigned long get_document_css_magic ( struct document * document)

Calculates css magic from available CSS imports.

Used for determining validity of formatted documents in the cache.

◆ get_format_cache_refresh_count()

int get_format_cache_refresh_count ( void )

◆ get_format_cache_size()

int get_format_cache_size ( void )

◆ get_format_cache_used_count()

int get_format_cache_used_count ( void )

◆ get_link_number_by_offset()

int get_link_number_by_offset ( struct document * document,
int offset )

◆ reset_document()

void reset_document ( struct document * document)

assertm(!is_object_used(document), "Attempt to free locked formatted data."); if_assert_failed return;

if (document->uri) { done_uri(document->uri); document->uri = NULL; } if (document->querydns) { kill_dns_request(&document->querydns); document->querydns = NULL; } mem_free_set(&document->ip, NULL); mem_free_set(&document->title, NULL); if (document->frame_desc) { free_frameset_desc(document->frame_desc); document->frame_desc = NULL; } if (document->refresh) { done_document_refresh(document->refresh); document->refresh = NULL; }

done_document_options(&document->options);

◆ shrink_format_cache()

void shrink_format_cache ( int whole)

◆ update_cached_document_options()

void update_cached_document_options ( struct session * ses)

Variable Documentation

◆ document_module

struct module document_module
extern

◆ script_event_hook_name

const char* script_event_hook_name[]
extern