mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Doxygenate src/viewer/text/
This commit is contained in:
parent
e530fbe8e2
commit
b70aa312d0
@ -1,4 +1,5 @@
|
||||
/* Text mode drawing functions */
|
||||
/** Text mode drawing functions
|
||||
* @file */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@ -176,7 +177,7 @@ draw_view_status(struct session *ses, struct document_view *doc_view, int active
|
||||
}
|
||||
}
|
||||
|
||||
/* Checks if there is a link under the cursor so it can become the current
|
||||
/** Checks if there is a link under the cursor so it can become the current
|
||||
* highlighted link. */
|
||||
static void
|
||||
check_link_under_cursor(struct session *ses, struct document_view *doc_view)
|
||||
@ -192,8 +193,8 @@ check_link_under_cursor(struct session *ses, struct document_view *doc_view)
|
||||
}
|
||||
}
|
||||
|
||||
/* Puts the formatted document on the given terminal's screen. */
|
||||
/* @active indicates whether the document is focused -- i.e.,
|
||||
/** Puts the formatted document on the given terminal's screen.
|
||||
* @a active indicates whether the document is focused -- i.e.,
|
||||
* whether it is displayed in the selected frame or document. */
|
||||
static void
|
||||
draw_doc(struct session *ses, struct document_view *doc_view, int active)
|
||||
@ -336,7 +337,7 @@ draw_frames(struct session *ses)
|
||||
};
|
||||
}
|
||||
|
||||
/* @rerender is ridiciously wound-up. */
|
||||
/** @todo @a rerender is ridiciously wound-up. */
|
||||
void
|
||||
draw_formatted(struct session *ses, int rerender)
|
||||
{
|
||||
|
@ -5,14 +5,14 @@
|
||||
struct document_view;
|
||||
struct session;
|
||||
|
||||
/* Render and draw the current session document */
|
||||
/* If @rerender is:
|
||||
* 0 only redrawing is done
|
||||
* 1 render by first checking the document cache else rerender
|
||||
* 2 forces document to be rerendered */
|
||||
/** Render and draw the current session document.
|
||||
* If @a rerender is:
|
||||
* - 0 only redrawing is done
|
||||
* - 1 render by first checking the document cache else rerender
|
||||
* - 2 forces document to be rerendered */
|
||||
void draw_formatted(struct session *ses, int rerender);
|
||||
|
||||
/* Update the document view, including frames and the status messages */
|
||||
/** Update the document view, including frames and the status messages */
|
||||
void refresh_view(struct session *ses, struct document_view *doc_view, int frames);
|
||||
|
||||
#endif
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Forms viewing/manipulation handling */
|
||||
/** Forms viewing/manipulation handling
|
||||
* @file */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@ -58,6 +59,7 @@
|
||||
/* TODO: Some of these (particulary those encoding routines) would feel better
|
||||
* in viewer/common/. --pasky */
|
||||
|
||||
/** @relates submitted_value */
|
||||
struct submitted_value *
|
||||
init_submitted_value(unsigned char *name, unsigned char *value, enum form_type type,
|
||||
struct form_control *fc, int position)
|
||||
@ -80,6 +82,7 @@ init_submitted_value(unsigned char *name, unsigned char *value, enum form_type t
|
||||
return sv;
|
||||
}
|
||||
|
||||
/** @relates submitted_value */
|
||||
void
|
||||
done_submitted_value(struct submitted_value *sv)
|
||||
{
|
||||
@ -610,6 +613,7 @@ draw_forms(struct terminal *term, struct document_view *doc_view)
|
||||
}
|
||||
|
||||
|
||||
/** @relates submitted_value */
|
||||
void
|
||||
done_submitted_value_list(LIST_OF(struct submitted_value) *list)
|
||||
{
|
||||
@ -814,6 +818,7 @@ struct boundary_info {
|
||||
unsigned char string[BOUNDARY_LENGTH];
|
||||
};
|
||||
|
||||
/** @relates boundary_info */
|
||||
static inline void
|
||||
init_boundary(struct boundary_info *boundary)
|
||||
{
|
||||
@ -821,7 +826,8 @@ init_boundary(struct boundary_info *boundary)
|
||||
memset(boundary->string, '0', BOUNDARY_LENGTH);
|
||||
}
|
||||
|
||||
/* Add boundary to string and save the offset */
|
||||
/** Add boundary to string and save the offset
|
||||
* @relates boundary_info */
|
||||
static inline void
|
||||
add_boundary(struct string *data, struct boundary_info *boundary)
|
||||
{
|
||||
@ -833,6 +839,7 @@ add_boundary(struct string *data, struct boundary_info *boundary)
|
||||
add_bytes_to_string(data, boundary->string, BOUNDARY_LENGTH);
|
||||
}
|
||||
|
||||
/** @relates boundary_info */
|
||||
static inline unsigned char *
|
||||
increment_boundary_counter(struct boundary_info *boundary)
|
||||
{
|
||||
@ -851,6 +858,7 @@ increment_boundary_counter(struct boundary_info *boundary)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** @relates boundary_info */
|
||||
static inline void
|
||||
check_boundary(struct string *data, struct boundary_info *boundary)
|
||||
{
|
||||
@ -896,7 +904,7 @@ check_boundary(struct string *data, struct boundary_info *boundary)
|
||||
memcpy(data->source + boundary->offsets[i], bound, BOUNDARY_LENGTH);
|
||||
}
|
||||
|
||||
/* FIXME: shouldn't we encode data at send time (in http.c) ? --Zas */
|
||||
/** @todo FIXME: shouldn't we encode data at send time (in http.c) ? --Zas */
|
||||
static void
|
||||
encode_multipart(struct session *ses, LIST_OF(struct submitted_value) *l,
|
||||
struct string *data,
|
||||
@ -914,7 +922,7 @@ encode_multipart(struct session *ses, LIST_OF(struct submitted_value) *l,
|
||||
add_boundary(data, boundary);
|
||||
add_crlf_to_string(data);
|
||||
|
||||
/* FIXME: name is not encoded.
|
||||
/** @bug FIXME: name is not encoded.
|
||||
* from RFC 1867:
|
||||
* multipart/form-data contains a series of parts.
|
||||
* Each part is expected to contain a content-disposition
|
||||
@ -1787,7 +1795,7 @@ field_op(struct session *ses, struct document_view *doc_view,
|
||||
return status;
|
||||
}
|
||||
|
||||
unsigned char *
|
||||
static unsigned char *
|
||||
get_form_label(struct form_control *fc)
|
||||
{
|
||||
assert(fc->form);
|
||||
|
@ -13,16 +13,18 @@ struct session;
|
||||
struct term_event;
|
||||
struct terminal;
|
||||
|
||||
/* This struct looks a little embarrassing, yeah. */
|
||||
/*! This struct looks a little embarrassing, yeah. */
|
||||
struct form_view {
|
||||
LIST_HEAD(struct form_view);
|
||||
|
||||
/* We can't just reference to {struct form} since we can potentially
|
||||
* live much longer than that. */
|
||||
/** The corresponding form.form_num within the document.
|
||||
* We can't just reference to struct form since we can potentially
|
||||
* live much longer than that.
|
||||
* @see find_form_by_form_view() */
|
||||
int form_num;
|
||||
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
/* This holds the ECMAScript object attached to this structure. It can
|
||||
/** This holds the ECMAScript object attached to this structure. It can
|
||||
* be NULL since the object is created on-demand at the first time some
|
||||
* ECMAScript code accesses it. It is freed automatically by the
|
||||
* garbage-collecting code when the ECMAScript context is over (usually
|
||||
@ -37,38 +39,43 @@ struct form_state {
|
||||
int position;
|
||||
enum form_type type;
|
||||
|
||||
/* For FC_TEXT, FC_PASSWORD, FC_FILE, and FC_TEXTAREA, @value
|
||||
* is the text string that the user can edit. The string is
|
||||
* null-terminated; its length is not stored separately. The
|
||||
* size of the buffer is not stored anywhere; extending the
|
||||
* string always requires calling realloc(). The string is
|
||||
* not normally allowed to grow past @form_control.maxlength
|
||||
* bytes (not counting the null), but there may be ways to get
|
||||
* longer strings. The string is in the charset of the
|
||||
* terminal (which can be UTF-8 only if CONFIG_UTF8 is
|
||||
* defined, and is assumed to be unibyte otherwise). The
|
||||
* charset of the document and the UTF-8 I/O option have no
|
||||
* effect here. */
|
||||
/* Editable string.
|
||||
* - For ::FC_TEXT, ::FC_PASSWORD, ::FC_FILE, and
|
||||
* ::FC_TEXTAREA, @c value is the text string that the user
|
||||
* can edit. The string is null-terminated; its length is
|
||||
* not stored separately. The size of the buffer is not
|
||||
* stored anywhere; extending the string always requires
|
||||
* calling realloc(). The string is not normally allowed to
|
||||
* grow past form_control.maxlength bytes (not counting the
|
||||
* null), but there may be ways to get longer strings. The
|
||||
* string is in the charset of the terminal (which can be
|
||||
* UTF-8 only if CONFIG_UTF8 is defined, and is assumed to
|
||||
* be unibyte otherwise). The charset of the document and
|
||||
* the UTF-8 I/O option have no effect here. */
|
||||
unsigned char *value;
|
||||
/* For FC_TEXT, FC_PASSWORD, and FC_FILE, @state is the byte
|
||||
* position of the insertion point in @value.
|
||||
* For FC_CHECKBOX and FC_RADIO, @state is 1 or 0.
|
||||
* For FC_SELECT, @state is the index of the selected item
|
||||
* in @form_control.labels. */
|
||||
/** Position in #value, or an editable integer.
|
||||
* - For ::FC_TEXT, ::FC_PASSWORD, and ::FC_FILE, @c state is
|
||||
* the byte position of the insertion point in #value.
|
||||
* - For ::FC_CHECKBOX and ::FC_RADIO, @c state is 1 or 0.
|
||||
* - For ::FC_SELECT, @c state is the index of the selected item
|
||||
* in form_control.labels. */
|
||||
int state;
|
||||
#ifdef CONFIG_UTF8
|
||||
/* For FC_TEXT, FC_PASSWORD, and FC_FILE, @state_cell is not
|
||||
* used. */
|
||||
/** Position in the screen.
|
||||
* - For ::FC_TEXT, ::FC_PASSWORD, and ::FC_FILE, @c
|
||||
* state_cell is not used. */
|
||||
int state_cell;
|
||||
#endif /* CONFIG_UTF8 */
|
||||
/* For FC_TEXT, FC_PASSWORD, and FC_FILE, @vpos is the index
|
||||
* of the first displayed byte in @value. It should never be
|
||||
* in the middle of a character. */
|
||||
/** Horizontal scrolling.
|
||||
* - For ::FC_TEXT, ::FC_PASSWORD, and ::FC_FILE, @c vpos is
|
||||
* the index of the first displayed byte in #value. It
|
||||
* should never be in the middle of a character. */
|
||||
int vpos;
|
||||
/** Vertical scrolling. */
|
||||
int vypos;
|
||||
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
/* This holds the ECMAScript object attached to this structure. It can
|
||||
/** This holds the ECMAScript object attached to this structure. It can
|
||||
* be NULL since the object is created on-demand at the first time some
|
||||
* ECMAScript code accesses it. It is freed automatically by the
|
||||
* garbage-collecting code when the ECMAScript context is over (usually
|
||||
|
@ -164,7 +164,7 @@ get_link_cursor_offset(struct document_view *doc_view, struct link *link)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialise a static template character with the colour and attributes
|
||||
/** Initialise a static template character with the colour and attributes
|
||||
* appropriate for an active link and return that character. */
|
||||
static inline struct screen_char *
|
||||
init_link_drawing(struct document_view *doc_view, struct link *link, int invert)
|
||||
@ -224,7 +224,7 @@ init_link_drawing(struct document_view *doc_view, struct link *link, int invert)
|
||||
return &template;
|
||||
}
|
||||
|
||||
/* Give the current link the appropriate colour and attributes. */
|
||||
/** Give the current link the appropriate colour and attributes. */
|
||||
void
|
||||
draw_current_link(struct session *ses, struct document_view *doc_view)
|
||||
{
|
||||
@ -309,7 +309,7 @@ draw_link(struct terminal *term, struct document_view *doc_view,
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore the colours and attributes that the active link had
|
||||
/** Restore the colours and attributes that the active link had
|
||||
* before it was selected. */
|
||||
void
|
||||
clear_link(struct terminal *term, struct document_view *doc_view)
|
||||
@ -472,7 +472,7 @@ current_link_is_visible(struct document_view *doc_view)
|
||||
return (link && link_in_view(doc_view, link));
|
||||
}
|
||||
|
||||
/* Look for the first and the last link currently visible in our
|
||||
/** Look for the first and the last link currently visible in our
|
||||
* viewport. */
|
||||
static void
|
||||
get_visible_links_range(struct document_view *doc_view, int *first, int *last)
|
||||
@ -543,7 +543,8 @@ next_link_in_view_y(struct document_view *doc_view, int current, int direction)
|
||||
return next_link_in_view_(doc_view, current, direction, link_in_view_y, set_pos_x);
|
||||
}
|
||||
|
||||
/* Get the bounding columns of @link at line @y (or all lines if @y == -1). */
|
||||
/** Get the bounding columns of @a link at line @a y (or all lines if
|
||||
* @a y == -1). */
|
||||
static void
|
||||
get_link_x_bounds(struct link *link, int y, int *min_x, int *max_x)
|
||||
{
|
||||
@ -560,8 +561,8 @@ get_link_x_bounds(struct link *link, int y, int *min_x, int *max_x)
|
||||
}
|
||||
}
|
||||
|
||||
/* Check whether there is any point between @min_x and @max_x at the line @y
|
||||
* in link @link. */
|
||||
/** Check whether there is any point between @a min_x and @a max_x at
|
||||
* the line @a y in link @a link. */
|
||||
static int
|
||||
get_link_x_intersect(struct link *link, int y, int min_x, int max_x)
|
||||
{
|
||||
@ -578,8 +579,8 @@ get_link_x_intersect(struct link *link, int y, int min_x, int max_x)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Check whether there is any point between @min_y and @max_y in the column @x
|
||||
* in link @link. */
|
||||
/** Check whether there is any point between @a min_y and @a max_y in
|
||||
* the column @a x in link @a link. */
|
||||
static int
|
||||
get_link_y_intersect(struct link *link, int x, int min_y, int max_y)
|
||||
{
|
||||
@ -777,8 +778,9 @@ set_pos_y(struct document_view *doc_view, struct link *link)
|
||||
doc_view->document->height - doc_view->box.height);
|
||||
}
|
||||
|
||||
/* direction == 1 -> DOWN
|
||||
* direction == -1 -> UP */
|
||||
/** Focus the next link in the specified direction.
|
||||
* @a direction == 1 -> DOWN;
|
||||
* @a direction == -1 -> UP */
|
||||
static void
|
||||
find_link(struct document_view *doc_view, int direction, int page_mode)
|
||||
{
|
||||
@ -1129,7 +1131,7 @@ get_link_at_coordinates(struct document_view *doc_view, int x, int y)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* This is backend of the backend goto_link_number_do() below ;)). */
|
||||
/** This is backend of the backend goto_link_number_do() below ;)). */
|
||||
void
|
||||
jump_to_link_number(struct session *ses, struct document_view *doc_view, int n)
|
||||
{
|
||||
@ -1156,7 +1158,7 @@ jump_to_link_number(struct session *ses, struct document_view *doc_view, int n)
|
||||
current_link_hover(doc_view);
|
||||
}
|
||||
|
||||
/* This is common backend for goto_link_number() and try_document_key(). */
|
||||
/** This is common backend for goto_link_number() and try_document_key(). */
|
||||
static void
|
||||
goto_link_number_do(struct session *ses, struct document_view *doc_view, int n)
|
||||
{
|
||||
@ -1186,7 +1188,7 @@ goto_link_number(struct session *ses, unsigned char *num)
|
||||
goto_link_number_do(ses, doc_view, atoi(num) - 1);
|
||||
}
|
||||
|
||||
/* See if this document is interested in the key user pressed. */
|
||||
/** See if this document is interested in the key user pressed. */
|
||||
enum frame_event_status
|
||||
try_document_key(struct session *ses, struct document_view *doc_view,
|
||||
struct term_event *ev)
|
||||
@ -1242,8 +1244,8 @@ try_document_key(struct session *ses, struct document_view *doc_view,
|
||||
return FRAME_EVENT_IGNORED;
|
||||
}
|
||||
|
||||
/* Open a contextual menu on a link, form or image element. */
|
||||
/* TODO: This should be completely configurable. */
|
||||
/** Open a contextual menu on a link, form or image element.
|
||||
* @todo TODO: This should be completely configurable. */
|
||||
void
|
||||
link_menu(struct terminal *term, void *xxx, void *ses_)
|
||||
{
|
||||
@ -1366,8 +1368,8 @@ link_menu(struct terminal *term, void *xxx, void *ses_)
|
||||
/* [gettext_accelerator_context()] */
|
||||
}
|
||||
|
||||
/* TODO: Make it possible to trigger any script event hooks associated
|
||||
* to the link. --pasky */
|
||||
/** @todo TODO: Make it possible to trigger any script event
|
||||
* hooks associated to the link. --pasky */
|
||||
|
||||
end:
|
||||
if (!mi->text) {
|
||||
@ -1378,7 +1380,7 @@ end:
|
||||
do_menu(term, mi, ses, 1);
|
||||
}
|
||||
|
||||
/* Return current link's title. */
|
||||
/** Return current link's title. */
|
||||
unsigned char *
|
||||
get_current_link_title(struct document_view *doc_view)
|
||||
{
|
||||
@ -1431,7 +1433,7 @@ get_current_link_info(struct session *ses, struct document_view *doc_view)
|
||||
link = get_current_link(doc_view);
|
||||
if (!link) return NULL;
|
||||
|
||||
/* TODO: Provide info about script event hooks too. --pasky */
|
||||
/** @todo TODO: Provide info about script event hooks too. --pasky */
|
||||
|
||||
if (!link_is_form(link)) {
|
||||
struct terminal *term = ses->tab->term;
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Marks registry */
|
||||
/** Marks registry
|
||||
* @file */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@ -51,7 +52,9 @@
|
||||
* --pasky */
|
||||
|
||||
|
||||
/* The @marks array is indexed by ASCII code of the mark. */
|
||||
/** Number of possible mark characters: upper-case and lower-case
|
||||
* ASCII letters. The ::marks array is indexed by ASCII code of the
|
||||
* mark. */
|
||||
#define MARKS_SIZE 26 * 2
|
||||
static struct view_state *marks[MARKS_SIZE];
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Searching in the HTML document */
|
||||
/** Searching in the HTML document
|
||||
* @file */
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE /* XXX: we _WANT_ strcasestr() ! */
|
||||
@ -212,13 +213,14 @@ get_search_data(struct document *document)
|
||||
sort_srch(document);
|
||||
}
|
||||
|
||||
/* Assign s1 and s2 the first search node and the last search node needed to
|
||||
* form the region starting at line y and ending at the greater of y + height
|
||||
* and the end of the document, with allowance at the start to allow for
|
||||
* multi-line matches that would otherwise be partially outside of the region.
|
||||
/** Assign @a s1 and @a s2 the first search node and the last search
|
||||
* node needed to form the region starting at line @a y and ending at
|
||||
* the greater of @a y + @a height and the end of the document, with
|
||||
* allowance at the start to allow for multi-line matches that would
|
||||
* otherwise be partially outside of the region.
|
||||
*
|
||||
* Returns -1 on assertion failure, 1 if s1 and s2 are not found,
|
||||
* and 0 if they are found. */
|
||||
* @returns -1 on assertion failure, 1 if @a s1 and @a s2 are not
|
||||
* found, and 0 if they are found. */
|
||||
static int
|
||||
get_range(struct document *document, int y, int height, int l,
|
||||
struct search **s1, struct search **s2)
|
||||
@ -260,9 +262,9 @@ get_range(struct document *document, int y, int height, int l,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Returns a string |doc| that is a copy of the text in the search nodes
|
||||
* from |s1| to |s1 + doclen - 1| with the space at the end of each line
|
||||
* converted to a new-line character (LF). */
|
||||
/** Returns a string @c doc that is a copy of the text in the search
|
||||
* nodes from @a s1 to (@a s1 + @a doclen - 1) with the space at the
|
||||
* end of each line converted to a new-line character (LF). */
|
||||
static unsigned char *
|
||||
get_search_region_from_search_nodes(struct search *s1, struct search *s2,
|
||||
int pattern_len, int *doclen)
|
||||
@ -489,7 +491,7 @@ strlen_u(unsigned char *text, int utf8)
|
||||
|
||||
}
|
||||
|
||||
/* Returns an allocated string which is a lowered copy of passed one. */
|
||||
/** Returns an allocated string which is a lowered copy of passed one. */
|
||||
static UCHAR *
|
||||
lowered_string(unsigned char *text, int textlen, int utf8)
|
||||
{
|
||||
@ -763,7 +765,7 @@ get_searched(struct document_view *doc_view, struct point **pt, int *pl, int utf
|
||||
get_searched_plain(doc_view, pt, pl, l, s1, s2, utf8);
|
||||
}
|
||||
|
||||
/* Highlighting of searched strings. */
|
||||
/** Highlighting of searched strings. */
|
||||
void
|
||||
draw_searched(struct terminal *term, struct document_view *doc_view)
|
||||
{
|
||||
@ -1122,7 +1124,8 @@ find_next(struct session *ses, struct document_view *doc_view, int direction)
|
||||
}
|
||||
|
||||
|
||||
/* Link typeahead */
|
||||
/** @name Link typeahead
|
||||
* @{ */
|
||||
|
||||
enum typeahead_code {
|
||||
TYPEAHEAD_MATCHED,
|
||||
@ -1359,8 +1362,11 @@ search_hit_boundary:
|
||||
return TYPEAHEAD_MATCHED;
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
/* Typeahead */
|
||||
|
||||
/** @name Typeahead
|
||||
* @{ */
|
||||
|
||||
static enum input_line_code
|
||||
text_typeahead_handler(struct input_line *line, int action_id)
|
||||
@ -1560,6 +1566,8 @@ search_typeahead(struct session *ses, struct document_view *doc_view,
|
||||
return FRAME_EVENT_OK;
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
/* The dialog functions are clones of input_field() ones. Gross code
|
||||
* duplication. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Textarea form item handlers */
|
||||
/** Textarea form item handlers
|
||||
* @file */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@ -47,18 +48,19 @@ struct line_info {
|
||||
#endif /* CONFIG_UTF8 */
|
||||
};
|
||||
|
||||
/* We add two extra entries to the table so the ending info can be added
|
||||
/** We add two extra entries to the table so the ending info can be added
|
||||
* without reallocating. */
|
||||
#define realloc_line_info(info, size) \
|
||||
mem_align_alloc(info, size, (size) + 3, 0xFF)
|
||||
|
||||
#ifdef CONFIG_UTF8
|
||||
/* Allocates a line_info table describing the layout of the textarea buffer.
|
||||
/** Allocates a line_info table describing the layout of the textarea buffer.
|
||||
*
|
||||
* @width is max width and the offset at which text will be wrapped
|
||||
* @wrap controls how the wrapping of text is performed
|
||||
* @format is non zero the @text will be modified to make it suitable for
|
||||
* encoding it for form posting
|
||||
* @param width is max width and the offset at which @a text will be
|
||||
* wrapped
|
||||
* @param wrap controls how the wrapping of @a text is performed
|
||||
* @param format is non zero the @a text will be modified to make it
|
||||
* suitable for encoding it for form posting
|
||||
*/
|
||||
static struct line_info *
|
||||
format_textutf8(unsigned char *text, int width, enum form_wrap wrap, int format)
|
||||
@ -138,12 +140,13 @@ format_textutf8(unsigned char *text, int width, enum form_wrap wrap, int format)
|
||||
}
|
||||
#endif /* CONFIG_UTF8 */
|
||||
|
||||
/* Allocates a line_info table describing the layout of the textarea buffer.
|
||||
/** Allocates a line_info table describing the layout of the textarea buffer.
|
||||
*
|
||||
* @width is max width and the offset at which text will be wrapped
|
||||
* @wrap controls how the wrapping of text is performed
|
||||
* @format is non zero the @text will be modified to make it suitable for
|
||||
* encoding it for form posting
|
||||
* @param width is max width and the offset at which @a text will be
|
||||
* wrapped
|
||||
* @param wrap controls how the wrapping of @a text is performed
|
||||
* @param format is non zero the @a text will be modified to make it
|
||||
* suitable for encoding it for form posting
|
||||
*/
|
||||
static struct line_info *
|
||||
format_text(unsigned char *text, int width, enum form_wrap wrap, int format)
|
||||
@ -204,9 +207,9 @@ format_text(unsigned char *text, int width, enum form_wrap wrap, int format)
|
||||
return line;
|
||||
}
|
||||
|
||||
/* Searches for @cursor_position (aka. position in the fs->value string) for
|
||||
* the corresponding entry in the @line info. Returns the index or -1 if
|
||||
* position is not found. */
|
||||
/** Searches for @a cursor_position (aka. position in the
|
||||
* form_state.value string) for the corresponding entry in the @a line
|
||||
* info. Returns the index or -1 if position is not found. */
|
||||
static int
|
||||
get_textarea_line_number(struct line_info *line, int cursor_position)
|
||||
{
|
||||
@ -226,8 +229,8 @@ get_textarea_line_number(struct line_info *line, int cursor_position)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Fixes up the vpos and vypos members of the form_state. Returns the
|
||||
* logical position in the textarea view. */
|
||||
/** Fixes up the form_state.vpos and form_state.vypos members.
|
||||
* @returns the logical position in the textarea view. */
|
||||
#ifdef CONFIG_UTF8
|
||||
int
|
||||
area_cursor(struct form_control *fc, struct form_state *fs, int utf8)
|
||||
@ -513,10 +516,10 @@ encode_textarea(struct submitted_value *sv)
|
||||
}
|
||||
|
||||
|
||||
/* We use some evil hacking in order to make external textarea editor working.
|
||||
/** We use some evil hacking in order to make external textarea editor working.
|
||||
* We need to have some way how to be notified that the editor finished and we
|
||||
* should reload content of the textarea. So we use global variable
|
||||
* textarea_editor as a flag whether we have one running, and if we have, we
|
||||
* @c textarea_editor as a flag whether we have one running, and if we have, we
|
||||
* just call textarea_edit(1, ...). Then we recover our state from static
|
||||
* variables, reload content of textarea back from file and clean up.
|
||||
*
|
||||
@ -525,7 +528,6 @@ encode_textarea(struct submitted_value *sv)
|
||||
* the content of it back to master somehow, add special flags for not deleting
|
||||
* of 'delete' etc) and I'm not going to do that now. Inter-links communication
|
||||
* *NEEDS* rewrite, as it looks just like quick messy hack now. --pasky */
|
||||
|
||||
int textarea_editor = 0;
|
||||
|
||||
static unsigned char *
|
||||
@ -1070,7 +1072,7 @@ textarea_op_bob(struct form_state *fs, struct form_control *fc)
|
||||
}
|
||||
#endif /* CONFIG_UTF8 */
|
||||
|
||||
/* Set the form state so the cursor is on the last line of the buffer. Preserve
|
||||
/** Set the form state so the cursor is on the last line of the buffer. Preserve
|
||||
* the column if possible. This is done by getting current and last line and
|
||||
* then shifting the state by the delta of both lines start position bounding
|
||||
* the whole thing to the end of the last line. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* HTML viewer (and much more) */
|
||||
/** HTML viewer (and much more)
|
||||
* @file */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@ -83,8 +84,8 @@ detach_formatted(struct document_view *doc_view)
|
||||
mem_free_set(&doc_view->name, NULL);
|
||||
}
|
||||
|
||||
/* type == 0 -> PAGE_DOWN
|
||||
* type == 1 -> DOWN */
|
||||
/*! @a type == 0 -> PAGE_DOWN;
|
||||
* @a type == 1 -> DOWN */
|
||||
static void
|
||||
move_down(struct session *ses, struct document_view *doc_view, int type)
|
||||
{
|
||||
@ -123,8 +124,8 @@ move_page_down(struct session *ses, struct document_view *doc_view)
|
||||
return doc_view->vs->y == oldy ? FRAME_EVENT_OK : FRAME_EVENT_REFRESH;
|
||||
}
|
||||
|
||||
/* type == 0 -> PAGE_UP
|
||||
* type == 1 -> UP */
|
||||
/*! @a type == 0 -> PAGE_UP;
|
||||
* @a type == 1 -> UP */
|
||||
static void
|
||||
move_up(struct session *ses, struct document_view *doc_view, int type)
|
||||
{
|
||||
@ -262,7 +263,7 @@ move_link_dir(struct session *ses, struct document_view *doc_view, int dir_x, in
|
||||
return FRAME_EVENT_REFRESH;
|
||||
}
|
||||
|
||||
/* @steps > 0 -> down */
|
||||
/*! @a steps > 0 -> down */
|
||||
static enum frame_event_status
|
||||
vertical_scroll(struct session *ses, struct document_view *doc_view, int steps)
|
||||
{
|
||||
@ -297,7 +298,7 @@ vertical_scroll(struct session *ses, struct document_view *doc_view, int steps)
|
||||
return FRAME_EVENT_REFRESH;
|
||||
}
|
||||
|
||||
/* @steps > 0 -> right */
|
||||
/*! @a steps > 0 -> right */
|
||||
static enum frame_event_status
|
||||
horizontal_scroll(struct session *ses, struct document_view *doc_view, int steps)
|
||||
{
|
||||
@ -494,9 +495,10 @@ toggle_wrap_text(struct session *ses, struct document_view *doc_view, int xxxx)
|
||||
draw_formatted(ses, 1);
|
||||
}
|
||||
|
||||
/* 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 the cursor to the document view co-ordinates provided
|
||||
* as @a x and @a 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. */
|
||||
enum frame_event_status
|
||||
move_cursor(struct session *ses, struct document_view *doc_view, int x, int y)
|
||||
{
|
||||
@ -1036,8 +1038,8 @@ is_mouse_on_tab_bar(struct session *ses, struct term_event_mouse *mouse)
|
||||
|
||||
return mouse->y == y;
|
||||
}
|
||||
/* Returns the session if event cleanup should be done or NULL if no cleanup is
|
||||
* needed. */
|
||||
/** @returns the session if event cleanup should be done or NULL if no
|
||||
* cleanup is needed. */
|
||||
static struct session *
|
||||
send_mouse_event(struct session *ses, struct document_view *doc_view,
|
||||
struct term_event *ev)
|
||||
@ -1136,8 +1138,8 @@ try_typeahead(struct session *ses, struct document_view *doc_view,
|
||||
term_send_event(ses->tab->term, ev);
|
||||
}
|
||||
|
||||
/* Returns the session if event cleanup should be done or NULL if no cleanup is
|
||||
* needed. */
|
||||
/** @returns the session if event cleanup should be done or NULL if no
|
||||
* cleanup is needed. */
|
||||
static struct session *
|
||||
send_kbd_event(struct session *ses, struct document_view *doc_view,
|
||||
struct term_event *ev)
|
||||
|
@ -10,7 +10,8 @@ struct session;
|
||||
struct term_event;
|
||||
struct terminal;
|
||||
|
||||
/* Releases the document view's resources. But doesn't free() the @view. */
|
||||
/** Releases the document view's resources.
|
||||
* But doesn't free() the @a doc_view. */
|
||||
void detach_formatted(struct document_view *doc_view);
|
||||
|
||||
enum frame_event_status move_page_down(struct session *ses, struct document_view *doc_view);
|
||||
@ -40,7 +41,7 @@ enum frame_event_status move_document_end(struct session *ses, struct document_v
|
||||
enum frame_event_status set_frame(struct session *ses, struct document_view *doc_view, int xxxx);
|
||||
struct document_view *current_frame(struct session *);
|
||||
|
||||
/* Used for changing between formatted and source (plain) view. */
|
||||
/** Used for changing between formatted and source (plain) view. */
|
||||
void toggle_plain_html(struct session *ses, struct document_view *doc_view, int xxxx);
|
||||
|
||||
enum frame_event_status move_cursor_left(struct session *ses,
|
||||
@ -56,23 +57,27 @@ enum frame_event_status move_cursor(struct session *ses,
|
||||
struct document_view *doc_view,
|
||||
int x, int y);
|
||||
|
||||
/* Used for changing wrapping of text */
|
||||
/** Used for changing wrapping of text */
|
||||
void toggle_wrap_text(struct session *ses, struct document_view *doc_view, int xxxx);
|
||||
|
||||
enum frame_event_status copy_current_link_to_clipboard(struct session *ses,
|
||||
struct document_view *doc_view,
|
||||
int xxx);
|
||||
|
||||
/* If the user has provided a numeric prefix, jump to the link
|
||||
/** If the user has provided a numeric prefix, jump to the link
|
||||
* with that number as its index. */
|
||||
int try_jump_to_link_number(struct session *ses,
|
||||
struct document_view *doc_view);
|
||||
|
||||
/* File menu handlers. */
|
||||
/** @name File menu handlers.
|
||||
* @{ */
|
||||
|
||||
enum frame_event_status save_as(struct session *ses, struct document_view *doc_view, int magic);
|
||||
|
||||
/* Various event emitters and link menu handlers. */
|
||||
/** @} */
|
||||
|
||||
/** @name Various event emitters and link menu handlers.
|
||||
* @{ */
|
||||
|
||||
void send_event(struct session *, struct term_event *);
|
||||
|
||||
@ -80,4 +85,6 @@ enum frame_event_status save_formatted_dlg(struct session *ses, struct document_
|
||||
enum frame_event_status view_image(struct session *ses, struct document_view *doc_view, int xxxx);
|
||||
enum frame_event_status download_link(struct session *ses, struct document_view *doc_view, action_id_T action_id);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* View state manager */
|
||||
/** View state manager
|
||||
* @file */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@ -23,6 +24,7 @@
|
||||
#include "viewer/text/vs.h"
|
||||
|
||||
|
||||
/** @relates view_state */
|
||||
void
|
||||
init_vs(struct view_state *vs, struct uri *uri, int plain)
|
||||
{
|
||||
@ -39,6 +41,7 @@ init_vs(struct view_state *vs, struct uri *uri, int plain)
|
||||
init_list(vs->forms);
|
||||
}
|
||||
|
||||
/** @relates view_state */
|
||||
void
|
||||
destroy_vs(struct view_state *vs, int blast_ecmascript)
|
||||
{
|
||||
@ -60,6 +63,7 @@ destroy_vs(struct view_state *vs, int blast_ecmascript)
|
||||
}
|
||||
}
|
||||
|
||||
/** @relates view_state */
|
||||
void
|
||||
copy_vs(struct view_state *dst, struct view_state *src)
|
||||
{
|
||||
|
@ -27,8 +27,8 @@ struct view_state {
|
||||
unsigned int did_fragment:1;
|
||||
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
/* If set, we reset the interpreter state the next time we are going to
|
||||
* render document attached to this view state. This means a real
|
||||
/** If set, we reset the interpreter state the next time we are going
|
||||
* to render document attached to this view state. This means a real
|
||||
* document (not just struct document_view, which randomly appears and
|
||||
* disappears during gradual rendering) is getting replaced. So set this
|
||||
* always when you replace the view_state URI, but also when reloading
|
||||
|
Loading…
Reference in New Issue
Block a user