mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-13 05:43:37 -04:00
Merge commit 'pasky.or.cz/elinks-0.12' into elinks-0.13
There were conflicts in src/document/css/ because 0.12.GIT switched to LIST_OF(struct css_selector) and 0.13.GIT switched to struct css_selector_set. Resolved by using LIST_OF(struct css_selector) inside struct css_selector_set.
This commit is contained in:
commit
2437d35904
275
src/Doxyfile
Normal file
275
src/Doxyfile
Normal file
@ -0,0 +1,275 @@
|
||||
# Doxyfile 1.5.2
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = ELinks
|
||||
PROJECT_NUMBER = 0.13.GIT
|
||||
OUTPUT_DIRECTORY = ../doc/api
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = .
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = NO
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 3
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
BUILTIN_STL_SUPPORT = NO
|
||||
CPP_CLI_SUPPORT = NO
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SUBGROUPING = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_PRIVATE = YES
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = YES
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = NO
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_DIRECTORIES = NO
|
||||
FILE_VERSION_FILTER =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
INPUT = .
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *.c \
|
||||
*.h \
|
||||
*.inc
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = NO
|
||||
REFERENCES_RELATION = NO
|
||||
REFERENCES_LINK_SOURCE = NO
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = YES
|
||||
EXPAND_ONLY_PREDEF = YES
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = "LIST_OF(element_T)=element_T list" \
|
||||
CONFIG_DEBUG \
|
||||
CONFIG_UTF8 \
|
||||
HAVE_VARIADIC_MACROS
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
CLASS_DIAGRAMS = NO
|
||||
MSCGEN_PATH =
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = YES
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
CALLER_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
DOT_GRAPH_MAX_NODES = 50
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
SEARCHENGINE = NO
|
@ -45,7 +45,7 @@ elinks: $(LIB_O_NAME) vernum.o
|
||||
TAGS:
|
||||
cd $(srcdir) \
|
||||
&& find . \( -name "*.[ch]" -o -name "*.inc" \) -print \
|
||||
| etags --regex='{c}/INIT_LIST_HEAD(\([[:alnum:]_]+\))/\1/' \
|
||||
| etags --regex='{c}/INIT_LIST_OF([^,]*,[ \t]*\([[:alnum:]_]+\))/\1/' \
|
||||
--regex='{c}/struct_hierbox_browser(\n[ \t]*\([[:alnum:]_]+\),/\1/m' \
|
||||
--regex='{c}/^ACTION_(\([[:alnum:]_]+\),[^,]*,[ \t]*\([[:alnum:]_]+\),/ACT_\1_\2/' \
|
||||
--language=c -
|
||||
|
@ -21,8 +21,8 @@ struct hierbox_browser {
|
||||
const struct hierbox_browser_button *buttons;
|
||||
size_t buttons_size;
|
||||
|
||||
struct list_head boxes;
|
||||
struct list_head dialogs;
|
||||
LIST_OF(struct listbox_data) boxes;
|
||||
LIST_OF(struct hierbox_dialog_list_item) dialogs;
|
||||
struct listbox_item root;
|
||||
const struct listbox_ops *ops;
|
||||
|
||||
|
@ -30,7 +30,7 @@ struct widget_info_field {
|
||||
struct widget_data_info_field {
|
||||
int vpos;
|
||||
int cpos;
|
||||
struct list_head history;
|
||||
LIST_OF(struct input_history_entry) history;
|
||||
struct input_history_entry *cur_hist;
|
||||
};
|
||||
|
||||
|
@ -58,7 +58,8 @@ menu_tab_compl(struct terminal *term, void *item_, void *dlg_data_)
|
||||
/* Complete to last unambiguous character, and display menu for all possible
|
||||
* further completions. */
|
||||
void
|
||||
do_tab_compl(struct dialog_data *dlg_data, struct list_head *history)
|
||||
do_tab_compl(struct dialog_data *dlg_data,
|
||||
LIST_OF(struct input_history_entry) *history)
|
||||
{
|
||||
struct terminal *term = dlg_data->win->term;
|
||||
struct widget_data *widget_data = selected_widget(dlg_data);
|
||||
@ -104,7 +105,8 @@ strcommonlen(unsigned char *a, unsigned char *b)
|
||||
* completes `go' to `google.com' and `google.com/' to `google.com/search?q='.
|
||||
*/
|
||||
void
|
||||
do_tab_compl_unambiguous(struct dialog_data *dlg_data, struct list_head *history)
|
||||
do_tab_compl_unambiguous(struct dialog_data *dlg_data,
|
||||
LIST_OF(struct input_history_entry) *history)
|
||||
{
|
||||
struct string completion;
|
||||
struct widget_data *widget_data = selected_widget(dlg_data);
|
||||
@ -188,7 +190,8 @@ tab_complete_file_menu(struct terminal *term, void *path_, void *dlg_data_)
|
||||
}
|
||||
|
||||
void
|
||||
do_tab_compl_file(struct dialog_data *dlg_data, struct list_head *history)
|
||||
do_tab_compl_file(struct dialog_data *dlg_data,
|
||||
LIST_OF(struct input_history_entry) *history)
|
||||
{
|
||||
struct widget_data *widget_data = selected_widget(dlg_data);
|
||||
|
||||
|
@ -12,7 +12,7 @@ struct input_history_entry {
|
||||
};
|
||||
|
||||
struct input_history {
|
||||
struct list_head entries;
|
||||
LIST_OF(struct input_history_entry) entries;
|
||||
int size;
|
||||
unsigned int dirty:1;
|
||||
unsigned int nosave:1;
|
||||
@ -42,9 +42,12 @@ struct input_history {
|
||||
|
||||
void add_to_input_history(struct input_history *, unsigned char *, int);
|
||||
|
||||
void do_tab_compl(struct dialog_data *, struct list_head *);
|
||||
void do_tab_compl_file(struct dialog_data *, struct list_head *);
|
||||
void do_tab_compl_unambiguous(struct dialog_data *, struct list_head *);
|
||||
void do_tab_compl(struct dialog_data *,
|
||||
LIST_OF(struct input_history_entry) *);
|
||||
void do_tab_compl_file(struct dialog_data *,
|
||||
LIST_OF(struct input_history_entry) *);
|
||||
void do_tab_compl_unambiguous(struct dialog_data *,
|
||||
LIST_OF(struct input_history_entry) *);
|
||||
|
||||
/* Load history file from elinks home. */
|
||||
int load_input_history(struct input_history *history, unsigned char *filename);
|
||||
|
@ -407,7 +407,7 @@ display_listbox_item(struct listbox_item *item, void *data_, int *offset)
|
||||
str[1] = BORDER_SDLCORNER;
|
||||
}
|
||||
} else {
|
||||
struct list_head *p = data->box->items;
|
||||
LIST_OF(struct listbox_item) *p = data->box->items;
|
||||
|
||||
if (p->next == item) {
|
||||
str[1] = BORDER_SULCORNER;
|
||||
|
@ -105,7 +105,7 @@ struct listbox_data {
|
||||
struct listbox_item *top; /* Item which is on the top line of the box */
|
||||
|
||||
int sel_offset; /* Offset of selected item against the box top */
|
||||
struct list_head *items; /* The list being displayed */
|
||||
LIST_OF(struct listbox_item) *items; /* The list being displayed */
|
||||
};
|
||||
|
||||
enum listbox_item_type {
|
||||
@ -119,7 +119,7 @@ struct listbox_item {
|
||||
LIST_HEAD(struct listbox_item);
|
||||
|
||||
/* The list may be empty for leaf nodes or non-hiearchic listboxes */
|
||||
struct list_head child;
|
||||
LIST_OF(struct listbox_item) child;
|
||||
|
||||
enum listbox_item_type type;
|
||||
int depth;
|
||||
|
@ -74,7 +74,7 @@ bookmarks_read(void)
|
||||
}
|
||||
|
||||
void
|
||||
bookmarks_write(struct list_head *bookmarks_list)
|
||||
bookmarks_write(LIST_OF(struct bookmark) *bookmarks_list)
|
||||
{
|
||||
int backend_num = get_opt_int("bookmarks.file_format");
|
||||
struct bookmarks_backend *backend = bookmarks_backends[backend_num];
|
||||
|
@ -10,10 +10,10 @@ struct bookmarks_backend {
|
||||
/* Order matters here. --Zas. */
|
||||
unsigned char *(*filename)(int);
|
||||
void (*read)(FILE *);
|
||||
void (*write)(struct secure_save_info *, struct list_head *);
|
||||
void (*write)(struct secure_save_info *, LIST_OF(struct bookmark) *);
|
||||
};
|
||||
|
||||
void bookmarks_read(void);
|
||||
void bookmarks_write(struct list_head *);
|
||||
void bookmarks_write(LIST_OF(struct bookmark) *);
|
||||
|
||||
#endif
|
||||
|
@ -128,7 +128,7 @@ read_bookmarks_default(FILE *f)
|
||||
/* Saves the bookmarks to file */
|
||||
static void
|
||||
write_bookmarks_default(struct secure_save_info *ssi,
|
||||
struct list_head *bookmarks_list)
|
||||
LIST_OF(struct bookmark) *bookmarks_list)
|
||||
{
|
||||
int folder_state = get_opt_bool("bookmarks.folder_state");
|
||||
struct bookmark *bm;
|
||||
|
@ -58,16 +58,16 @@ static unsigned char * filename_bookmarks_xbel(int writing);
|
||||
static int xbeltree_to_bookmarks_list(struct tree_node *root,
|
||||
struct bookmark *current_parent);
|
||||
static void write_bookmarks_list(struct secure_save_info *ssi,
|
||||
struct list_head *bookmarks_list,
|
||||
LIST_OF(struct bookmark) *bookmarks_list,
|
||||
int n, int folder_state);
|
||||
static void write_bookmarks_xbel(struct secure_save_info *ssi,
|
||||
struct list_head *bookmarks_list);
|
||||
LIST_OF(struct bookmark) *bookmarks_list);
|
||||
|
||||
/* Element */
|
||||
struct tree_node {
|
||||
unsigned char *name; /* Name of the element */
|
||||
unsigned char *text; /* Text inside the element */
|
||||
struct list_head attrs; /* {struct attributes} */
|
||||
LIST_OF(struct attributes) attrs;
|
||||
struct tree_node *parent;
|
||||
struct tree_node *children;
|
||||
|
||||
@ -134,7 +134,7 @@ read_bookmarks_xbel(FILE *f)
|
||||
|
||||
static void
|
||||
write_bookmarks_xbel(struct secure_save_info *ssi,
|
||||
struct list_head *bookmarks_list)
|
||||
LIST_OF(struct bookmarks) *bookmarks_list)
|
||||
{
|
||||
int folder_state = get_opt_bool("bookmarks.folder_state");
|
||||
/* We check for readok in filename_bookmarks_xbel(). */
|
||||
@ -208,7 +208,7 @@ print_xml_entities(struct secure_save_info *ssi, const unsigned char *str)
|
||||
|
||||
static void
|
||||
write_bookmarks_list(struct secure_save_info *ssi,
|
||||
struct list_head *bookmarks_list,
|
||||
LIST_OF(struct bookmark) *bookmarks_list,
|
||||
int n, int folder_state)
|
||||
{
|
||||
struct bookmark *bm;
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "util/string.h"
|
||||
|
||||
/* The list of bookmarks */
|
||||
INIT_LIST_HEAD(bookmarks);
|
||||
INIT_LIST_OF(struct bookmark, bookmarks);
|
||||
|
||||
/* Set to 1, if bookmarks have changed. */
|
||||
static int bookmarks_dirty = 0;
|
||||
@ -147,8 +147,8 @@ init_bookmarks(struct module *module)
|
||||
|
||||
/* Clears the bookmark list */
|
||||
static void
|
||||
free_bookmarks(struct list_head *bookmarks_list,
|
||||
struct list_head *box_items)
|
||||
free_bookmarks(LIST_OF(struct bookmark) *bookmarks_list,
|
||||
LIST_OF(struct listbox_item) *box_items)
|
||||
{
|
||||
struct bookmark *bm;
|
||||
|
||||
@ -441,7 +441,7 @@ struct bookmark *
|
||||
get_bookmark_by_name(struct bookmark *folder, unsigned char *title)
|
||||
{
|
||||
struct bookmark *bookmark;
|
||||
struct list_head *lh;
|
||||
LIST_OF(struct bookmark) *lh;
|
||||
|
||||
lh = folder ? &folder->child : &bookmarks;
|
||||
|
||||
|
@ -20,12 +20,12 @@ struct bookmark {
|
||||
unsigned char *title; /* title of bookmark */
|
||||
unsigned char *url; /* Location of bookmarked item */
|
||||
|
||||
struct list_head child;
|
||||
LIST_OF(struct bookmark) child;
|
||||
};
|
||||
|
||||
/* Bookmark lists */
|
||||
|
||||
extern struct list_head bookmarks; /* struct bookmark */
|
||||
extern LIST_OF(struct bookmark) bookmarks;
|
||||
|
||||
/* The bookmarks module */
|
||||
|
||||
|
@ -344,7 +344,7 @@ enum move_bookmark_flags {
|
||||
* _into_ dest or, if insert_as_child is 0, _after_ dest. */
|
||||
static enum move_bookmark_flags
|
||||
do_move_bookmark(struct bookmark *dest, int insert_as_child,
|
||||
struct list_head *src, struct listbox_data *box)
|
||||
LIST_OF(struct bookmark) *src, struct listbox_data *box)
|
||||
{
|
||||
static int move_bookmark_event_id = EVENT_NONE;
|
||||
struct bookmark *bm, *next;
|
||||
|
2
src/cache/cache.c
vendored
2
src/cache/cache.c
vendored
@ -24,7 +24,7 @@
|
||||
#include "util/time.h"
|
||||
|
||||
/* The list of cache entries */
|
||||
static INIT_LIST_HEAD(cache_entries);
|
||||
static INIT_LIST_OF(struct cache_entry, cache_entries);
|
||||
|
||||
static unsigned longlong cache_size;
|
||||
static int id_counter = 1;
|
||||
|
2
src/cache/cache.h
vendored
2
src/cache/cache.h
vendored
@ -29,7 +29,7 @@ struct cache_entry {
|
||||
/* Items in this list are ALLOCATED IN A NON-STANDARD WAY! Thus if you
|
||||
* are gonna mess with them (you shouldn't), you need to use the
|
||||
* mmap suite. */
|
||||
struct list_head frag; /* -> struct fragment */
|
||||
LIST_OF(struct fragment) frag;
|
||||
|
||||
struct uri *uri; /* Identifier for the cached data */
|
||||
struct uri *proxy_uri; /* Proxy identifier or same as @uri */
|
||||
|
@ -45,7 +45,7 @@ static unsigned char *remote_url;
|
||||
|
||||
static enum retval
|
||||
parse_options_(int argc, unsigned char *argv[], struct option *opt,
|
||||
struct list_head *url_list)
|
||||
LIST_OF(struct string_list_item) *url_list)
|
||||
{
|
||||
while (argc) {
|
||||
argv++, argc--;
|
||||
@ -116,7 +116,8 @@ unknown_option:
|
||||
}
|
||||
|
||||
enum retval
|
||||
parse_options(int argc, unsigned char *argv[], struct list_head *url_list)
|
||||
parse_options(int argc, unsigned char *argv[],
|
||||
LIST_OF(struct string_list_item) *url_list)
|
||||
{
|
||||
return parse_options_(argc, argv, cmdline_options, url_list);
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "main/main.h"
|
||||
#include "util/lists.h"
|
||||
|
||||
enum retval parse_options(int, unsigned char *[], struct list_head *);
|
||||
enum retval parse_options(int, unsigned char *[],
|
||||
LIST_OF(struct string_list_item) *);
|
||||
|
||||
#endif
|
||||
|
@ -924,8 +924,6 @@ push_kbdbind_save_button(struct dialog_data *dlg_data,
|
||||
}
|
||||
|
||||
|
||||
static INIT_LIST_HEAD(keybinding_dialog_list);
|
||||
|
||||
static const struct hierbox_browser_button keybinding_buttons[] = {
|
||||
/* [gettext_accelerator_context(.keybinding_buttons)] */
|
||||
{ N_("~Add"), push_kbdbind_add_button, 0 },
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
static struct action_list action_table[KEYMAP_MAX];
|
||||
static struct keymap keymap_table[KEYMAP_MAX];
|
||||
static struct list_head keymaps[KEYMAP_MAX]; /* struct keybinding */
|
||||
static LIST_OF(struct keybinding) keymaps[KEYMAP_MAX];
|
||||
|
||||
static void add_default_keybindings(void);
|
||||
|
||||
@ -318,12 +318,12 @@ get_keymap_name(enum keymap_id keymap_id)
|
||||
}
|
||||
|
||||
|
||||
struct key {
|
||||
unsigned char *str;
|
||||
int num;
|
||||
struct named_key {
|
||||
const unsigned char *str;
|
||||
term_event_key_T num;
|
||||
};
|
||||
|
||||
static struct key key_table[] = {
|
||||
static const struct named_key key_table[] = {
|
||||
{ "Enter", KBD_ENTER },
|
||||
{ "Space", ' ' },
|
||||
{ "Backspace", KBD_BS },
|
||||
@ -351,13 +351,13 @@ static struct key key_table[] = {
|
||||
{ "F10", KBD_F10 },
|
||||
{ "F11", KBD_F11 },
|
||||
{ "F12", KBD_F12 },
|
||||
{ NULL, 0 }
|
||||
{ NULL, KBD_UNDEF }
|
||||
};
|
||||
|
||||
term_event_key_T
|
||||
read_key(const unsigned char *key_str)
|
||||
{
|
||||
struct key *key;
|
||||
const struct named_key *key;
|
||||
|
||||
if (key_str[0] && !key_str[1])
|
||||
return key_str[0];
|
||||
@ -438,8 +438,8 @@ add_keystroke_to_string(struct string *str, struct term_event_keyboard *kbd,
|
||||
int escape)
|
||||
{
|
||||
unsigned char key_buffer[3] = "\\x";
|
||||
unsigned char *key_string = NULL;
|
||||
struct key *key;
|
||||
const unsigned char *key_string = NULL;
|
||||
const struct named_key *key;
|
||||
|
||||
if (kbd->key == KBD_UNDEF) return;
|
||||
|
||||
@ -459,7 +459,7 @@ add_keystroke_to_string(struct string *str, struct term_event_keyboard *kbd,
|
||||
|
||||
if (!key_string) {
|
||||
key_string = key_buffer + 1;
|
||||
*key_string = (unsigned char) kbd->key;
|
||||
key_buffer[1] = (unsigned char) kbd->key;
|
||||
if (escape && strchr("'\"\\", kbd->key))
|
||||
key_string--;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@
|
||||
* (struct option *) instead. This applies to bookmarks, global history and
|
||||
* listbox items as well, though. --pasky */
|
||||
|
||||
static INIT_LIST_HEAD(options_root_tree);
|
||||
static INIT_LIST_OF(struct option, options_root_tree);
|
||||
|
||||
static struct option options_root = INIT_OPTION(
|
||||
/* name: */ "",
|
||||
@ -68,7 +68,7 @@ struct option *config_options;
|
||||
struct option *cmdline_options;
|
||||
|
||||
static void add_opt_rec(struct option *, unsigned char *, struct option *);
|
||||
static void free_options_tree(struct list_head *, int recursive);
|
||||
static void free_options_tree(LIST_OF(struct option) *, int recursive);
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
/* Detect ending '.' (and some others) in options captions.
|
||||
@ -305,8 +305,8 @@ get_opt_(
|
||||
static void
|
||||
add_opt_sort(struct option *tree, struct option *option, int abi)
|
||||
{
|
||||
struct list_head *cat = tree->value.tree;
|
||||
struct list_head *bcat = &tree->box_item->child;
|
||||
LIST_OF(struct option) *cat = tree->value.tree;
|
||||
LIST_OF(struct listbox_item) *bcat = &tree->box_item->child;
|
||||
struct option *pos;
|
||||
|
||||
/* The list is empty, just add it there. */
|
||||
@ -477,7 +477,7 @@ add_opt(struct option *tree, unsigned char *path, unsigned char *capt,
|
||||
mem_free(option);
|
||||
return NULL;
|
||||
}
|
||||
option->value.tree = (struct list_head *) value;
|
||||
option->value.tree = (LIST_OF(struct option) *) value;
|
||||
break;
|
||||
case OPT_STRING:
|
||||
if (!value) {
|
||||
@ -642,10 +642,10 @@ copy_option(struct option *template)
|
||||
return option;
|
||||
}
|
||||
|
||||
struct list_head *
|
||||
LIST_OF(struct option) *
|
||||
init_options_tree(void)
|
||||
{
|
||||
struct list_head *ptr = mem_alloc(sizeof(*ptr));
|
||||
LIST_OF(struct option) *ptr = mem_alloc(sizeof(*ptr));
|
||||
|
||||
if (ptr) init_list(*ptr);
|
||||
return ptr;
|
||||
@ -700,7 +700,7 @@ init_options(void)
|
||||
}
|
||||
|
||||
static void
|
||||
free_options_tree(struct list_head *tree, int recursive)
|
||||
free_options_tree(LIST_OF(struct option) *tree, int recursive)
|
||||
{
|
||||
while (!list_empty(*tree))
|
||||
delete_option_do(tree->next, recursive);
|
||||
@ -730,7 +730,7 @@ register_change_hooks(const struct change_hook_info *change_hooks)
|
||||
}
|
||||
|
||||
void
|
||||
unmark_options_tree(struct list_head *tree)
|
||||
unmark_options_tree(LIST_OF(struct option) *tree)
|
||||
{
|
||||
struct option *option;
|
||||
|
||||
@ -742,7 +742,7 @@ unmark_options_tree(struct list_head *tree)
|
||||
}
|
||||
|
||||
void
|
||||
watermark_deleted_options(struct list_head *tree)
|
||||
watermark_deleted_options(LIST_OF(struct option) *tree)
|
||||
{
|
||||
struct option *option;
|
||||
|
||||
@ -755,7 +755,7 @@ watermark_deleted_options(struct list_head *tree)
|
||||
}
|
||||
|
||||
static int
|
||||
check_nonempty_tree(struct list_head *options)
|
||||
check_nonempty_tree(LIST_OF(struct option) *options)
|
||||
{
|
||||
struct option *opt;
|
||||
|
||||
@ -773,7 +773,8 @@ check_nonempty_tree(struct list_head *options)
|
||||
|
||||
void
|
||||
smart_config_string(struct string *str, int print_comment, int i18n,
|
||||
struct list_head *options, unsigned char *path, int depth,
|
||||
LIST_OF(struct option) *options,
|
||||
unsigned char *path, int depth,
|
||||
void (*fn)(struct string *, struct option *,
|
||||
unsigned char *, int, int, int, int))
|
||||
{
|
||||
@ -917,7 +918,7 @@ change_hook_ui(struct session *ses, struct option *current, struct option *chang
|
||||
/* Bit 2 of show means we should always set visibility, otherwise we set it
|
||||
* only on templates. */
|
||||
static void
|
||||
update_visibility(struct list_head *tree, int show)
|
||||
update_visibility(LIST_OF(struct option) *tree, int show)
|
||||
{
|
||||
struct option *opt;
|
||||
|
||||
|
@ -84,7 +84,7 @@ struct session; /* session/session.h */
|
||||
union option_value {
|
||||
/* XXX: Keep first to make @options_root initialization possible. */
|
||||
/* The OPT_TREE list_head is allocated. */
|
||||
struct list_head *tree;
|
||||
LIST_OF(struct option) *tree;
|
||||
|
||||
/* Used by OPT_BOOL, OPT_INT, OPT_CODEPAGE and OPT_LANGUAGE */
|
||||
int number;
|
||||
@ -142,7 +142,7 @@ struct option {
|
||||
};
|
||||
|
||||
#define INIT_OPTION(name, flags, type, min, max, value, desc, capt) \
|
||||
{ NULL_LIST_HEAD, INIT_OBJECT("option"), name, flags, type, min, max, { (struct list_head *) (value) }, desc, capt }
|
||||
{ NULL_LIST_HEAD, INIT_OBJECT("option"), name, flags, type, min, max, { (LIST_OF(struct option) *) (value) }, desc, capt }
|
||||
|
||||
extern struct option *config_options;
|
||||
extern struct option *cmdline_options;
|
||||
@ -160,12 +160,14 @@ struct change_hook_info {
|
||||
extern void register_change_hooks(const struct change_hook_info *change_hooks);
|
||||
|
||||
|
||||
extern struct list_head *init_options_tree(void);
|
||||
extern void unmark_options_tree(struct list_head *);
|
||||
void watermark_deleted_options(struct list_head *);
|
||||
extern LIST_OF(struct option) *init_options_tree(void);
|
||||
extern void unmark_options_tree(LIST_OF(struct option) *);
|
||||
void watermark_deleted_options(LIST_OF(struct option) *);
|
||||
|
||||
extern void smart_config_string(struct string *, int, int, struct list_head *, unsigned char *, int,
|
||||
void (*)(struct string *, struct option *, unsigned char *, int, int, int, int));
|
||||
extern void smart_config_string(struct string *, int, int,
|
||||
LIST_OF(struct option) *, unsigned char *, int,
|
||||
void (*)(struct string *, struct option *,
|
||||
unsigned char *, int, int, int, int));
|
||||
|
||||
extern struct option *copy_option(struct option *);
|
||||
extern void delete_option(struct option *);
|
||||
|
@ -368,8 +368,8 @@ color_wr(struct option *opt, struct string *str)
|
||||
static void
|
||||
tree_dup(struct option *opt, struct option *template)
|
||||
{
|
||||
struct list_head *new = init_options_tree();
|
||||
struct list_head *tree = template->value.tree;
|
||||
LIST_OF(struct option) *new = init_options_tree();
|
||||
LIST_OF(struct option) *tree = template->value.tree;
|
||||
struct option *option;
|
||||
|
||||
if (!new) return;
|
||||
|
@ -51,7 +51,7 @@
|
||||
|
||||
static int cookies_nosave = 0;
|
||||
|
||||
static INIT_LIST_HEAD(cookies);
|
||||
static INIT_LIST_OF(struct cookie, cookies);
|
||||
|
||||
struct c_domain {
|
||||
LIST_HEAD(struct c_domain);
|
||||
@ -64,11 +64,10 @@ struct c_domain {
|
||||
* struct c_domain. No other data structures have pointers to these
|
||||
* objects. Currently the domains remain in the list until
|
||||
* @done_cookies clears the whole list. */
|
||||
static INIT_LIST_HEAD(c_domains);
|
||||
static INIT_LIST_OF(struct c_domain, c_domains);
|
||||
|
||||
/* List of servers for which there are cookies. Each element is a
|
||||
* struct cookie_server. */
|
||||
static INIT_LIST_HEAD(cookie_servers);
|
||||
/* List of servers for which there are cookies. */
|
||||
static INIT_LIST_OF(struct cookie_server, cookie_servers);
|
||||
|
||||
/* Only @set_cookies_dirty may make this nonzero. */
|
||||
static int cookies_dirty = 0;
|
||||
@ -908,7 +907,7 @@ init_cookies(struct module *module)
|
||||
/* Like @delete_cookie, this function does not set @cookies_dirty.
|
||||
* The caller must do that if appropriate. */
|
||||
static void
|
||||
free_cookies_list(struct list_head *list)
|
||||
free_cookies_list(LIST_OF(struct cookie) *list)
|
||||
{
|
||||
while (!list_empty(*list)) {
|
||||
struct cookie *cookie = list->next;
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "util/string.h"
|
||||
|
||||
|
||||
INIT_LIST_HEAD(cookie_queries);
|
||||
INIT_LIST_OF(struct cookie, cookie_queries);
|
||||
|
||||
static void
|
||||
add_cookie_info_to_string(struct string *string, struct cookie *cookie,
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "terminal/terminal.h"
|
||||
#include "util/lists.h"
|
||||
|
||||
extern struct list_head cookie_queries;
|
||||
extern LIST_OF(struct cookie) cookie_queries;
|
||||
|
||||
void accept_cookie_dialog(struct session *ses, void *data);
|
||||
extern struct hierbox_browser cookie_browser;
|
||||
|
@ -812,7 +812,7 @@ enum frame_event_status
|
||||
pass_uri_to_command(struct session *ses, struct document_view *doc_view,
|
||||
int which_type)
|
||||
{
|
||||
struct list_head *tree = get_opt_tree("document.uri_passing");
|
||||
LIST_OF(struct option) *tree = get_opt_tree("document.uri_passing");
|
||||
enum pass_uri_type type = which_type;
|
||||
struct menu_item *items;
|
||||
struct option *option;
|
||||
@ -887,7 +887,7 @@ void
|
||||
add_uri_command_to_menu(struct menu_item **mi, enum pass_uri_type type,
|
||||
unsigned char *text)
|
||||
{
|
||||
struct list_head *tree = get_opt_tree("document.uri_passing");
|
||||
LIST_OF(struct option) *tree = get_opt_tree("document.uri_passing");
|
||||
struct option *option;
|
||||
int commands = 0;
|
||||
enum menu_item_flags flags = NO_FLAG;
|
||||
|
@ -1,4 +1,10 @@
|
||||
/* CSS style applier */
|
||||
/** CSS style applier
|
||||
* @file
|
||||
*
|
||||
* @todo TODO: A way to disable CSS completely, PLUS a way to stop
|
||||
* various property groups from taking effect. (Ie. way to turn out
|
||||
* effect of 'display: none' or aligning or colors but keeping all the
|
||||
* others.) --pasky */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@ -28,11 +34,6 @@
|
||||
#include "document/html/internal.h"
|
||||
|
||||
|
||||
/* TODO: A way to disable CSS completely, PLUS a way to stop various property
|
||||
* groups from taking effect. (Ie. way to turn out effect of 'display: none'
|
||||
* or aligning or colors but keeping all the others.) --pasky */
|
||||
|
||||
|
||||
typedef void (*css_applier_T)(struct html_context *html_context,
|
||||
struct html_element *element,
|
||||
struct css_property *prop);
|
||||
@ -89,8 +90,9 @@ css_apply_font_attribute(struct html_context *html_context,
|
||||
element->attr.style.attr &= ~prop->value.font_attribute.rem;
|
||||
}
|
||||
|
||||
/* FIXME: Because the current CSS doesn't provide reasonable defaults for each
|
||||
* HTML element this applier will cause bad rendering of <pre> tags. */
|
||||
/** @bug FIXME: Because the current CSS doesn't provide reasonable
|
||||
* defaults for each HTML element this applier will cause bad
|
||||
* rendering of @<pre> tags. */
|
||||
static void
|
||||
css_apply_text_align(struct html_context *html_context,
|
||||
struct html_element *element, struct css_property *prop)
|
||||
@ -99,8 +101,8 @@ css_apply_text_align(struct html_context *html_context,
|
||||
element->parattr.align = prop->value.text_align;
|
||||
}
|
||||
|
||||
/* XXX: Sort like the css_property_type */
|
||||
static css_applier_T css_appliers[CSS_PT_LAST] = {
|
||||
/*! XXX: Sort like the css_property_type */
|
||||
static const css_applier_T css_appliers[CSS_PT_LAST] = {
|
||||
/* CSS_PT_NONE */ NULL,
|
||||
/* CSS_PT_BACKGROUND */ css_apply_background_color,
|
||||
/* CSS_PT_BACKGROUND_COLOR */ css_apply_background_color,
|
||||
@ -113,11 +115,12 @@ static css_applier_T css_appliers[CSS_PT_LAST] = {
|
||||
/* CSS_PT_WHITE_SPACE */ css_apply_font_attribute,
|
||||
};
|
||||
|
||||
/* This looks for a match in list of selectors. */
|
||||
/** This looks for a match in list of selectors. */
|
||||
static void
|
||||
examine_element(struct html_context *html_context, struct css_selector *base,
|
||||
enum css_selector_type seltype, enum css_selector_relation rel,
|
||||
struct css_selector_set *selectors, struct html_element *element)
|
||||
struct css_selector_set *selectors,
|
||||
struct html_element *element)
|
||||
{
|
||||
struct css_selector *selector;
|
||||
|
||||
@ -142,7 +145,7 @@ examine_element(struct html_context *html_context, struct css_selector *base,
|
||||
merge_css_selectors(base, sel); \
|
||||
/* Ancestor matches? */ \
|
||||
if (sel->leaves.may_contain_rel_ancestor_or_parent \
|
||||
&& (struct list_head *) element->next \
|
||||
&& (LIST_OF(struct html_element) *) element->next \
|
||||
!= &html_context->stack) { \
|
||||
struct html_element *ancestor; \
|
||||
/* This is less effective than doing reverse iterations,
|
||||
@ -152,7 +155,7 @@ examine_element(struct html_context *html_context, struct css_selector *base,
|
||||
* have to duplicate the whole examine_element(), so if
|
||||
* profiles won't show it really costs... */ \
|
||||
for (ancestor = element->next; \
|
||||
(struct list_head *) ancestor \
|
||||
(LIST_OF(struct html_element) *) ancestor \
|
||||
!= &html_context->stack;\
|
||||
ancestor = ancestor->next) \
|
||||
examine_element(html_context, base, \
|
||||
@ -221,7 +224,7 @@ struct css_selector *
|
||||
get_css_selector_for_element(struct html_context *html_context,
|
||||
struct html_element *element,
|
||||
struct css_stylesheet *css,
|
||||
struct list_head *html_stack)
|
||||
LIST_OF(struct html_element) *html_stack)
|
||||
{
|
||||
unsigned char *code;
|
||||
struct css_selector *selector;
|
||||
@ -281,7 +284,7 @@ apply_css_selector_style(struct html_context *html_context,
|
||||
|
||||
void
|
||||
css_apply(struct html_context *html_context, struct html_element *element,
|
||||
struct css_stylesheet *css, struct list_head *html_stack)
|
||||
struct css_stylesheet *css, LIST_OF(struct html_element) *html_stack)
|
||||
{
|
||||
struct css_selector *selector;
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/*! @file
|
||||
* This is the main entry point for the CSS micro-engine. It throws
|
||||
* all the power of the stylesheets at a given element. */
|
||||
|
||||
#ifndef EL__DOCUMENT_CSS_APPLY_H
|
||||
#define EL__DOCUMENT_CSS_APPLY_H
|
||||
@ -8,28 +11,26 @@ struct css_stylesheet;
|
||||
struct html_context;
|
||||
struct html_element;
|
||||
|
||||
/* This is the main entry point for the CSS micro-engine. It throws all the
|
||||
* power of the stylesheets at a given element. */
|
||||
|
||||
/* Gather all style information for the given @element, so it can later be
|
||||
* applied. Returned value should be freed using done_css_selector(). */
|
||||
/** Gather all style information for the given @a element, so it can later be
|
||||
* applied. Returned value should be freed using done_css_selector(). */
|
||||
struct css_selector *
|
||||
get_css_selector_for_element(struct html_context *html_context,
|
||||
struct html_element *element,
|
||||
struct css_stylesheet *css,
|
||||
struct list_head *html_stack);
|
||||
LIST_OF(struct html_element) *html_stack);
|
||||
|
||||
|
||||
/* Apply properties from an existing selector. */
|
||||
/** Apply properties from an existing selector. */
|
||||
void
|
||||
apply_css_selector_style(struct html_context *html_context,
|
||||
struct html_element *element,
|
||||
struct css_selector *selector);
|
||||
|
||||
/* This function takes @element and applies its 'style' attribute onto its
|
||||
/** This function takes @a element and applies its 'style' attribute onto its
|
||||
* attributes (if it contains such an attribute). */
|
||||
void
|
||||
css_apply(struct html_context *html_context, struct html_element *element,
|
||||
struct css_stylesheet *css, struct list_head *html_stack);
|
||||
struct css_stylesheet *css,
|
||||
LIST_OF(struct html_element) *html_stack);
|
||||
|
||||
#endif
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* CSS module management */
|
||||
/** CSS module management
|
||||
* @file */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@ -124,7 +125,8 @@ static int
|
||||
change_hook_css(struct session *ses, struct option *current, struct option *changed)
|
||||
{
|
||||
if (!strcmp(changed->name, "stylesheet")) {
|
||||
/* TODO: We need to update all entries in format cache. --jonas */
|
||||
/** @todo TODO: We need to update all entries in
|
||||
* format cache. --jonas */
|
||||
import_default_css();
|
||||
}
|
||||
|
||||
|
@ -6,20 +6,21 @@ struct css_stylesheet;
|
||||
struct module;
|
||||
struct uri;
|
||||
|
||||
/* TODO: Basicly we need two default stylesheets. One that ELinks controls
|
||||
* (which is defined by the defaults of every property, they could however also
|
||||
* be loadable at startup time, e.g. when/if we will have a very generalised
|
||||
* renderer it would be possible to bypass the HTML renderer but would simply
|
||||
* use a HTML stylesheet like the one in CSS2 Appendix A. "A sample style sheet
|
||||
* for HTML 4.0") and one that the user controls. They should be remerged when
|
||||
* ever the user reloads the user stylesheet but else they should be pretty
|
||||
* static. Together they defines the basic layouting should be done when
|
||||
* rendering the document. */
|
||||
/** @todo TODO: Basicly we need two default stylesheets. One that
|
||||
* ELinks controls (which is defined by the defaults of every
|
||||
* property, they could however also be loadable at startup time,
|
||||
* e.g. when/if we will have a very generalised renderer it would be
|
||||
* possible to bypass the HTML renderer but would simply use a HTML
|
||||
* stylesheet like the one in CSS2 Appendix A. "A sample style sheet
|
||||
* for HTML 4.0") and one that the user controls. They should be
|
||||
* remerged when ever the user reloads the user stylesheet but else
|
||||
* they should be pretty static. Together they defines the basic
|
||||
* layouting should be done when rendering the document. */
|
||||
extern struct css_stylesheet default_stylesheet;
|
||||
|
||||
extern struct module css_module;
|
||||
|
||||
/* This function will try to import the given @url from the cache. */
|
||||
/** This function will try to import the given @a url from the cache. */
|
||||
void import_css(struct css_stylesheet *css, struct uri *uri);
|
||||
|
||||
#endif
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* CSS main parser */
|
||||
/** CSS main parser
|
||||
* @file */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@ -23,7 +24,8 @@
|
||||
|
||||
|
||||
void
|
||||
css_parse_properties(struct list_head *props, struct scanner *scanner)
|
||||
css_parse_properties(LIST_OF(struct css_property) *props,
|
||||
struct scanner *scanner)
|
||||
{
|
||||
assert(props && scanner);
|
||||
|
||||
@ -108,8 +110,11 @@ skip_css_block(struct scanner *scanner)
|
||||
}
|
||||
}
|
||||
|
||||
/* Atrules grammer:
|
||||
/** Parse an atrule from @a scanner and update @a css accordingly.
|
||||
*
|
||||
* Atrules grammar:
|
||||
*
|
||||
* @verbatim
|
||||
* media_types:
|
||||
* <empty>
|
||||
* | <ident>
|
||||
@ -122,6 +127,7 @@ skip_css_block(struct scanner *scanner)
|
||||
* | '@media' media_types '{' ruleset* '}'
|
||||
* | '@page' <ident>? [':' <ident>]? '{' properties '}'
|
||||
* | '@font-face' '{' properties '}'
|
||||
* @endverbatim
|
||||
*/
|
||||
static void
|
||||
css_parse_atrule(struct css_stylesheet *css, struct scanner *scanner,
|
||||
@ -184,18 +190,19 @@ struct selector_pkg {
|
||||
/** Move a CSS selector and its leaves into a new set. If a similar
|
||||
* selector already exists in the set, merge them.
|
||||
*
|
||||
* \param sels
|
||||
* The set to which \a selector should be moved. Must not be NULL.
|
||||
* \param selector
|
||||
* @param sels
|
||||
* The set to which @a selector should be moved. Must not be NULL.
|
||||
* @param selector
|
||||
* The selector that should be moved. Must not be NULL. If it is
|
||||
* already in some set, this function removes it from there.
|
||||
* \param watch
|
||||
* This function updates \a *watch if it merges that selector into
|
||||
* another one. \a watch must not be NULL but \a *watch may be.
|
||||
* @param watch
|
||||
* This function updates @a *watch if it merges that selector into
|
||||
* another one. @a watch must not be NULL but @a *watch may be.
|
||||
*
|
||||
* \return \a selector or the one into which it was merged. */
|
||||
* @returns @a selector or the one into which it was merged. */
|
||||
static struct css_selector *
|
||||
reparent_selector(struct css_selector_set *sels, struct css_selector *selector,
|
||||
reparent_selector(struct css_selector_set *sels,
|
||||
struct css_selector *selector,
|
||||
struct css_selector **watch)
|
||||
{
|
||||
struct css_selector *twin = find_css_selector(sels, selector->type,
|
||||
@ -222,16 +229,22 @@ reparent_selector(struct css_selector_set *sels, struct css_selector *selector,
|
||||
return twin ? twin : selector;
|
||||
}
|
||||
|
||||
/* Our selector grammar:
|
||||
/** Parse a comma-separated list of CSS selectors from @a scanner.
|
||||
* Register the selectors in @a css so that get_css_selector_for_element()
|
||||
* will find them, and add them to @a selectors so that the caller can
|
||||
* attach properties to them.
|
||||
*
|
||||
* Our selector grammar:
|
||||
*
|
||||
* @verbatim
|
||||
* selector:
|
||||
* element_name? ('#' id)? ('.' class)? (':' pseudo_class)? \
|
||||
* ((' ' | '>') selector)?
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
static void
|
||||
css_parse_selector(struct css_stylesheet *css, struct scanner *scanner,
|
||||
struct list_head *selectors)
|
||||
LIST_OF(struct selector_pkg) *selectors)
|
||||
{
|
||||
/* Shell for the last selector (the whole selector chain, that is). */
|
||||
struct selector_pkg *pkg = NULL;
|
||||
@ -464,16 +477,20 @@ css_parse_selector(struct css_stylesheet *css, struct scanner *scanner,
|
||||
}
|
||||
|
||||
|
||||
/* Ruleset grammar:
|
||||
/** Parse a ruleset from @a scanner to @a css.
|
||||
*
|
||||
* Ruleset grammar:
|
||||
*
|
||||
* @verbatim
|
||||
* ruleset:
|
||||
* selector [ ',' selector ]* '{' properties '}'
|
||||
* @endverbatim
|
||||
*/
|
||||
static void
|
||||
css_parse_ruleset(struct css_stylesheet *css, struct scanner *scanner)
|
||||
{
|
||||
INIT_LIST_HEAD(selectors);
|
||||
INIT_LIST_HEAD(properties);
|
||||
INIT_LIST_OF(struct selector_pkg, selectors);
|
||||
INIT_LIST_OF(struct css_property, properties);
|
||||
struct selector_pkg *pkg;
|
||||
|
||||
css_parse_selector(css, scanner, &selectors);
|
||||
|
@ -1,3 +1,6 @@
|
||||
/*! @file
|
||||
* This is interface |