aboutsummaryrefslogtreecommitdiff
path: root/dw/textblock.hh
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2012-11-08 14:54:19 +0100
committerSebastian Geerken <devnull@localhost>2012-11-08 14:54:19 +0100
commit9c77c6d76e25394517d371e070d13b54ab7858d8 (patch)
tree6dfe12eb0f5722e5f5c424f1ed0396b516ce4de1 /dw/textblock.hh
parent2f9834507ff751f177c6fa218cc5849107a61aa8 (diff)
Making hyphen penalties configurable.
Diffstat (limited to 'dw/textblock.hh')
-rw-r--r--dw/textblock.hh19
1 files changed, 9 insertions, 10 deletions
diff --git a/dw/textblock.hh b/dw/textblock.hh
index 42286134..7c4f8820 100644
--- a/dw/textblock.hh
+++ b/dw/textblock.hh
@@ -212,15 +212,6 @@ private:
};
protected:
- enum {
- /**
- * The penalty for hyphens, multiplied by 100. So, 100 means
- * 1.0. See dw::Textblock::BadnessAndPenalty::setPenalty for
- * more details.
- */
- HYPHEN_BREAK = 100
- };
-
struct Line
{
int firstWord; /* first word's index in word vector */
@@ -363,6 +354,14 @@ protected:
bool mustQueueResize;
+ /**
+ * The penalty for hyphens, multiplied by 100. So, 100 means
+ * 1.0. INT_MAX and INT_MIN are also allowed. See
+ * dw::Textblock::BadnessAndPenalty::setPenalty for more
+ * details. Set from preferences.
+ */
+ int penaltyHyphen;
+
bool limitTextWidth; /* from preferences */
int redrawY;
@@ -527,7 +526,7 @@ protected:
public:
static int CLASS_ID;
- Textblock(bool limitTextWidth);
+ Textblock(bool limitTextWidth, int penaltyHyphen);
~Textblock();
core::Iterator *iterator (core::Content::Type mask, bool atEnd);