ELinks 0.18.0
|
#include <ctype.h>
#include <stdarg.h>
#include <string.h>
#include "elinks.h"
#include "cache/cache.h"
#include "config/options.h"
#include "document/docdata.h"
#include "document/document.h"
#include "document/html/frames.h"
#include "document/html/iframes.h"
#include "document/html/parser.h"
#include "document/html/parser/parse.h"
#include "document/html/renderer.h"
#include "document/html/tables.h"
#include "document/options.h"
#include "document/refresh.h"
#include "document/renderer.h"
#include "intl/charsets.h"
#include "osdep/types.h"
#include "protocol/uri.h"
#include "session/session.h"
#include "terminal/color.h"
#include "terminal/draw.h"
#include "util/color.h"
#include "util/conv.h"
#include "util/error.h"
#include "util/hash.h"
#include "util/lists.h"
#include "util/memory.h"
#include "util/string.h"
#include "util/time.h"
#include "viewer/text/form.h"
#include "viewer/text/view.h"
#include "viewer/text/vs.h"
#include "document/html/internal.h"
Data Structures | |
struct | table_cache_entry_key |
struct | table_cache_entry |
Macros | |
#define | MAX_TABLE_CACHE_ENTRIES 16384 |
#define | X(x_) (part->box.x + (x_)) |
#define | Y(y_) (part->box.y + (y_)) |
#define | SPACES_GRANULARITY 0x7F |
#define | ALIGN_SPACES(x, o, n) mem_align_alloc(x, o, n, SPACES_GRANULARITY) |
#define | LINE(y_) part->document->data[Y(y_)] |
#define | POS(x_, y_) LINE(y_).ch.chars[X(x_)] |
#define | LEN(y_) int_max(LINE(y_).length - part->box.x, 0) |
#define | overlap_width(x) |
#define | overlap(x) int_max(overlap_width(x) - (x).rightmargin, 0) |
#define | add_evhook(list_, type_, src_) |
#define | assert_link_variable(old, new) assertm(!(old), "Old link value [%s]. New value [%s]", old, new); |
Typedefs | |
typedef unsigned char | link_state_T |
Enumerations | |
enum | link_state { LINK_STATE_NONE , LINK_STATE_NEW , LINK_STATE_SAME } |
Functions | |
static void | put_chars (struct html_context *, const char *, int) |
static void | set_screen_char_color (struct screen_char *schar, color_T bgcolor, color_T fgcolor, color_flags_T color_flags, color_mode_T color_mode) |
static int | realloc_line (struct html_context *html_context, struct document *document, int y, int length) |
static int | realloc_spaces (struct part *part, int length) |
static void | clear_hchars (struct html_context *html_context, int x, int y, int width, struct screen_char *a) |
static struct screen_char * | get_frame_char (struct html_context *html_context, struct part *part, int x, int y, unsigned char data, color_T bgcolor, color_T fgcolor) |
static struct screen_char * | get_format_screen_char (struct html_context *html_context, link_state_T link_state) |
void | draw_frame_hchars (struct part *part, int x, int y, int width, unsigned char data, color_T bgcolor, color_T fgcolor, struct html_context *html_context) |
void | draw_blockquote_chars (struct part *part, int y, struct html_context *html_context) |
void | draw_frame_vchars (struct part *part, int x, int y, int height, unsigned char data, color_T bgcolor, color_T fgcolor, struct html_context *html_context) |
void | expand_lines (struct html_context *html_context, struct part *part, int x, int y, int lines, color_T bgcolor) |
static int | set_hline (struct html_context *html_context, const char *chars, int charslen, link_state_T link_state) |
static void | move_links (struct html_context *html_context, int xf, int yf, int xt, int yt) |
static void | copy_chars (struct html_context *html_context, int x, int y, int width, struct screen_char *d) |
static void | move_chars (struct html_context *html_context, int x, int y, int nx, int ny) |
static void | shift_chars (struct html_context *html_context, int y, int shift) |
Shift the line y to the right by shift character cells, and update document.comb_x and document.comb_y. | |
static void | del_chars (struct html_context *html_context, int x, int y) |
static int | split_line_at (struct html_context *html_context, int width) |
static int | split_line (struct html_context *html_context) |
static void | insert_spaces_in_link (struct part *part, int x, int y, int new_spaces) |
static void | justify_line (struct html_context *html_context, int y) |
static void | align_line (struct html_context *html_context, int y, int last) |
static void | init_link_event_hooks (struct html_context *html_context, struct link *link) |
static struct link * | new_link (struct html_context *html_context, const char *name, int namelen) |
static void | html_special_tag (struct document *document, char *t, int x, int y) |
void | put_chars_conv (struct html_context *html_context, const char *chars, int charslen) |
int | dec2qwerty (int num, char *link_sym, const char *key, int base) |
int | qwerty2dec (const char *link_sym, const char *key, int base) |
static void | put_link_number (struct html_context *html_context) |
static void | init_link_state_info (char *link, char *target, char *image, struct el_form_control *form) |
static void | done_link_state_info (void) |
static void | process_link (struct html_context *html_context, link_state_T link_state, const char *chars, int charslen, int cells) |
static link_state_T | get_link_state (struct html_context *html_context) |
static int | html_has_non_space_chars (const char *chars, int charslen) |
void | line_break (struct html_context *html_context) |
static void | html_special_form (struct part *part, struct form *form) |
static void | html_special_form_control (struct part *part, struct el_form_control *fc) |
static void | assert_forms_list_ok (struct form list *forms) |
Assert that each form in the list has a different form.form_num ... form.form_end range and that the ranges are contiguous and together cover all numbers from 0 to INT_MAX. | |
void | check_html_form_hierarchy (struct part *part) |
static void | color_link_lines (struct html_context *html_context) |
void * | html_special (struct html_context *html_context, html_special_type_T c,...) |
void | free_table_cache (void) |
struct part * | format_html_part (struct html_context *html_context, char *start, char *end, int align, int margin, int width, struct document *document, int x, int y, char *head, int link_num) |
static void | subst_frame_chars (struct document *document) |
void | render_html_document (struct cache_entry *cached, struct document *document, struct string *buffer) |
Variables | |
static int | table_cache_entries |
static struct hash * | table_cache |
struct renderer_context | renderer_context |
#define add_evhook | ( | list_, | |
type_, | |||
src_ ) |
#define ALIGN_SPACES | ( | x, | |
o, | |||
n ) mem_align_alloc(x, o, n, SPACES_GRANULARITY) |
#define assert_link_variable | ( | old, | |
new ) assertm(!(old), "Old link value [%s]. New value [%s]", old, new); |
#define MAX_TABLE_CACHE_ENTRIES 16384 |
#define overlap | ( | x | ) | int_max(overlap_width(x) - (x).rightmargin, 0) |
#define overlap_width | ( | x | ) |
#define SPACES_GRANULARITY 0x7F |
#define X | ( | x_ | ) | (part->box.x + (x_)) |
#define Y | ( | y_ | ) | (part->box.y + (y_)) |
typedef unsigned char link_state_T |
enum link_state |
|
static |
|
static |
Assert that each form in the list has a different form.form_num ... form.form_end range and that the ranges are contiguous and together cover all numbers from 0 to INT_MAX.
Alternatively, the whole list may be empty. This function can be called from a debugger, or automatically from some places.
This function may leave assert_failed = 1; the caller must use if_assert_failed.
void check_html_form_hierarchy | ( | struct part * | part | ) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
int dec2qwerty | ( | int | num, |
char * | link_sym, | ||
const char * | key, | ||
int | base ) |
|
inlinestatic |
|
inlinestatic |
void draw_blockquote_chars | ( | struct part * | part, |
int | y, | ||
struct html_context * | html_context ) |
void draw_frame_hchars | ( | struct part * | part, |
int | x, | ||
int | y, | ||
int | width, | ||
unsigned char | data, | ||
color_T | bgcolor, | ||
color_T | fgcolor, | ||
struct html_context * | html_context ) |
void draw_frame_vchars | ( | struct part * | part, |
int | x, | ||
int | y, | ||
int | height, | ||
unsigned char | data, | ||
color_T | bgcolor, | ||
color_T | fgcolor, | ||
struct html_context * | html_context ) |
void expand_lines | ( | struct html_context * | html_context, |
struct part * | part, | ||
int | x, | ||
int | y, | ||
int | lines, | ||
color_T | bgcolor ) |
struct part * format_html_part | ( | struct html_context * | html_context, |
char * | start, | ||
char * | end, | ||
int | align, | ||
int | margin, | ||
int | width, | ||
struct document * | document, | ||
int | x, | ||
int | y, | ||
char * | head, | ||
int | link_num ) |
void free_table_cache | ( | void | ) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
void * html_special | ( | struct html_context * | html_context, |
html_special_type_T | c, | ||
... ) |
|
static |
|
static |
|
inlinestatic |
|
inlinestatic |
|
static |
|
static |
void line_break | ( | struct html_context * | html_context | ) |
|
inlinestatic |
|
static |
|
static |
|
inlinestatic |
|
static |
void put_chars_conv | ( | struct html_context * | html_context, |
const char * | chars, | ||
int | charslen ) |
|
inlinestatic |
int qwerty2dec | ( | const char * | link_sym, |
const char * | key, | ||
int | base ) |
|
static |
|
inlinestatic |
void render_html_document | ( | struct cache_entry * | cached, |
struct document * | document, | ||
struct string * | buffer ) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Shift the line y to the right by shift character cells, and update document.comb_x and document.comb_y.
|
static |
|
inlinestatic |
|
static |
struct renderer_context renderer_context |
|
static |
|
static |