|
From: CVS C. to T. <the...@li...> - 2012-03-24 17:44:17
|
Revision: 690
http://themis.svn.sourceforge.net/themis/?rev=690&view=rev
Author: mark_hellegers
Date: 2012-03-24 17:44:10 +0000 (Sat, 24 Mar 2012)
Log Message:
-----------
Added white-space:pre support and enabled it for PRE elements.
I've seen some small bugs with it that I still need to look into, but overall it works quite well.
Modified Paths:
--------------
trunk/themis/modules/CSSParser/html4.css
trunk/themis/modules/CSSRenderer/BlockDisplayView.cpp
trunk/themis/modules/CSSRenderer/BlockDisplayView.hpp
trunk/themis/modules/CSSRenderer/CSSView.cpp
trunk/themis/modules/CSSRenderer/CSSView.hpp
trunk/themis/modules/CSSRenderer/InlineDisplayView.cpp
trunk/themis/modules/CSSRenderer/InlineDisplayView.hpp
trunk/themis/modules/CSSRenderer/NoneDisplayView.cpp
trunk/themis/modules/CSSRenderer/NoneDisplayView.hpp
trunk/themis/modules/CSSRenderer/TableCellDisplayView.cpp
trunk/themis/modules/CSSRenderer/TableCellDisplayView.hpp
trunk/themis/modules/CSSRenderer/TableDisplayView.cpp
trunk/themis/modules/CSSRenderer/TableDisplayView.hpp
trunk/themis/modules/CSSRenderer/TableFooterGroupDisplayView.cpp
trunk/themis/modules/CSSRenderer/TableFooterGroupDisplayView.hpp
trunk/themis/modules/CSSRenderer/TableGroupDisplayView.cpp
trunk/themis/modules/CSSRenderer/TableGroupDisplayView.hpp
trunk/themis/modules/CSSRenderer/TableHeaderGroupDisplayView.cpp
trunk/themis/modules/CSSRenderer/TableHeaderGroupDisplayView.hpp
trunk/themis/modules/CSSRenderer/TableRowDisplayView.cpp
trunk/themis/modules/CSSRenderer/TableRowDisplayView.hpp
trunk/themis/modules/CSSRenderer/TableRowGroupDisplayView.cpp
trunk/themis/modules/CSSRenderer/TableRowGroupDisplayView.hpp
trunk/themis/modules/CSSRenderer/TextBox.cpp
trunk/themis/modules/CSSRenderer/TextBox.hpp
Modified: trunk/themis/modules/CSSParser/html4.css
===================================================================
--- trunk/themis/modules/CSSParser/html4.css 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSParser/html4.css 2012-03-24 17:44:10 UTC (rev 690)
@@ -26,7 +26,8 @@
TT { display: inline;
font-family: monospace}
PRE { display: inline;
- font-family: monospace}
+ font-family: monospace;
+ white-space: pre}
SCRIPT { display: none }
NOSCRIPT { display: none }
STYLE { display: none }
Modified: trunk/themis/modules/CSSRenderer/BlockDisplayView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/BlockDisplayView.cpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/BlockDisplayView.cpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -47,7 +47,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont)
+ BFont * aFont,
+ WhiteSpaceType aWhiteSpace)
: CSSView(aBaseView,
aNode,
aStyleSheets,
@@ -56,7 +57,8 @@
aSiteId,
aUrlId,
aColor,
- aFont) {
+ aFont,
+ aWhiteSpace) {
mDisplay = true;
mBlock = true;
Modified: trunk/themis/modules/CSSRenderer/BlockDisplayView.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/BlockDisplayView.hpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/BlockDisplayView.hpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -79,7 +79,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont = NULL);
+ BFont * aFont = NULL,
+ WhiteSpaceType aWhiteSpace = NORMAL);
~BlockDisplayView();
virtual void Layout(BRect aRect,
BPoint aStartingPoint);
Modified: trunk/themis/modules/CSSRenderer/CSSView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/CSSView.cpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/CSSView.cpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -83,7 +83,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont)
+ BFont * aFont,
+ WhiteSpaceType aWhiteSpace)
: BHandler("CSSView") {
mBaseView = aBaseView;
@@ -105,6 +106,7 @@
mName = mNode->getNodeName();
mRequestedWidth = -1;
mRequestedHeight = -1;
+ mWhiteSpace = aWhiteSpace;
if (mNode->hasChildNodes()) {
TNodeListPtr children = mNode->getChildNodes();
@@ -155,15 +157,17 @@
}
// printf("Display property value: %s\n", valueString.c_str());
if (valueString == "inline") {
- childView = new InlineDisplayView(aBaseView,
- child,
- mStyleSheets,
- style,
- mRect,
- mSiteId,
- mUrlId,
- mColor,
- mFont);
+ childView = new InlineDisplayView(
+ aBaseView,
+ child,
+ mStyleSheets,
+ style,
+ mRect,
+ mSiteId,
+ mUrlId,
+ mColor,
+ mFont,
+ mWhiteSpace);
}
else if (valueString == "block") {
childView = new BlockDisplayView(
@@ -175,18 +179,21 @@
mSiteId,
mUrlId,
mColor,
- mFont);
+ mFont,
+ mWhiteSpace);
}
else if (valueString == "table") {
- childView = new TableDisplayView(aBaseView,
- child,
- mStyleSheets,
- style,
- mRect,
- mSiteId,
- mUrlId,
- mColor,
- mFont);
+ childView = new TableDisplayView(
+ aBaseView,
+ child,
+ mStyleSheets,
+ style,
+ mRect,
+ mSiteId,
+ mUrlId,
+ mColor,
+ mFont,
+ mWhiteSpace);
}
else if (valueString == "table-row-group") {
childView = new TableRowGroupDisplayView(
@@ -198,7 +205,8 @@
mSiteId,
mUrlId,
mColor,
- mFont);
+ mFont,
+ mWhiteSpace);
}
else if (valueString == "table-header-group") {
childView = new TableHeaderGroupDisplayView(
@@ -210,7 +218,8 @@
mSiteId,
mUrlId,
mColor,
- mFont);
+ mFont,
+ mWhiteSpace);
}
else if (valueString == "table-footer-group") {
childView = new TableFooterGroupDisplayView(
@@ -222,40 +231,47 @@
mSiteId,
mUrlId,
mColor,
- mFont);
+ mFont,
+ mWhiteSpace);
}
else if (valueString == "table-row") {
- childView = new TableRowDisplayView(aBaseView,
- child,
- mStyleSheets,
- style,
- mRect,
- mSiteId,
- mUrlId,
- mColor,
- mFont);
+ childView = new TableRowDisplayView(
+ aBaseView,
+ child,
+ mStyleSheets,
+ style,
+ mRect,
+ mSiteId,
+ mUrlId,
+ mColor,
+ mFont,
+ mWhiteSpace);
}
else if (valueString == "table-cell") {
- childView = new TableCellDisplayView(aBaseView,
- child,
- mStyleSheets,
- style,
- mRect,
- mSiteId,
- mUrlId,
- mColor,
- mFont);
+ childView = new TableCellDisplayView(
+ aBaseView,
+ child,
+ mStyleSheets,
+ style,
+ mRect,
+ mSiteId,
+ mUrlId,
+ mColor,
+ mFont,
+ mWhiteSpace);
}
else if (valueString == "none") {
- childView = new NoneDisplayView(aBaseView,
- child,
- mStyleSheets,
- style,
- mRect,
- mSiteId,
- mUrlId,
- mColor,
- mFont);
+ childView = new NoneDisplayView(
+ aBaseView,
+ child,
+ mStyleSheets,
+ style,
+ mRect,
+ mSiteId,
+ mUrlId,
+ mColor,
+ mFont,
+ mWhiteSpace);
}
else {
// The default is an inline element
@@ -268,7 +284,8 @@
mSiteId,
mUrlId,
mColor,
- mFont);
+ mFont,
+ mWhiteSpace);
}
}
else {
@@ -281,22 +298,25 @@
mSiteId,
mUrlId,
mColor,
- mFont);
+ mFont,
+ mWhiteSpace);
}
mChildren.push_back(childView);
}
else if (child->getNodeType() == TEXT_NODE) {
// Quick fix. Take a look at what would be elegant.
CSSStyleDeclarationPtr style;
- CSSView * childView = new CSSView(aBaseView,
- child,
- mStyleSheets,
- style,
- mRect,
- mSiteId,
- mUrlId,
- mColor,
- mFont);
+ CSSView * childView = new CSSView(
+ aBaseView,
+ child,
+ mStyleSheets,
+ style,
+ mRect,
+ mSiteId,
+ mUrlId,
+ mColor,
+ mFont,
+ mWhiteSpace);
mChildren.push_back(childView);
}
}
@@ -509,6 +529,15 @@
}
}
}
+ else if (propertyName == "white-space") {
+ CSSPrimitiveValuePtr primitiveValue = shared_static_cast<CSSPrimitiveValue>(value);
+ if (primitiveValue.get()) {
+ TDOMString valueString = primitiveValue->getStringValue();
+ if (valueString == "pre") {
+ mWhiteSpace = PRE;
+ }
+ }
+ }
}
}
}
@@ -552,11 +581,14 @@
unsigned int start = 0;
unsigned int end = 0;
box.getRange(start, end);
- BRect rect = box.getRect();
- //printf("Drawing string: %s for %u at %f and %f\n", (text.c_str()) + start, end - start + 1, rect.left, rect.top + mLineHeight - mBottomMargin);
- drawPoint.Set(rect.left, rect.top + mLineHeight - mBottomMargin);
- mBaseView->SetFont(mFont);
- mBaseView->DrawString((text.c_str()) + start, end - start + 1, drawPoint);
+ // Draw the string, but only when there is something to draw.
+ if (!box.emptyBox()) {
+ BRect rect = box.getRect();
+ //printf("Drawing string: %s for %u at %f and %f\n", (text.c_str()) + start, end - start + 1, rect.left, rect.top + mLineHeight - mBottomMargin);
+ drawPoint.Set(rect.left, rect.top + mLineHeight - mBottomMargin);
+ mBaseView->SetFont(mFont);
+ mBaseView->DrawString((text.c_str()) + start, end - start + 1, drawPoint);
+ }
}
}
else if (mListStyleType == "square") {
@@ -688,7 +720,7 @@
boxWidth += mSpaceWidth;
}
//printf("Linewidth: %f, boxwidth: %f, viewWidth: %f\n", lineWidth, boxWidth, viewWidth);
- if (lineWidth + boxWidth > viewWidth) {
+ if ((lineWidth + boxWidth > viewWidth) || mWhiteSpace == PRE) {
// TextBox doesn't fit on the current line.
// Store the current container rect if needed
if (containerRect.right != containerRect.left) {
@@ -840,42 +872,71 @@
void CSSView :: SplitText() {
- // Split the text into words
TDOMString text = mNode->getNodeValue();
const char * textPointer = text.c_str();
unsigned int length = text.size();
unsigned int start = 0;
unsigned int end = 0;
bool textFound = false;
- bool spaceFound = false;
char c = '\0';
float pixelWidth = 0;
- for (unsigned int i = 0; i < length; i++) {
- c = text[i];
- if ((isspace(c) || iscntrl(c))) {
- if (textFound) {
+
+ if (mWhiteSpace == PRE) {
+ // Only split the text at a linebreak
+ for (unsigned int i = 0; i < length; i++) {
+ c = text[i];
+ if (c == '\n') {
pixelWidth = mFont->StringWidth(textPointer + start, end - start + 1);
- TextBox box = TextBox(start, end, pixelWidth, spaceFound, true);
+ TextBox box = TextBox(start, end, pixelWidth, false, false, !textFound);
mTextBoxes.push_back(box);
textFound = false;
+ start = i;
}
- spaceFound = true;
- start = i;
- end = i;
+ else {
+ if (!textFound) {
+ start = i;
+ textFound = true;
+ }
+ end = i;
+ }
}
- else {
- if (!textFound) {
+
+ if (textFound) {
+ pixelWidth = mFont->StringWidth(textPointer + start, end - start + 1);
+ TextBox box = TextBox(start, end, pixelWidth, false, false);
+ mTextBoxes.push_back(box);
+ }
+ }
+ else {
+ // Split the text into words
+ bool spaceFound = false;
+ for (unsigned int i = 0; i < length; i++) {
+ c = text[i];
+ if ((isspace(c) || iscntrl(c))) {
+ if (textFound) {
+ pixelWidth = mFont->StringWidth(textPointer + start, end - start + 1);
+ TextBox box = TextBox(start, end, pixelWidth, spaceFound, true);
+ mTextBoxes.push_back(box);
+ textFound = false;
+ }
+ spaceFound = true;
start = i;
- textFound = true;
+ end = i;
}
- end = i;
+ else {
+ if (!textFound) {
+ start = i;
+ textFound = true;
+ }
+ end = i;
+ }
}
- }
- if (textFound) {
- pixelWidth = mFont->StringWidth(textPointer + start, end - start + 1);
- TextBox box = TextBox(start, end, pixelWidth, spaceFound);
- mTextBoxes.push_back(box);
+ if (textFound) {
+ pixelWidth = mFont->StringWidth(textPointer + start, end - start + 1);
+ TextBox box = TextBox(start, end, pixelWidth, spaceFound);
+ mTextBoxes.push_back(box);
+ }
}
}
Modified: trunk/themis/modules/CSSRenderer/CSSView.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/CSSView.hpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/CSSView.hpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -68,6 +68,13 @@
using std::vector;
using std::string;
+enum WhiteSpaceType {
+ NORMAL = 1,
+ PRE,
+ NOWRAP,
+ INHERIT
+};
+
class CSSView : public BHandler {
private:
@@ -87,6 +94,7 @@
string mBorderStyle;
int32 mSiteId;
int32 mUrlId;
+ WhiteSpaceType mWhiteSpace;
void RetrieveLink(bool aVisible = true);
@@ -118,7 +126,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont = NULL);
+ BFont * aFont = NULL,
+ WhiteSpaceType aWhiteSpace = NORMAL);
~CSSView();
virtual void MouseDown(BPoint aPoint);
void Draw();
Modified: trunk/themis/modules/CSSRenderer/InlineDisplayView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/InlineDisplayView.cpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/InlineDisplayView.cpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -47,7 +47,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont)
+ BFont * aFont,
+ WhiteSpaceType aWhiteSpace = NORMAL)
: CSSView(aBaseView,
aNode,
aStyleSheets,
@@ -56,7 +57,8 @@
aSiteId,
aUrlId,
aColor,
- aFont) {
+ aFont,
+ aWhiteSpace) {
mDisplay = true;
mBlock = false;
Modified: trunk/themis/modules/CSSRenderer/InlineDisplayView.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/InlineDisplayView.hpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/InlineDisplayView.hpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -79,7 +79,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont = NULL);
+ BFont * aFont = NULL,
+ WhiteSpaceType aWhiteSpace = NORMAL);
~InlineDisplayView();
virtual void Layout(BRect aRect,
BPoint aStartingPoint);
Modified: trunk/themis/modules/CSSRenderer/NoneDisplayView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/NoneDisplayView.cpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/NoneDisplayView.cpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -47,7 +47,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont)
+ BFont * aFont,
+ WhiteSpaceType aWhiteSpace)
: CSSView(aBaseView,
aNode,
aStyleSheets,
@@ -56,7 +57,8 @@
aSiteId,
aUrlId,
aColor,
- aFont) {
+ aFont,
+ aWhiteSpace) {
mDisplay = false;
mBlock = false;
Modified: trunk/themis/modules/CSSRenderer/NoneDisplayView.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/NoneDisplayView.hpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/NoneDisplayView.hpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -79,7 +79,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont = NULL);
+ BFont * aFont = NULL,
+ WhiteSpaceType aWhiteSpace = NORMAL);
~NoneDisplayView();
virtual void Layout(BRect aRect,
BPoint aStartingPoint);
Modified: trunk/themis/modules/CSSRenderer/TableCellDisplayView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableCellDisplayView.cpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableCellDisplayView.cpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -47,7 +47,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont)
+ BFont * aFont,
+ WhiteSpaceType aWhiteSpace)
: CSSView(aBaseView,
aNode,
aStyleSheets,
@@ -56,7 +57,8 @@
aSiteId,
aUrlId,
aColor,
- aFont) {
+ aFont,
+ aWhiteSpace) {
mDisplay = true;
mBlock = false;
Modified: trunk/themis/modules/CSSRenderer/TableCellDisplayView.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableCellDisplayView.hpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableCellDisplayView.hpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -79,7 +79,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont = NULL);
+ BFont * aFont = NULL,
+ WhiteSpaceType aWhiteSpace = NORMAL);
~TableCellDisplayView();
virtual void Layout(BRect aRect,
BPoint aStartingPoint);
Modified: trunk/themis/modules/CSSRenderer/TableDisplayView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableDisplayView.cpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableDisplayView.cpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -48,7 +48,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont)
+ BFont * aFont,
+ WhiteSpaceType aWhiteSpace)
: CSSView(aBaseView,
aNode,
aStyleSheets,
@@ -57,7 +58,8 @@
aSiteId,
aUrlId,
aColor,
- aFont) {
+ aFont,
+ aWhiteSpace) {
mDisplay = true;
mBlock = true;
Modified: trunk/themis/modules/CSSRenderer/TableDisplayView.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableDisplayView.hpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableDisplayView.hpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -84,7 +84,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont = NULL);
+ BFont * aFont = NULL,
+ WhiteSpaceType aWhiteSpace = NORMAL);
~TableDisplayView();
virtual void Layout(
BRect aRect,
Modified: trunk/themis/modules/CSSRenderer/TableFooterGroupDisplayView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableFooterGroupDisplayView.cpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableFooterGroupDisplayView.cpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -48,7 +48,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont)
+ BFont * aFont,
+ WhiteSpaceType aWhiteSpace)
: TableGroupDisplayView(
aBaseView,
aNode,
@@ -58,7 +59,8 @@
aSiteId,
aUrlId,
aColor,
- aFont) {
+ aFont,
+ aWhiteSpace) {
mDisplay = true;
mBlock = false;
Modified: trunk/themis/modules/CSSRenderer/TableFooterGroupDisplayView.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableFooterGroupDisplayView.hpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableFooterGroupDisplayView.hpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -80,7 +80,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont = NULL);
+ BFont * aFont = NULL,
+ WhiteSpaceType aWhiteSpace = NORMAL);
~TableFooterGroupDisplayView();
virtual void Layout(
BRect aRect,
Modified: trunk/themis/modules/CSSRenderer/TableGroupDisplayView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableGroupDisplayView.cpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableGroupDisplayView.cpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -48,7 +48,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont)
+ BFont * aFont,
+ WhiteSpaceType aWhiteSpace)
: CSSView(
aBaseView,
aNode,
@@ -58,7 +59,8 @@
aSiteId,
aUrlId,
aColor,
- aFont) {
+ aFont,
+ aWhiteSpace) {
mDisplay = true;
mBlock = false;
Modified: trunk/themis/modules/CSSRenderer/TableGroupDisplayView.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableGroupDisplayView.hpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableGroupDisplayView.hpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -83,7 +83,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont = NULL);
+ BFont * aFont = NULL,
+ WhiteSpaceType aWhiteSpace = NORMAL);
~TableGroupDisplayView();
virtual void Layout(
BRect aRect,
Modified: trunk/themis/modules/CSSRenderer/TableHeaderGroupDisplayView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableHeaderGroupDisplayView.cpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableHeaderGroupDisplayView.cpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -48,7 +48,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont)
+ BFont * aFont,
+ WhiteSpaceType aWhiteSpace)
: TableGroupDisplayView(
aBaseView,
aNode,
@@ -58,7 +59,8 @@
aSiteId,
aUrlId,
aColor,
- aFont) {
+ aFont,
+ aWhiteSpace) {
mDisplay = true;
mBlock = false;
Modified: trunk/themis/modules/CSSRenderer/TableHeaderGroupDisplayView.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableHeaderGroupDisplayView.hpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableHeaderGroupDisplayView.hpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -80,7 +80,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont = NULL);
+ BFont * aFont = NULL,
+ WhiteSpaceType aWhiteSpace = NORMAL);
~TableHeaderGroupDisplayView();
virtual void Layout(
BRect aRect,
Modified: trunk/themis/modules/CSSRenderer/TableRowDisplayView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableRowDisplayView.cpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableRowDisplayView.cpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -47,7 +47,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont)
+ BFont * aFont,
+ WhiteSpaceType aWhiteSpace = NORMAL)
: CSSView(aBaseView,
aNode,
aStyleSheets,
@@ -56,7 +57,8 @@
aSiteId,
aUrlId,
aColor,
- aFont) {
+ aFont,
+ aWhiteSpace) {
mDisplay = true;
mBlock = false;
Modified: trunk/themis/modules/CSSRenderer/TableRowDisplayView.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableRowDisplayView.hpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableRowDisplayView.hpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -79,7 +79,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont = NULL);
+ BFont * aFont = NULL,
+ WhiteSpaceType aWhiteSpace = NORMAL);
~TableRowDisplayView();
virtual void Layout(BRect aRect,
BPoint aStartingPoint);
Modified: trunk/themis/modules/CSSRenderer/TableRowGroupDisplayView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableRowGroupDisplayView.cpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableRowGroupDisplayView.cpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -48,7 +48,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont)
+ BFont * aFont,
+ WhiteSpaceType aWhiteSpace)
: TableGroupDisplayView(
aBaseView,
aNode,
@@ -58,7 +59,8 @@
aSiteId,
aUrlId,
aColor,
- aFont) {
+ aFont,
+ aWhiteSpace) {
mDisplay = true;
mBlock = false;
Modified: trunk/themis/modules/CSSRenderer/TableRowGroupDisplayView.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableRowGroupDisplayView.hpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TableRowGroupDisplayView.hpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -80,7 +80,8 @@
int32 aSiteId,
int32 aUrlId,
rgb_color aColor,
- BFont * aFont = NULL);
+ BFont * aFont = NULL,
+ WhiteSpaceType aWhiteSpace = NORMAL);
~TableRowGroupDisplayView();
virtual void Layout(
BRect aRect,
Modified: trunk/themis/modules/CSSRenderer/TextBox.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TextBox.cpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TextBox.cpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -51,13 +51,15 @@
unsigned int aEnd,
float aPixelWidth,
bool aStartWithSpace,
- bool aEndWithSpace) {
+ bool aEndWithSpace,
+ bool aEmptyBox) {
mStart = aStart;
mEnd = aEnd;
mPixelWidth = aPixelWidth;
mStartWithSpace = aStartWithSpace;
mEndWithSpace = aEndWithSpace;
+ mEmptyBox = aEmptyBox;
}
@@ -101,3 +103,9 @@
return mEndWithSpace;
}
+
+bool TextBox :: emptyBox() const {
+
+ return mEmptyBox;
+
+}
Modified: trunk/themis/modules/CSSRenderer/TextBox.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TextBox.hpp 2012-03-21 21:56:56 UTC (rev 689)
+++ trunk/themis/modules/CSSRenderer/TextBox.hpp 2012-03-24 17:44:10 UTC (rev 690)
@@ -51,6 +51,7 @@
float mPixelWidth;
bool mStartWithSpace;
bool mEndWithSpace;
+ bool mEmptyBox;
public:
TextBox(unsigned int aStart, unsigned int aEnd, BRect aRect);
@@ -58,7 +59,8 @@
unsigned int aEnd,
float aPixelWidth,
bool aStartWithSpace = false,
- bool aEndWithSpace = false);
+ bool aEndWithSpace = false,
+ bool aEmptyBox = false);
~TextBox();
void getRange(unsigned int & aStart, unsigned int & aEnd);
BRect getRect() const;
@@ -66,6 +68,7 @@
float getPixelWidth() const;
bool startsWithSpace() const;
bool endsWithSpace() const;
+ bool emptyBox() const;
};
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|