ELinks 0.18.0
|
CSS stylesheet handling. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "elinks.h"
#include "document/css/property.h"
#include "document/css/stylesheet.h"
#include "util/error.h"
#include "util/lists.h"
#include "util/memory.h"
#include "util/string.h"
Functions | |
struct css_selector * | find_css_selector (struct css_selector_set *sels, css_selector_type_T type, enum css_selector_relation rel, const char *name, int namelen) |
Looks up the selector of the name name and length namelen in the given set of selectors. | |
struct css_selector * | init_css_selector (struct css_selector_set *sels, css_selector_type_T type, enum css_selector_relation relation, const char *name, int namelen) |
Initialize the selector structure. | |
void | set_css_selector_relation (struct css_selector *selector, enum css_selector_relation relation) |
Use this function instead of modifying css_selector.relation directly. | |
struct css_selector * | get_css_selector (struct css_selector_set *sels, css_selector_type_T type, enum css_selector_relation rel, const char *name, int namelen) |
Returns a new freshly made selector adding it to the given selector set, or NULL. | |
static struct css_selector * | copy_css_selector (struct css_stylesheet *css, struct css_selector *orig) |
static void | add_selector_property (struct css_selector *selector, struct css_property *prop) |
void | add_selector_properties (struct css_selector *selector, struct css_property list *properties) |
Add all properties from the list to the given selector. | |
static struct css_selector * | clone_css_selector (struct css_stylesheet *css, struct css_selector *orig) |
void | merge_css_selectors (struct css_selector *sel1, struct css_selector *sel2) |
Join sel2 to sel1, sel1 taking precedence in all conflicts. | |
void | done_css_selector (struct css_selector *selector) |
Destroy a selector. | |
void | init_css_selector_set (struct css_selector_set *set) |
void | done_css_selector_set (struct css_selector_set *set) |
void | add_css_selector_to_set (struct css_selector *selector, struct css_selector_set *set) |
void | del_css_selector_from_set (struct css_selector *selector) |
void | mirror_css_stylesheet (struct css_stylesheet *css1, struct css_stylesheet *css2) |
Mirror given CSS stylesheet css1 to an identical copy of itself (including all the selectors), css2. | |
void | done_css_stylesheet (struct css_stylesheet *css) |
Releases all the content of the stylesheet (but not the stylesheet itself). |
CSS stylesheet handling.
void add_css_selector_to_set | ( | struct css_selector * | selector, |
struct css_selector_set * | set ) |
void add_selector_properties | ( | struct css_selector * | selector, |
struct css_property list * | properties ) |
Add all properties from the list to the given selector.
|
static |
|
static |
|
static |
void del_css_selector_from_set | ( | struct css_selector * | selector | ) |
void done_css_selector | ( | struct css_selector * | selector | ) |
Destroy a selector.
done_css_stylesheet() normally does that for you.
void done_css_selector_set | ( | struct css_selector_set * | set | ) |
void done_css_stylesheet | ( | struct css_stylesheet * | css | ) |
Releases all the content of the stylesheet (but not the stylesheet itself).
struct css_selector * find_css_selector | ( | struct css_selector_set * | sels, |
css_selector_type_T | type, | ||
enum css_selector_relation | rel, | ||
const char * | name, | ||
int | namelen ) |
Looks up the selector of the name name and length namelen in the given set of selectors.
struct css_selector * get_css_selector | ( | struct css_selector_set * | sels, |
css_selector_type_T | type, | ||
enum css_selector_relation | rel, | ||
const char * | name, | ||
int | namelen ) |
Returns a new freshly made selector adding it to the given selector set, or NULL.
struct css_selector * init_css_selector | ( | struct css_selector_set * | set, |
css_selector_type_T | type, | ||
enum css_selector_relation | relation, | ||
const char * | name, | ||
int | namelen ) |
Initialize the selector structure.
This is a rather low-level function from your POV.
void init_css_selector_set | ( | struct css_selector_set * | set | ) |
void merge_css_selectors | ( | struct css_selector * | sel1, |
struct css_selector * | sel2 ) |
Join sel2 to sel1, sel1 taking precedence in all conflicts.
void mirror_css_stylesheet | ( | struct css_stylesheet * | css1, |
struct css_stylesheet * | css2 ) |
Mirror given CSS stylesheet css1 to an identical copy of itself (including all the selectors), css2.
void set_css_selector_relation | ( | struct css_selector * | selector, |
enum css_selector_relation | relation ) |
Use this function instead of modifying css_selector.relation directly.