aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2012-11-14 14:04:25 +0100
committerSebastian Geerken <devnull@localhost>2012-11-14 14:04:25 +0100
commit53e9245bcbaea2b7b4485369aa2289f1d102f26c (patch)
tree686a6e3125fca5c7889d2010633d697704bf33c9 /src
parent7a991750e1f7bdfe6bd39f95343cc742d00c6596 (diff)
Cleaned up preferences.
Diffstat (limited to 'src')
-rw-r--r--src/dillo.cc3
-rw-r--r--src/form.cc2
-rw-r--r--src/html.cc9
-rw-r--r--src/plain.cc2
-rw-r--r--src/prefs.c1
-rw-r--r--src/prefs.h2
-rw-r--r--src/prefsparser.cc1
-rw-r--r--src/table.cc4
8 files changed, 13 insertions, 11 deletions
diff --git a/src/dillo.cc b/src/dillo.cc
index 173ac036..cb522b8a 100644
--- a/src/dillo.cc
+++ b/src/dillo.cc
@@ -50,6 +50,7 @@
#include "auth.h"
#include "dw/fltkcore.hh"
+#include "dw/textblock.hh"
/*
* Command line options structure
@@ -359,6 +360,8 @@ int main(int argc, char **argv)
a_Cookies_init();
a_Auth_init();
+ dw::Textblock::init (prefs.penalty_hyphen, prefs.penalty_hyphen_2);
+
/* command line options override preferences */
if (options_got & DILLO_CLI_FULLWINDOW)
prefs.fullwindow_start = TRUE;
diff --git a/src/form.cc b/src/form.cc
index 90dc6d50..099f1a48 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -871,7 +871,7 @@ void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize)
/* We used to have Textblock (prefs.limit_text_width, ...) here,
* but it caused 100% CPU usage.
*/
- page = new Textblock (false, prefs.penalty_hyphen);
+ page = new Textblock (false);
page->setStyle (html->styleEngine->backgroundStyle ());
ResourceFactory *factory = HT2LT(html)->getResourceFactory();
diff --git a/src/html.cc b/src/html.cc
index ad4eae21..7ba1a69e 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -352,8 +352,7 @@ bool a_Html_tag_set_valign_attr(DilloHtml *html, const char *tag, int tagsize)
*/
static void Html_add_textblock(DilloHtml *html, int space)
{
- Textblock *textblock =
- new Textblock (prefs.limit_text_width, prefs.penalty_hyphen);
+ Textblock *textblock = new Textblock (prefs.limit_text_width);
HT2TB(html)->addParbreak (space, html->styleEngine->wordStyle ());
HT2TB(html)->addWidget (textblock, html->styleEngine->style ());
@@ -459,8 +458,7 @@ void DilloHtml::initDw()
dReturn_if_fail (dw == NULL);
/* Create the main widget */
- dw = stack->getRef(0)->textblock =
- new Textblock (prefs.limit_text_width, prefs.penalty_hyphen);
+ dw = stack->getRef(0)->textblock = new Textblock (prefs.limit_text_width);
bw->num_page_bugs = 0;
dStr_truncate(bw->page_bugs, 0);
@@ -3521,8 +3519,7 @@ static void Html_display_listitem(DilloHtml *html)
HT2TB(html)->addParbreak (0, wordStyle);
- list_item = new ListItem ((ListItem*)*ref_list_item,prefs.limit_text_width,
- prefs.penalty_hyphen);
+ list_item = new ListItem ((ListItem*)*ref_list_item,prefs.limit_text_width);
HT2TB(html)->addWidget (list_item, style);
HT2TB(html)->addParbreak (0, wordStyle);
*ref_list_item = list_item;
diff --git a/src/plain.cc b/src/plain.cc
index b29bf226..4da618e4 100644
--- a/src/plain.cc
+++ b/src/plain.cc
@@ -90,7 +90,7 @@ DilloPlain::DilloPlain(BrowserWindow *p_bw)
/* Init internal variables */
bw = p_bw;
- dw = new Textblock (prefs.limit_text_width, prefs.penalty_hyphen);
+ dw = new Textblock (prefs.limit_text_width);
Start_Ofs = 0;
state = ST_SeekingEol;
diff --git a/src/prefs.c b/src/prefs.c
index 09e48862..da597607 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -103,6 +103,7 @@ void a_Prefs_init(void)
prefs.w3c_plus_heuristics = TRUE;
prefs.penalty_hyphen = 100;
+ prefs.penalty_hyphen_2 = 100;
}
/*
diff --git a/src/prefs.h b/src/prefs.h
index 7392d74e..7cb4f113 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -89,7 +89,7 @@ struct _DilloPrefs {
bool_t show_msg;
bool_t show_extra_warnings;
bool_t middle_click_drags_page;
- int penalty_hyphen;
+ int penalty_hyphen, penalty_hyphen_2;
};
/* Global Data */
diff --git a/src/prefsparser.cc b/src/prefsparser.cc
index d555a55f..ceba7dd7 100644
--- a/src/prefsparser.cc
+++ b/src/prefsparser.cc
@@ -112,6 +112,7 @@ int PrefsParser::parseOption(char *name, char *value)
{ "theme", &prefs.theme, PREFS_STRING },
{ "w3c_plus_heuristics", &prefs.w3c_plus_heuristics, PREFS_BOOL },
{ "penalty_hyphen", &prefs.penalty_hyphen, PREFS_FRACTION_100 },
+ { "penalty_hyphen_2", &prefs.penalty_hyphen_2, PREFS_FRACTION_100 }
};
node = NULL;
diff --git a/src/table.cc b/src/table.cc
index 3487bab3..98157e76 100644
--- a/src/table.cc
+++ b/src/table.cc
@@ -421,9 +421,9 @@ static void Html_tag_content_table_cell(DilloHtml *html,
== TEXT_ALIGN_STRING)
col_tb = new dw::TableCell (
((dw::Table*)S_TOP(html)->table)->getCellRef (),
- prefs.limit_text_width, prefs.penalty_hyphen);
+ prefs.limit_text_width);
else
- col_tb = new Textblock (prefs.limit_text_width, prefs.penalty_hyphen);
+ col_tb = new Textblock (prefs.limit_text_width);
if (html->styleEngine->style()->borderCollapse == BORDER_MODEL_COLLAPSE){
Html_set_collapsing_border_model(html, col_tb);