1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-08-22 21:14:32 -04:00
Commit Graph

2873 Commits

Author SHA1 Message Date
Miciah Dashiel Butler Masters
91947860f2 Check session- and domain-specific settings for many options
Pass the session with some get_opt_* calls.  These are the low-hanging fruit.  Some places will be difficult because we don't have the session or for other reasons.
2007-08-30 21:11:51 +00:00
Miciah Dashiel Butler Masters
360b4ebfee textarea_edit: convert unnecessary checks to assertions
If @op == 0, then @fs_, @doc_view_, @link_, and @term_ should all be set.  Assert them instead of checking them with if statements.
2007-08-30 21:09:14 +00:00
Miciah Dashiel Butler Masters
06adbbc524 Add domain-specific options saving and look-up
Note that this is the infrastructure, but all relevant get_opt_* calls must be changed to pass the session so that the domain-specific options are looked up.

Add @want_domain parameter to parse_set_common and read in the domain-name if the flag is set.

Add parse_set_domain wrapper for parse_set_common.

Add "set_domain" configuration directive with the following syntax: set_domain domain option = value

Modify create_config_string and smart_config_output_fn to spit out domain-specific option trees.

Add @smart_config_output_fn_domain global variable to facilitate this.

Define structure domain_tree and define list @domain_trees.

Add routine get_domain_tree to find or, if necessary, create the shadow tree for the given domain name.

Add routine get_domain_option search for an option in all domain shadow-trees and return the option in the best matching domain tree.

Modify get_opt_ to use get_domain_option to check for domain-specific options.

Add clean-up routine done_domain_trees, called on exit, to free any domain trees.
2007-08-30 21:04:31 +00:00
Miciah Dashiel Butler Masters
5ada24f3ef update_cache_document_options: take @ses and pass it to get_opt calls
change_hook_active_link: pass update_cache_document_options @ses.

Now when changing the global settings, it will not simply copy the new values for the global settings to the document-options cache, but also check session-specific settings.  This doesn't really matter yet, since the options in question can't be set on a per-session basis, but is in preparation for future changes.
2007-08-30 19:19:57 +00:00
Jonas Fonseca
19f3fd686c Compile fix for commit e876df70d8 2007-08-29 20:51:43 +02:00
Miciah Dashiel Butler Masters
f5e6ed4dd7 Drop @options parameter from create_config_string and write_config_file
Hard-code it to config_options.
2007-08-29 13:43:15 +00:00
Miciah Dashiel Butler Masters
d1e16e1066 get_option_shadow: Set OPT_TOUCHED on the new option 2007-08-29 13:34:43 +00:00
Miciah Dashiel Butler Masters
9a5f76dbd5 Move is_in_domain from cookies/cookies.c to protocol/uri.c and export 2007-08-29 13:33:19 +00:00
Miciah Dashiel Butler Masters
7f042a49d7 Factor parse_set_common out of parse_set 2007-08-29 13:30:40 +00:00
Jonas Fonseca
8e954e9f61 rss: check for allocation failure of struct rss_renderer 2007-08-29 12:05:10 +02:00
Jonas Fonseca
6ebcce0655 rss: document the rss_renderer members 2007-08-29 12:02:36 +02:00
Jonas Fonseca
f2db9c07ed rss: remove the horrible text collection code which didn't do anything 2007-08-29 11:27:54 +02:00
Jonas Fonseca
86ffd94237 rss: simplify rendering to be done while parsing 2007-08-29 11:21:06 +02:00
Kalle Olavi Niemitalo
78f733c6c1 More doc comments about coordinates. 2007-08-29 09:57:18 +03:00
Jonas Fonseca
0a5ee2d3de rss: move the rendering code above the push/pop handlers 2007-08-29 02:29:58 +02:00
Jonas Fonseca
51fec0ec52 rss: rename rss_renderer variables from data to rss 2007-08-29 02:26:53 +02:00
Jonas Fonseca
16a4110467 rss: minor cleanups 2007-08-29 02:15:06 +02:00
Jonas Fonseca
19b271e417 rss: remove check for rss_renderer->text that is already done above 2007-08-29 02:13:26 +02:00
Jonas Fonseca
8c4191fe87 rss: assert that node->parent is always set 2007-08-29 02:13:10 +02:00
Jonas Fonseca
af4b7bed84 Use the new OBJS-unless$(CONFIG_FOO) instead of $(call not,...) 2007-08-29 01:57:01 +02:00
Petr Baudis
6b05ddb762 Remove unnecessary document/html/parser.h includes 2007-08-29 00:08:05 +02:00
Petr Baudis
d905fb803a Makefile.lib: Fix the $(OBJS) rule 2007-08-28 23:35:22 +02:00
Petr Baudis
e876df70d8 document/html: Make HTML parser state transparent
Before, *_html_parser_state() operated with struct html_element *. Now, it is
transparent for the renderer (just void *), so that DOM won't have to provide
this struct but will be able to use something internal.
2007-08-28 23:35:00 +02:00
Petr Baudis
14ae8ecc01 Makefile.lib: Add support for "unless" config-driven rules
Normally, you can add some objects or subdirs to the build if some
config variable is set to yes, by doing:

	SUBDIRS-$(CONFIG_FOO)

Now you can do it the other way too, including stuff if some
variable is set to no:

	SUBDIRS-unless$(CONFIG_FOO)

This will be used for switching between two HTML parser implementations.
2007-08-28 22:55:26 +02:00
Petr Baudis
e5539a9937 document/html: Move enum html_special_type from parser.h to renderer.h
...since it is renderer interface.
2007-08-28 22:19:33 +02:00
Petr Baudis
a74af825e2 document/dom/rss.c: Add extra styles
Style aux got split to styles author, author-date-sep and date.
2007-08-28 21:34:32 +02:00
Petr Baudis
b457af1984 document/dom/source.c: Trivial simplification 2007-08-28 21:31:49 +02:00
Petr Baudis
baeb0cb0d5 document/dom: Move stylesheet parsing out of style loop
...for better clarity of the document initialization functions.
2007-08-28 21:31:25 +02:00
Petr Baudis
a9619bce80 document/renderer.c: Fix description 2007-08-28 21:28:32 +02:00
Petr Baudis
dc0cf23631 document/dom: Simplify init_template_by_style() usage
It doesn't take the useless styling information but just uses options->default_style.
2007-08-28 21:28:03 +02:00
Petr Baudis
55495ab655 document: Turn options' default_fg, default_bg to default_style
...as struct text_style. This way it might be possible later to
add other default formatting attributes by CSS and it allows
quite a code simplification in the DOM renderer.
2007-08-28 21:16:44 +02:00
Petr Baudis
db9431465f document: Move text_style-related stuff to dedicated format.*
We will need to include it from options.h and the include chain just
wouldn't work. And it feels like a hack to have it in renderer.h anyway.
2007-08-28 21:05:00 +02:00
Petr Baudis
b66d2bec67 document: Unify text style -> screen attribute handling
Currently, all DOM, HTML and plain renderers had their own routine for
conversion from text style to screen attribute. This moves text_style and
text_style_format from html/parser.h to renderer.h and introduces new generic
routine get_screen_chracter_template() that is used by all the specific
rendering engines.
2007-08-28 21:02:08 +02:00
Jonas Fonseca
8376feb6b1 Fix protocol/test ignore rule for the uri-test program 2007-08-28 20:35:14 +02:00
Jonas Fonseca
bbd7c8354a Move get_test_opt to util/test.h and use throughout test programs 2007-08-28 20:34:17 +02:00
Petr Baudis
38ee8a137c document/dom/util.*: Make init_template() private 2007-08-28 20:32:15 +02:00
Jonas Fonseca
c6a223c8dd dom/test: properly test test option matches in get_test_opt 2007-08-28 20:22:29 +02:00
Petr Baudis
070d335796 document: struct format_attr -> struct text_style_format 2007-08-28 20:17:53 +02:00
Jonas Fonseca
5d88ea78f9 dom/test: rename get_opt to get_test_opt to avoid namespace problems 2007-08-28 20:16:27 +02:00
Petr Baudis
e133941206 document/html: struct text_attrib_style -> struct text_style 2007-08-28 20:15:30 +02:00
Jonas Fonseca
0f53941fef Introduce test library in util/test.h containing the die() function
Fix the die() function to exit with EXIT_FAILURE value as pointed
out by Kalle on elinks-dev in <87tzqkxhlp.fsf@Astalo.kon.iki.fi>.
2007-08-28 20:14:08 +02:00
Petr Baudis
46e44f9298 document/dom: Move renderer-specific data from the generic struct dom_renderer
This is hopefully the final step to have the specific renderers completely
separated and self-contained.
2007-08-28 19:58:08 +02:00
Miciah Dashiel Butler Masters
8a8be53452 parse_set and parse_unset: restore stomped char before returning
The parsing in parse_set and parse_unset saves, overwrites with a NUL, and restores a character in the string that is being parsed.  If there is a malloc failure between overwriting and restoring, the restore is not done.  This commit changes that behaviour to restore before returning.
2007-08-28 17:47:59 +00:00
Petr Baudis
91e512cca8 document/dom: Move URL regexp setup from general code to source renderer 2007-08-28 19:40:30 +02:00
Petr Baudis
afb9b6daa5 document/dom: Move styles initialization out of init_dom_renderer()
Now, CSS is initialized separately for each of the renderers, so that
also RSS doesn't just choose styles of random DOM node types.

init_template_by_style() is introduced as the common backend for
loading CSS properties.
2007-08-28 19:38:13 +02:00
Miciah Dashiel Butler Masters
fa12b10e26 Introduce session- (tab-)specific options
Introduce session-specific options for those options that have toggle-... actions.
2007-08-28 17:29:41 +00:00
Miciah Dashiel Butler Masters
fd22173b29 Introduce option tree shadowing
Introduce get_option_shadow.  This routine takes an option, the tree under which that option resides, and another tree.  It returns a corresponding option with parallel ancestry in the second tree, creating that option and ancestry if it does not already exist.

Add enum copy_option_flags.

Add the CO_NO_LISTBOX_ITEM flag, which is used to suppress listbox creation for shadowed trees.

Add the CO_SHALLOW flag, which is used to suppress the duplication of unwanted children for shadowed trees.

Add a flags parameter to copy_option and tree_dup (and out of necessity, struct option_type_info and str_dup).
2007-08-28 17:25:24 +00:00
Miciah Dashiel Butler Masters
ea372bd0cd get_opt_*: Add ses parameter
Add a session parameter to get_opt_ and its wrappers in preparation for session-specific and domain-specific options.
2007-08-28 17:24:59 +00:00
Petr Baudis
494e4a1019 document/dom/rss.c: Explain what normalizing is
As insighted by Jonas.
2007-08-28 18:12:41 +02:00
Petr Baudis
2480d1ae0a Merge branch 'master' of /srv/git/elinks 2007-08-28 17:43:14 +02:00