ELinks 0.18.0
Functions | Variables
view.c File Reference

HTML viewer (and much more) More...

#include <stdlib.h>
#include <string.h>
#include "elinks.h"
#include "bfu/leds.h"
#include "bfu/menu.h"
#include "bfu/dialog.h"
#include "config/kbdbind.h"
#include "config/options.h"
#include "dialogs/document.h"
#include "dialogs/menu.h"
#include "dialogs/options.h"
#include "dialogs/status.h"
#include "document/document.h"
#include "document/html/frames.h"
#include "document/options.h"
#include "document/renderer.h"
#include "document/view.h"
#include "intl/charsets.h"
#include "intl/libintl.h"
#include "main/event.h"
#include "osdep/osdep.h"
#include "protocol/uri.h"
#include "session/download.h"
#include "session/location.h"
#include "session/session.h"
#include "session/task.h"
#include "terminal/draw.h"
#include "terminal/event.h"
#include "terminal/kbd.h"
#include "terminal/mouse.h"
#include "terminal/tab.h"
#include "terminal/terminal.h"
#include "terminal/window.h"
#include "util/color.h"
#include "util/conv.h"
#include "util/error.h"
#include "util/memory.h"
#include "util/snprintf.h"
#include "util/string.h"
#include "viewer/action.h"
#include "viewer/dump/dump.h"
#include "viewer/text/draw.h"
#include "viewer/text/form.h"
#include "viewer/text/link.h"
#include "viewer/text/marks.h"
#include "viewer/text/search.h"
#include "viewer/text/textarea.h"
#include "viewer/text/view.h"
#include "viewer/text/vs.h"
Include dependency graph for view.c:

Functions

static enum frame_event_status move_clipboard_pos (struct session *ses, struct document_view *view, enum frame_event_status status)
 
void detach_formatted (struct document_view *doc_view)
 Releases the document view's resources.
 
static void move_down (struct session *ses, struct document_view *doc_view, int type, int overlap)
 
static enum frame_event_status move_part_page_down (struct session *ses, struct document_view *doc_view, int overlap)
 
enum frame_event_status move_page_down (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status move_half_page_down (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status move_current_top (struct session *ses, struct document_view *doc_view)
 
static void move_up (struct session *ses, struct document_view *doc_view, int type, int overlap)
 
enum frame_event_status move_part_page_up (struct session *ses, struct document_view *doc_view, int overlap)
 
enum frame_event_status move_page_up (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status move_half_page_up (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status move_link (struct session *ses, struct document_view *doc_view, int direction, int wraparound_bound, int wraparound_link)
 
enum frame_event_status move_link_dir (struct session *ses, struct document_view *doc_view, int dir_x, int dir_y)
 
enum frame_event_status vertical_scroll (struct session *ses, struct document_view *doc_view, int steps)
 
enum frame_event_status horizontal_scroll_extended (struct session *ses, struct document_view *doc_view, int steps, int extended)
 
static enum frame_event_status horizontal_scroll (struct session *ses, struct document_view *doc_view, int steps)
 
enum frame_event_status scroll_up (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status scroll_down (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status scroll_left (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status scroll_right (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status move_document_start (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status move_document_end (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status set_frame (struct session *ses, struct document_view *doc_view, int xxxx)
 
void toggle_plain_html (struct session *ses, struct document_view *doc_view, int xxxx)
 Used for changing between formatted and source (plain) view.
 
void toggle_wrap_text (struct session *ses, struct document_view *doc_view, int xxxx)
 Used for changing wrapping of text.
 
enum frame_event_status move_cursor (struct session *ses, struct document_view *doc_view, int x, int y)
 Move the cursor to the document view co-ordinates provided as x and y, scroll the document if necessary, put us in cursor-routing navigation mode if that is not the current mode, and select any link under the cursor.
 
static enum frame_event_status move_cursor_rel_count (struct session *ses, struct document_view *view, int rx, int ry, int count)
 
static enum frame_event_status move_cursor_rel (struct session *ses, struct document_view *view, int rx, int ry)
 
enum frame_event_status move_cursor_left (struct session *ses, struct document_view *view)
 
enum frame_event_status move_cursor_right (struct session *ses, struct document_view *view)
 
enum frame_event_status move_cursor_up (struct session *ses, struct document_view *view)
 
enum frame_event_status move_cursor_down (struct session *ses, struct document_view *view)
 
enum frame_event_status move_link_up_line (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status move_link_down_line (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status move_link_prev_line (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status move_link_next_line (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status move_cursor_line_start (struct session *ses, struct document_view *doc_view)
 
static enum frame_event_status copy_to_clipboard2 (struct document_view *doc_view)
 
enum frame_event_status mark_clipboard (struct session *ses, struct document_view *doc_view)
 
enum frame_event_status copy_current_link_to_clipboard (struct session *ses, struct document_view *doc_view, int xxx)
 
enum frame_event_status copy_to_clipboard (struct session *ses, struct document_view *doc_view)
 
int try_jump_to_link_number (struct session *ses, struct document_view *doc_view)
 If the user has provided a numeric prefix, jump to the link with that number as its index.
 
void open_link_dialog (struct session *ses)
 
static enum frame_event_status try_prefix_key (struct session *ses, struct document_view *doc_view, struct term_event *ev)
 
static enum frame_event_status try_form_action (struct session *ses, struct document_view *doc_view, struct link *link, struct term_event *ev)
 
static enum frame_event_status frame_ev_kbd (struct session *ses, struct document_view *doc_view, struct term_event *ev)
 
static enum frame_event_status frame_ev (struct session *ses, struct document_view *doc_view, struct term_event *ev)
 
struct document_view * current_frame (struct session *ses)
 
static enum frame_event_status send_to_frame (struct session *ses, struct document_view *doc_view, struct term_event *ev)
 
static void try_typeahead (struct session *ses, struct document_view *doc_view, struct term_event *ev, main_action_T action_id)
 
static enum frame_event_status try_menu (struct session *ses, struct term_event *ev)
 See whether the BFU (in particular the menu system) is interested in the event.
 
static struct session * send_kbd_event (struct session *ses, struct document_view *doc_view, struct term_event *ev)
 
void send_event (struct session *ses, struct term_event *ev)
 
enum frame_event_status download_link (struct session *ses, struct document_view *doc_view, action_id_T action_id)
 
enum frame_event_status view_image (struct session *ses, struct document_view *doc_view, int xxxx)
 
enum frame_event_status save_as (struct session *ses, struct document_view *doc_view, int magic)
 
static void save_formatted_finish (struct terminal *term, int h, void *data, download_flags_T flags)
 
static void save_formatted (void *data, char *file)
 
enum frame_event_status save_formatted_dlg (struct session *ses, struct document_view *doc_view, int xxxx)
 

Variables

struct term_event last_event
 

Detailed Description

HTML viewer (and much more)

Function Documentation

◆ copy_current_link_to_clipboard()

enum frame_event_status copy_current_link_to_clipboard ( struct session *  ses,
struct document_view *  doc_view,
int  xxx 
)

◆ copy_to_clipboard()

enum frame_event_status copy_to_clipboard ( struct session *  ses,
struct document_view *  doc_view 
)

◆ copy_to_clipboard2()

static enum frame_event_status copy_to_clipboard2 ( struct document_view *  doc_view)
static

◆ current_frame()

struct document_view * current_frame ( struct session *  ses)

◆ detach_formatted()

void detach_formatted ( struct document_view *  doc_view)

Releases the document view's resources.

But doesn't free() the doc_view.

◆ download_link()

enum frame_event_status download_link ( struct session *  ses,
struct document_view *  doc_view,
action_id_T  action_id 
)

◆ frame_ev()

static enum frame_event_status frame_ev ( struct session *  ses,
struct document_view *  doc_view,
struct term_event *  ev 
)
static

◆ frame_ev_kbd()

static enum frame_event_status frame_ev_kbd ( struct session *  ses,
struct document_view *  doc_view,
struct term_event *  ev 
)
static

◆ horizontal_scroll()

static enum frame_event_status horizontal_scroll ( struct session *  ses,
struct document_view *  doc_view,
int  steps 
)
static

steps > 0 -> right

◆ horizontal_scroll_extended()

enum frame_event_status horizontal_scroll_extended ( struct session *  ses,
struct document_view *  doc_view,
int  steps,
int  extended 
)

steps > 0 -> right

◆ mark_clipboard()

enum frame_event_status mark_clipboard ( struct session *  ses,
struct document_view *  doc_view 
)

◆ move_clipboard_pos()

static enum frame_event_status move_clipboard_pos ( struct session *  ses,
struct document_view *  view,
enum frame_event_status  status 
)
static

◆ move_current_top()

enum frame_event_status move_current_top ( struct session *  ses,
struct document_view *  doc_view 
)

◆ move_cursor()

enum frame_event_status move_cursor ( struct session *  ses,
struct document_view *  doc_view,
int  x,
int  y 
)

Move the cursor to the document view co-ordinates provided as x and y, scroll the document if necessary, put us in cursor-routing navigation mode if that is not the current mode, and select any link under the cursor.

◆ move_cursor_down()

enum frame_event_status move_cursor_down ( struct session *  ses,
struct document_view *  view 
)

◆ move_cursor_left()

enum frame_event_status move_cursor_left ( struct session *  ses,
struct document_view *  view 
)

◆ move_cursor_line_start()

enum frame_event_status move_cursor_line_start ( struct session *  ses,
struct document_view *  doc_view 
)

◆ move_cursor_rel()

static enum frame_event_status move_cursor_rel ( struct session *  ses,
struct document_view *  view,
int  rx,
int  ry 
)
static

◆ move_cursor_rel_count()

static enum frame_event_status move_cursor_rel_count ( struct session *  ses,
struct document_view *  view,
int  rx,
int  ry,
int  count 
)
static

◆ move_cursor_right()

enum frame_event_status move_cursor_right ( struct session *  ses,
struct document_view *  view 
)

◆ move_cursor_up()

enum frame_event_status move_cursor_up ( struct session *  ses,
struct document_view *  view 
)

◆ move_document_end()

enum frame_event_status move_document_end ( struct session *  ses,
struct document_view *  doc_view 
)

◆ move_document_start()

enum frame_event_status move_document_start ( struct session *  ses,
struct document_view *  doc_view 
)

◆ move_down()

static void move_down ( struct session *  ses,
struct document_view *  doc_view,
int  type,
int  overlap 
)
static

type == 0 -> PAGE_DOWN; type == 1 -> DOWN

◆ move_half_page_down()

enum frame_event_status move_half_page_down ( struct session *  ses,
struct document_view *  doc_view 
)

◆ move_half_page_up()

enum frame_event_status move_half_page_up ( struct session *  ses,
struct document_view *  doc_view 
)

◆ move_link()

enum frame_event_status move_link ( struct session *  ses,
struct document_view *  doc_view,
int  direction,
int  wraparound_bound,
int  wraparound_link 
)

◆ move_link_dir()

enum frame_event_status move_link_dir ( struct session *  ses,
struct document_view *  doc_view,
int  dir_x,
int  dir_y 
)

◆ move_link_down_line()

enum frame_event_status move_link_down_line ( struct session *  ses,
struct document_view *  doc_view 
)

◆ move_link_next_line()

enum frame_event_status move_link_next_line ( struct session *  ses,
struct document_view *  doc_view 
)

◆ move_link_prev_line()

enum frame_event_status move_link_prev_line ( struct session *  ses,
struct document_view *  doc_view 
)

◆ move_link_up_line()

enum frame_event_status move_link_up_line ( struct session *  ses,
struct document_view *  doc_view 
)

◆ move_page_down()

enum frame_event_status move_page_down ( struct session *  ses,
struct document_view *  doc_view 
)

◆ move_page_up()

enum frame_event_status move_page_up ( struct session *  ses,
struct document_view *  doc_view 
)

◆ move_part_page_down()

static enum frame_event_status move_part_page_down ( struct session *  ses,
struct document_view *  doc_view,
int  overlap 
)
static

◆ move_part_page_up()

enum frame_event_status move_part_page_up ( struct session *  ses,
struct document_view *  doc_view,
int  overlap 
)

◆ move_up()

static void move_up ( struct session *  ses,
struct document_view *  doc_view,
int  type,
int  overlap 
)
static

type == 0 -> PAGE_UP; type == 1 -> UP

◆ open_link_dialog()

void open_link_dialog ( struct session *  ses)

◆ save_as()

enum frame_event_status save_as ( struct session *  ses,
struct document_view *  doc_view,
int  magic 
)

◆ save_formatted()

static void save_formatted ( void *  data,
char *  file 
)
static

◆ save_formatted_dlg()

enum frame_event_status save_formatted_dlg ( struct session *  ses,
struct document_view *  doc_view,
int  xxxx 
)

◆ save_formatted_finish()

static void save_formatted_finish ( struct terminal *  term,
int  h,
void *  data,
download_flags_T  flags 
)
static

save_formatted() passes this function as a ::cdf_callback_T to create_download_finish().

◆ scroll_down()

enum frame_event_status scroll_down ( struct session *  ses,
struct document_view *  doc_view 
)

◆ scroll_left()

enum frame_event_status scroll_left ( struct session *  ses,
struct document_view *  doc_view 
)

◆ scroll_right()

enum frame_event_status scroll_right ( struct session *  ses,
struct document_view *  doc_view 
)

◆ scroll_up()

enum frame_event_status scroll_up ( struct session *  ses,
struct document_view *  doc_view 
)

◆ send_event()

void send_event ( struct session *  ses,
struct term_event *  ev 
)

◆ send_kbd_event()

static struct session * send_kbd_event ( struct session *  ses,
struct document_view *  doc_view,
struct term_event *  ev 
)
static
Returns
the session if event cleanup should be done or NULL if no cleanup is needed.

◆ send_to_frame()

static enum frame_event_status send_to_frame ( struct session *  ses,
struct document_view *  doc_view,
struct term_event *  ev 
)
static

◆ set_frame()

enum frame_event_status set_frame ( struct session *  ses,
struct document_view *  doc_view,
int  xxxx 
)

◆ toggle_plain_html()

void toggle_plain_html ( struct session *  ses,
struct document_view *  doc_view,
int  xxxx 
)

Used for changing between formatted and source (plain) view.

◆ toggle_wrap_text()

void toggle_wrap_text ( struct session *  ses,
struct document_view *  doc_view,
int  xxxx 
)

Used for changing wrapping of text.

◆ try_form_action()

static enum frame_event_status try_form_action ( struct session *  ses,
struct document_view *  doc_view,
struct link *  link,
struct term_event *  ev 
)
static

◆ try_jump_to_link_number()

int try_jump_to_link_number ( struct session *  ses,
struct document_view *  doc_view 
)

If the user has provided a numeric prefix, jump to the link with that number as its index.

◆ try_menu()

static enum frame_event_status try_menu ( struct session *  ses,
struct term_event *  ev 
)
static

See whether the BFU (in particular the menu system) is interested in the event.

◆ try_prefix_key()

static enum frame_event_status try_prefix_key ( struct session *  ses,
struct document_view *  doc_view,
struct term_event *  ev 
)
static

◆ try_typeahead()

static void try_typeahead ( struct session *  ses,
struct document_view *  doc_view,
struct term_event *  ev,
main_action_T  action_id 
)
static

◆ vertical_scroll()

enum frame_event_status vertical_scroll ( struct session *  ses,
struct document_view *  doc_view,
int  steps 
)

steps > 0 -> down

◆ view_image()

enum frame_event_status view_image ( struct session *  ses,
struct document_view *  doc_view,
int  xxxx 
)

Variable Documentation

◆ last_event

struct term_event last_event