Sebastian Geerken
2012-11-15 12:42:29 UTC
Hi!
I'm just working on making some values related to hyphenation
configurable via dillorc. A long time ago (before the Fltk port), Dw
directy accessed the prefs module for the value limit_text_width. When
Dw was ported to Fltk (which was largely a rewrite), it was seperated,
so it does not depend on prefs anymore. However, this made it
necessary to pass the value of prefs.limit_text_width to dw::Textblock
in the constructor.
Now, I do not want to extend dw::Textblock::Textblock() by a couple of
new parameters. Instead, I though of storing the values directly in Dw
(initialized by feasable standard values), and the prefs parser must
store them there. This way, Dw is still independent. This could be
adapted in other modules.
Currenty, my code is this:
1. The new values are still stored in DilloPrefs.
2. There is a static method dw::Textblock::init, which called in main,
after the prefs parser:
@@ -50,6 +50,7 @@
#include "auth.h"
#include "dw/fltkcore.hh"
+#include "dw/textblock.hh"
/*
* Command line options structure
@@ -359,6 +360,8 @@
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;
Any thoughts/comments?
Sebastian
I'm just working on making some values related to hyphenation
configurable via dillorc. A long time ago (before the Fltk port), Dw
directy accessed the prefs module for the value limit_text_width. When
Dw was ported to Fltk (which was largely a rewrite), it was seperated,
so it does not depend on prefs anymore. However, this made it
necessary to pass the value of prefs.limit_text_width to dw::Textblock
in the constructor.
Now, I do not want to extend dw::Textblock::Textblock() by a couple of
new parameters. Instead, I though of storing the values directly in Dw
(initialized by feasable standard values), and the prefs parser must
store them there. This way, Dw is still independent. This could be
adapted in other modules.
Currenty, my code is this:
1. The new values are still stored in DilloPrefs.
2. There is a static method dw::Textblock::init, which called in main,
after the prefs parser:
@@ -50,6 +50,7 @@
#include "auth.h"
#include "dw/fltkcore.hh"
+#include "dw/textblock.hh"
/*
* Command line options structure
@@ -359,6 +360,8 @@
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;
Any thoughts/comments?
Sebastian