summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/browserbox.cpp6
-rw-r--r--src/gui/color.cpp22
-rw-r--r--src/gui/color.h8
-rw-r--r--src/gui/listbox.cpp6
-rw-r--r--src/gui/setup.cpp2
-rw-r--r--src/gui/setup_colors.cpp42
-rw-r--r--src/gui/setup_colors.h8
-rw-r--r--src/gui/shoplistbox.cpp6
-rw-r--r--src/gui/table.cpp12
-rw-r--r--src/gui/widgets/dropdown.cpp2
10 files changed, 57 insertions, 57 deletions
diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp
index 32f0d1a2..48b1cda4 100644
--- a/src/gui/browserbox.cpp
+++ b/src/gui/browserbox.cpp
@@ -254,7 +254,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
bool valid;
if ((mHighMode & BACKGROUND))
{
- graphics->setColor(gcn::Color(textcolor->getColor('H', valid)));
+ graphics->setColor(gcn::Color(textColor->getColor('H', valid)));
graphics->fillRectangle(gcn::Rectangle(
mLinks[mSelectedLink].x1,
mLinks[mSelectedLink].y1,
@@ -265,7 +265,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
if ((mHighMode & UNDERLINE))
{
- graphics->setColor(gcn::Color(textcolor->getColor('<', valid)));
+ graphics->setColor(gcn::Color(textColor->getColor('<', valid)));
graphics->drawLine(
mLinks[mSelectedLink].x1,
mLinks[mSelectedLink].y2,
@@ -331,7 +331,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
else
{
bool valid;
- int rgb = textcolor->getColor(c, valid);
+ int rgb = textColor->getColor(c, valid);
if (c == '<')
{
const int size = mLinks[link].x2 - mLinks[link].x1;
diff --git a/src/gui/color.cpp b/src/gui/color.cpp
index 9c6a0cb0..e37affda 100644
--- a/src/gui/color.cpp
+++ b/src/gui/color.cpp
@@ -26,7 +26,7 @@
#include "../utils/gettext.h"
#include "../utils/tostring.h"
-color::color()
+Color::Color()
{
addColor('C', 0x000000, _("Chat"));
addColor('G', 0xff0000, _("GM"));
@@ -41,7 +41,7 @@ color::color()
commit();
}
-color::~color()
+Color::~Color()
{
for (ColVector::iterator col = mColVector.begin(),
colEnd = mColVector.end();
@@ -52,7 +52,7 @@ color::~color()
}
}
-void color::setColor(const char c, const int rgb)
+void Color::setColor(const char c, const int rgb)
{
for (ColVector::iterator col = mColVector.begin(),
colEnd = mColVector.end();
@@ -67,7 +67,7 @@ void color::setColor(const char c, const int rgb)
}
}
-int color::getColor(const char c, bool &valid) const
+int Color::getColor(const char c, bool &valid) const
{
for (ColVector::const_iterator col = mColVector.begin(),
colEnd = mColVector.end();
@@ -84,7 +84,7 @@ int color::getColor(const char c, bool &valid) const
return 0x000000;
}
-std::string color::getElementAt(int i)
+std::string Color::getElementAt(int i)
{
if (i < 0 || i >= getNumberOfElements())
{
@@ -93,7 +93,7 @@ std::string color::getElementAt(int i)
return mColVector[i].text;
}
-char color::getColorCharAt(int i)
+char Color::getColorCharAt(int i)
{
if (i < 0 || i >= getNumberOfElements())
{
@@ -102,13 +102,13 @@ char color::getColorCharAt(int i)
return mColVector[i].ch;
}
-void color::addColor(const char c, const int rgb, const std::string &text)
+void Color::addColor(const char c, const int rgb, const std::string &text)
{
int trueRgb = config.getValue("color" + text, rgb);
mColVector.push_back(colorElem(c, trueRgb, text));
}
-int color::getColorAt(int i)
+int Color::getColorAt(int i)
{
if (i < 0 || i >= getNumberOfElements())
{
@@ -117,7 +117,7 @@ int color::getColorAt(int i)
return mColVector[i].rgb;
}
-void color::setColorAt(int i, int rgb)
+void Color::setColorAt(int i, int rgb)
{
if (i >= 0 && i < getNumberOfElements())
{
@@ -125,7 +125,7 @@ void color::setColorAt(int i, int rgb)
}
}
-void color::commit()
+void Color::commit()
{
for (ColVector::iterator i = mColVector.begin(), iEnd = mColVector.end();
i != iEnd;
@@ -135,7 +135,7 @@ void color::commit()
}
}
-void color::rollback()
+void Color::rollback()
{
for (ColVector::iterator i = mColVector.begin(), iEnd = mColVector.end();
i != iEnd;
diff --git a/src/gui/color.h b/src/gui/color.h
index a4ba752a..509448e7 100644
--- a/src/gui/color.h
+++ b/src/gui/color.h
@@ -27,18 +27,18 @@
#include <guichan/listmodel.hpp>
-class color : public gcn::ListModel
+class Color : public gcn::ListModel
{
public:
/**
* Constructor
*/
- color();
+ Color();
/**
* Destructor
*/
- ~color();
+ ~Color();
/**
* Define the color replacement for a character
@@ -131,6 +131,6 @@ class color : public gcn::ListModel
void addColor(const char c, const int rgb, const std::string &text);
};
-extern color *textcolor;
+extern Color *textColor;
#endif
diff --git a/src/gui/listbox.cpp b/src/gui/listbox.cpp
index 6edaba7d..63e55e24 100644
--- a/src/gui/listbox.cpp
+++ b/src/gui/listbox.cpp
@@ -44,9 +44,9 @@ void ListBox::draw(gcn::Graphics *graphics)
mAlpha = config.getValue("guialpha", 0.8);
bool valid;
- const int red = (textcolor->getColor('H', valid) >> 16) & 0xFF;
- const int green = (textcolor->getColor('H', valid) >> 8) & 0xFF;
- const int blue = textcolor->getColor('H', valid) & 0xFF;
+ const int red = (textColor->getColor('H', valid) >> 16) & 0xFF;
+ const int green = (textColor->getColor('H', valid) >> 8) & 0xFF;
+ const int blue = textColor->getColor('H', valid) & 0xFF;
const int alpha = mAlpha * 255;
graphics->setColor(gcn::Color(red, green, blue, alpha));
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index fa4e1a0a..09eaeff0 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -90,7 +90,7 @@ Setup::Setup():
panel->addTab(_("Keyboard"), tab);
mTabs.push_back(tab);
- tab = new Setup_colors();
+ tab = new Setup_Colors();
panel->addTab(_("Colors"), tab);
mTabs.push_back(tab);
diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp
index 8fe90790..269f8fd1 100644
--- a/src/gui/setup_colors.cpp
+++ b/src/gui/setup_colors.cpp
@@ -42,12 +42,12 @@
#include "../utils/gettext.h"
#include "../utils/tostring.h"
-Setup_colors::Setup_colors() :
+Setup_Colors::Setup_Colors() :
mSelected(-1)
{
setOpaque(false);
- mcolorBox = new ListBox(textcolor);
+ mcolorBox = new ListBox(textColor);
mcolorBox->setActionEventId("color_box");
mcolorBox->addActionListener(this);
@@ -129,7 +129,7 @@ Setup_colors::Setup_colors() :
setDimension(gcn::Rectangle(0, 0, 290, 250));
}
-Setup_colors::~Setup_colors()
+Setup_Colors::~Setup_Colors()
{
delete mRedLabel;
delete mRedSlider;
@@ -146,13 +146,13 @@ Setup_colors::~Setup_colors()
delete mScroll;
}
-void Setup_colors::action(const gcn::ActionEvent &event)
+void Setup_Colors::action(const gcn::ActionEvent &event)
{
if (event.getId() == "color_box")
{
mSelected = mcolorBox->getSelected();
- int col = textcolor->getColorAt(mSelected);
- char ch = textcolor->getColorCharAt(mSelected);
+ int col = textColor->getColorAt(mSelected);
+ char ch = textColor->getColorCharAt(mSelected);
std::string msg;
if (ch == '<')
@@ -173,26 +173,26 @@ void Setup_colors::action(const gcn::ActionEvent &event)
if (event.getId() == "slider_red")
{
mRedText->setText(toString(std::floor(mRedSlider->getValue())));
- updatecolor();
+ updateColor();
return;
}
if (event.getId() == "slider_green")
{
mGreenText->setText(toString(std::floor(mGreenSlider->getValue())));
- updatecolor();
+ updateColor();
return;
}
if (event.getId() == "slider_blue")
{
mBlueText->setText(toString(std::floor(mBlueSlider->getValue())));
- updatecolor();
+ updateColor();
return;
}
}
-void Setup_colors::setEntry(gcn::Slider *s, TextField *t, int value)
+void Setup_Colors::setEntry(gcn::Slider *s, TextField *t, int value)
{
s->setValue(value);
char buffer[100];
@@ -200,43 +200,43 @@ void Setup_colors::setEntry(gcn::Slider *s, TextField *t, int value)
t->setText(buffer);
}
-void Setup_colors::apply()
+void Setup_Colors::apply()
{
- textcolor->commit();
+ textColor->commit();
}
-void Setup_colors::cancel()
+void Setup_Colors::cancel()
{
- textcolor->rollback();
- int col = textcolor->getColorAt(mSelected);
+ textColor->rollback();
+ int col = textColor->getColorAt(mSelected);
setEntry(mRedSlider, mRedText, col >> 16);
setEntry(mGreenSlider, mGreenText, (col >> 8) & 0xff);
setEntry(mBlueSlider, mBlueText, col & 0xff);
}
-void Setup_colors::listen(const TextField *tf)
+void Setup_Colors::listen(const TextField *tf)
{
if (tf == mRedText)
{
mRedSlider->setValue(tf->getValue());
- updatecolor();
+ updateColor();
return;
}
if (tf == mGreenText)
{
mGreenSlider->setValue(tf->getValue());
- updatecolor();
+ updateColor();
return;
}
if (tf == mBlueText)
{
mBlueSlider->setValue(tf->getValue());
- updatecolor();
+ updateColor();
return;
}
}
-void Setup_colors::updatecolor()
+void Setup_Colors::updateColor()
{
if (mSelected == -1)
{
@@ -245,5 +245,5 @@ void Setup_colors::updatecolor()
int rgb = static_cast<int>(mRedSlider->getValue()) << 16 |
static_cast<int>(mGreenSlider->getValue()) << 8 |
static_cast<int>(mBlueSlider->getValue());
- textcolor->setColorAt(mSelected, rgb);
+ textColor->setColorAt(mSelected, rgb);
}
diff --git a/src/gui/setup_colors.h b/src/gui/setup_colors.h
index 7a224249..1e56cfa8 100644
--- a/src/gui/setup_colors.h
+++ b/src/gui/setup_colors.h
@@ -36,12 +36,12 @@
class BrowserBox;
-class Setup_colors : public SetupTab, public gcn::ActionListener,
+class Setup_Colors : public SetupTab, public gcn::ActionListener,
public TextFieldListener
{
public:
- Setup_colors();
- ~Setup_colors();
+ Setup_Colors();
+ ~Setup_Colors();
void apply();
void cancel();
void action(const gcn::ActionEvent &event);
@@ -70,6 +70,6 @@ class Setup_colors : public SetupTab, public gcn::ActionListener,
int mBlueValue;
void setEntry(gcn::Slider *s, TextField *t, int value);
- void updatecolor();
+ void updateColor();
};
#endif
diff --git a/src/gui/shoplistbox.cpp b/src/gui/shoplistbox.cpp
index f44bf87b..94187818 100644
--- a/src/gui/shoplistbox.cpp
+++ b/src/gui/shoplistbox.cpp
@@ -64,9 +64,9 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics)
mAlpha = config.getValue("guialpha", 0.8);
bool valid;
- const int red = (textcolor->getColor('H', valid) >> 16) & 0xFF;
- const int green = (textcolor->getColor('H', valid) >> 8) & 0xFF;
- const int blue = textcolor->getColor('H', valid) & 0xFF;
+ const int red = (textColor->getColor('H', valid) >> 16) & 0xFF;
+ const int green = (textColor->getColor('H', valid) >> 8) & 0xFF;
+ const int blue = textColor->getColor('H', valid) & 0xFF;
const int alpha = mAlpha * 255;
Graphics *graphics = static_cast<Graphics*>(gcnGraphics);
diff --git a/src/gui/table.cpp b/src/gui/table.cpp
index a5b4ace0..1ee9da0f 100644
--- a/src/gui/table.cpp
+++ b/src/gui/table.cpp
@@ -325,10 +325,10 @@ void GuiTable::draw(gcn::Graphics* graphics)
{
bool valid;
const int red =
- (textcolor->getColor('H', valid) >> 16) & 0xFF;
+ (textColor->getColor('H', valid) >> 16) & 0xFF;
const int green =
- (textcolor->getColor('H', valid) >> 8) & 0xFF;
- const int blue = textcolor->getColor('H', valid) & 0xFF;
+ (textColor->getColor('H', valid) >> 8) & 0xFF;
+ const int blue = textColor->getColor('H', valid) & 0xFF;
const int alpha = mAlpha * 127;
graphics->setColor(gcn::Color(red, green, blue, alpha));
@@ -347,10 +347,10 @@ void GuiTable::draw(gcn::Graphics* graphics)
{
bool valid;
const int red =
- (textcolor->getColor('H', valid) >> 16) & 0xFF;
+ (textColor->getColor('H', valid) >> 16) & 0xFF;
const int green =
- (textcolor->getColor('H', valid) >> 8) & 0xFF;
- const int blue = textcolor->getColor('H', valid) & 0xFF;
+ (textColor->getColor('H', valid) >> 8) & 0xFF;
+ const int blue = textColor->getColor('H', valid) & 0xFF;
const int alpha = mAlpha * 127;
graphics->setColor(gcn::Color(red, green, blue, alpha));
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 514dc3a6..29c6c69c 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -138,7 +138,7 @@ void DropDown::draw(gcn::Graphics* graphics)
const int alpha = mAlpha * 255;
gcn::Color faceColor = getBaseColor();
faceColor.a = alpha;
- gcn::Color highlightColor = textcolor->getColor('H', valid);
+ gcn::Color highlightColor = textColor->getColor('H', valid);
highlightColor.a = alpha;
gcn::Color shadowColor = faceColor - 0x303030;
shadowColor.a = alpha;