summaryrefslogtreecommitdiff
path: root/src/gui/widgets/browserbox.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2010-01-11 18:52:23 +0200
committerJared Adams <jaxad0127@gmail.com>2010-01-12 16:22:52 +0000
commit087babc2525ddb89e5b31f240a08739d9a3029a9 (patch)
treebc7f22a62869b323328b6d03a3efa7b082f331d3 /src/gui/widgets/browserbox.h
parentb09ede7286093519af8f2b044ad7be17600d2cda (diff)
downloadmana-087babc2525ddb89e5b31f240a08739d9a3029a9.tar.gz
mana-087babc2525ddb89e5b31f240a08739d9a3029a9.tar.bz2
mana-087babc2525ddb89e5b31f240a08739d9a3029a9.tar.xz
mana-087babc2525ddb89e5b31f240a08739d9a3029a9.zip
Improve chat speed.
For improve chat speed this patch add some hacks to BrowserBox class, split big words in ChatTab. Also fix DoS in chat.
Diffstat (limited to 'src/gui/widgets/browserbox.h')
-rw-r--r--src/gui/widgets/browserbox.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h
index c5ca351d..2823d308 100644
--- a/src/gui/widgets/browserbox.h
+++ b/src/gui/widgets/browserbox.h
@@ -40,7 +40,8 @@ struct BROWSER_LINK {
* A simple browser box able to handle links and forward events to the
* parent conteiner.
*/
-class BrowserBox : public gcn::Widget, public gcn::MouseListener
+class BrowserBox : public gcn::Widget,
+ public gcn::MouseListener
{
public:
/**
@@ -88,6 +89,10 @@ class BrowserBox : public gcn::Widget, public gcn::MouseListener
*/
void clearRows();
+// void setSize(int width, int height);
+
+// void widgetResized(const gcn::Event &event);
+
/**
* Handles mouse actions.
*/
@@ -99,6 +104,10 @@ class BrowserBox : public gcn::Widget, public gcn::MouseListener
*/
void draw(gcn::Graphics *graphics);
+ void updateHeight();
+
+// void widgetResized(const gcn::Event &event);
+
/**
* BrowserBox modes.
*/
@@ -139,10 +148,16 @@ class BrowserBox : public gcn::Widget, public gcn::MouseListener
};
private:
+ int calcHeight();
+
typedef std::list<std::string> TextRows;
typedef TextRows::iterator TextRowIterator;
TextRows mTextRows;
+ typedef std::list<int> TextRowsHeights;
+ typedef TextRowsHeights::iterator TextRowsHeightIterator;
+ TextRowsHeights mTextRowsHeights;
+
typedef std::vector<BROWSER_LINK> Links;
typedef Links::iterator LinkIterator;
Links mLinks;
@@ -154,6 +169,9 @@ class BrowserBox : public gcn::Widget, public gcn::MouseListener
bool mUseLinksAndUserColors;
int mSelectedLink;
unsigned int mMaxRows;
+ int mHeight;
+ int mWidth;
+ int mYStart;
};
#endif