summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-24 18:51:45 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-24 18:51:45 +0300
commit641b843fd85d096afdd9b171975df91676179f3b (patch)
tree760c38447030adbdb12361978fa614ccfc9cf9fd /src/gui
parent5a5de75f298bea6f2b861dc1fb9aaf1f3d35d07c (diff)
downloadplus-641b843fd85d096afdd9b171975df91676179f3b.tar.gz
plus-641b843fd85d096afdd9b171975df91676179f3b.tar.bz2
plus-641b843fd85d096afdd9b171975df91676179f3b.tar.xz
plus-641b843fd85d096afdd9b171975df91676179f3b.zip
fix code style.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/focushandler.cpp4
-rw-r--r--src/gui/gui.cpp14
-rw-r--r--src/gui/rect.h2
-rw-r--r--src/gui/widgets/basiccontainer.cpp26
-rw-r--r--src/gui/widgets/basiccontainer.h7
-rw-r--r--src/gui/widgets/guitable.cpp12
-rw-r--r--src/gui/widgets/guitable.h2
-rw-r--r--src/gui/widgets/tabstrip.cpp4
-rw-r--r--src/gui/widgets/widget.cpp14
-rw-r--r--src/gui/widgets/widget.h25
-rw-r--r--src/gui/widgets/widget2.h2
11 files changed, 55 insertions, 57 deletions
diff --git a/src/gui/focushandler.cpp b/src/gui/focushandler.cpp
index 9424bbf29..ced7c5f6e 100644
--- a/src/gui/focushandler.cpp
+++ b/src/gui/focushandler.cpp
@@ -341,7 +341,7 @@ void FocusHandler::distributeFocusGainedEvent(const Event &focusEvent)
Widget *const sourceWidget = focusEvent.getSource();
std::list<FocusListener*> focusListeners
- = sourceWidget->_getFocusListeners();
+ = sourceWidget->getFocusListeners();
// Send the event to all focus listeners of the widget.
for (std::list<FocusListener*>::const_iterator
@@ -553,7 +553,7 @@ void FocusHandler::distributeFocusLostEvent(const Event& focusEvent)
Widget *const sourceWidget = focusEvent.getSource();
std::list<FocusListener*> focusListeners
- = sourceWidget->_getFocusListeners();
+ = sourceWidget->getFocusListeners();
// Send the event to all focus listeners of the widget.
for (std::list<FocusListener*>::const_iterator
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index aca1ef4b3..761810c1a 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -873,7 +873,7 @@ void Gui::distributeMouseEvent(Widget *const source,
event.setY(y - widgetY);
std::list<MouseListener*> mouseListeners
- = widget->_getMouseListeners();
+ = widget->getMouseListeners();
unsigned int mouseType = event.getType();
// Send the event to all mouse listeners of the widget.
@@ -1130,9 +1130,9 @@ uint32_t Gui::getMouseState(int *const x, int *const y)
void Gui::setTop(Widget *const top)
{
if (mTop)
- mTop->_setFocusHandler(nullptr);
+ mTop->setFocusHandler(nullptr);
if (top)
- top->_setFocusHandler(mFocusHandler);
+ top->setFocusHandler(mFocusHandler);
mTop = top;
}
@@ -1241,10 +1241,10 @@ Widget* Gui::getKeyEventSource() const
{
Widget* widget = mFocusHandler->getFocused();
- while (widget && widget->_getInternalFocusHandler()
- && widget->_getInternalFocusHandler()->getFocused())
+ while (widget && widget->getInternalFocusHandler()
+ && widget->getInternalFocusHandler()->getFocused())
{
- widget = widget->_getInternalFocusHandler()->getFocused();
+ widget = widget->getInternalFocusHandler()->getFocused();
}
return widget;
@@ -1276,7 +1276,7 @@ void Gui::distributeKeyEvent(KeyEvent &event) const
if (widget->isEnabled())
{
std::list<KeyListener*> keyListeners
- = widget->_getKeyListeners();
+ = widget->getKeyListeners();
const unsigned int eventType = event.getType();
// Send the event to all key listeners of the source widget.
diff --git a/src/gui/rect.h b/src/gui/rect.h
index 8b570a9f7..60ba86ed5 100644
--- a/src/gui/rect.h
+++ b/src/gui/rect.h
@@ -64,7 +64,7 @@
#ifndef GUI_RECT_H
#define GUI_RECT_H
-#include <iostream>
+//#include <iostream>
#include "localconsts.h"
diff --git a/src/gui/widgets/basiccontainer.cpp b/src/gui/widgets/basiccontainer.cpp
index e81bb2a3e..00386a725 100644
--- a/src/gui/widgets/basiccontainer.cpp
+++ b/src/gui/widgets/basiccontainer.cpp
@@ -208,7 +208,7 @@ Widget *BasicContainer::getWidgetAt(int x, int y)
if (widget->isVisible() && widget->getDimension()
.isPointInRect(x, y))
{
- return *it;;
+ return *it;
}
}
@@ -227,15 +227,15 @@ void BasicContainer::logic()
BLOCK_END("BasicContainer::logic")
}
-void BasicContainer::_setFocusHandler(FocusHandler *const focusHandler)
+void BasicContainer::setFocusHandler(FocusHandler *const focusHandler)
{
- Widget::_setFocusHandler(focusHandler);
+ Widget::setFocusHandler(focusHandler);
if (mInternalFocusHandler)
return;
FOR_EACH (WidgetListConstIterator, iter, mWidgets)
- (*iter)->_setFocusHandler(focusHandler);
+ (*iter)->setFocusHandler(focusHandler);
}
void BasicContainer::add(Widget *const widget)
@@ -245,11 +245,11 @@ void BasicContainer::add(Widget *const widget)
mLogicWidgets.push_back(widget);
if (!mInternalFocusHandler)
- widget->_setFocusHandler(_getFocusHandler());
+ widget->setFocusHandler(getFocusHandler());
else
- widget->_setFocusHandler(mInternalFocusHandler);
+ widget->setFocusHandler(mInternalFocusHandler);
- widget->_setParent(this);
+ widget->setParent(this);
widget->addDeathListener(this);
}
@@ -260,8 +260,8 @@ void BasicContainer::remove(Widget* widget)
if (*iter == widget)
{
mWidgets.erase(iter);
- widget->_setFocusHandler(nullptr);
- widget->_setParent(nullptr);
+ widget->setFocusHandler(nullptr);
+ widget->setParent(nullptr);
widget->removeDeathListener(this);
break;
}
@@ -281,8 +281,8 @@ void BasicContainer::clear()
FOR_EACH (WidgetListConstIterator, iter, mWidgets)
{
Widget *const widget = *iter;
- widget->_setFocusHandler(nullptr);
- widget->_setParent(nullptr);
+ widget->setFocusHandler(nullptr);
+ widget->setParent(nullptr);
widget->removeDeathListener(this);
}
@@ -367,8 +367,8 @@ void BasicContainer::setInternalFocusHandler(FocusHandler* focusHandler)
FOR_EACH (WidgetListConstIterator, iter, mWidgets)
{
if (!mInternalFocusHandler)
- (*iter)->_setFocusHandler(_getFocusHandler());
+ (*iter)->setFocusHandler(getFocusHandler());
else
- (*iter)->_setFocusHandler(mInternalFocusHandler);
+ (*iter)->setFocusHandler(mInternalFocusHandler);
}
}
diff --git a/src/gui/widgets/basiccontainer.h b/src/gui/widgets/basiccontainer.h
index 2d8a9beee..8a5d7b9a4 100644
--- a/src/gui/widgets/basiccontainer.h
+++ b/src/gui/widgets/basiccontainer.h
@@ -85,7 +85,8 @@ class BasicContainer : public Widget,
explicit BasicContainer(const Widget2 *const widget) :
Widget(widget),
DeathListener(),
- mWidgets()
+ mWidgets(),
+ mLogicWidgets()
{ }
A_DELETE_COPY(BasicContainer)
@@ -122,8 +123,8 @@ class BasicContainer : public Widget,
virtual void logic() override;
- virtual void _setFocusHandler(FocusHandler *const focusHandler)
- override;
+ virtual void setFocusHandler(FocusHandler *const focusHandler)
+ override;
void setInternalFocusHandler(FocusHandler* focusHandler);
diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp
index 35e09ce93..3248f1884 100644
--- a/src/gui/widgets/guitable.cpp
+++ b/src/gui/widgets/guitable.cpp
@@ -73,7 +73,7 @@ GuiTableActionListener::GuiTableActionListener(GuiTable *restrict table,
if (widget)
{
widget->addActionListener(this);
- widget->_setParent(table);
+ widget->setParent(table);
}
}
@@ -82,7 +82,7 @@ GuiTableActionListener::~GuiTableActionListener()
if (mWidget)
{
mWidget->removeActionListener(this);
- mWidget->_setParent(nullptr);
+ mWidget->setParent(nullptr);
}
}
@@ -292,7 +292,7 @@ void GuiTable::installActionListeners()
}
}
- _setFocusHandler(_getFocusHandler());
+ setFocusHandler(getFocusHandler());
}
// -- widget ops
@@ -590,14 +590,14 @@ int GuiTable::getColumnForX(int x) const
return column;
}
-void GuiTable::_setFocusHandler(FocusHandler *const focusHandler)
+void GuiTable::setFocusHandler(FocusHandler *const focusHandler)
{
// add check for focusHandler. may be need remove it?
if (!mModel || !focusHandler)
return;
- Widget::_setFocusHandler(focusHandler);
+ Widget::setFocusHandler(focusHandler);
const int rows = mModel->getRows();
const int cols = mModel->getColumns();
@@ -607,7 +607,7 @@ void GuiTable::_setFocusHandler(FocusHandler *const focusHandler)
{
Widget *const w = mModel->getElementAt(r, c);
if (w)
- w->_setFocusHandler(focusHandler);
+ w->setFocusHandler(focusHandler);
}
}
}
diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h
index ec3bab728..64e0adae4 100644
--- a/src/gui/widgets/guitable.h
+++ b/src/gui/widgets/guitable.h
@@ -120,7 +120,7 @@ public:
void moveToBottom(Widget *child) override final;
- void _setFocusHandler(FocusHandler *const focusHandler) override final;
+ void setFocusHandler(FocusHandler *const focusHandler) override final;
// Inherited from KeyListener
void keyPressed(KeyEvent& event) override final;
diff --git a/src/gui/widgets/tabstrip.cpp b/src/gui/widgets/tabstrip.cpp
index 06e2fd3b8..e6459a103 100644
--- a/src/gui/widgets/tabstrip.cpp
+++ b/src/gui/widgets/tabstrip.cpp
@@ -57,8 +57,8 @@ void TabStrip::action(const ActionEvent &event)
WidgetGroup::action(event);
if (event.getSource())
{
- Widget *const widget = event.getSource();
- if (static_cast<Button*>(widget)->isPressed2())
+ const Widget *const widget = event.getSource();
+ if (static_cast<const Button*>(widget)->isPressed2())
{
FOR_EACH (WidgetListConstIterator, iter, mWidgets)
{
diff --git a/src/gui/widgets/widget.cpp b/src/gui/widgets/widget.cpp
index cd1ac750c..aa3e6254b 100644
--- a/src/gui/widgets/widget.cpp
+++ b/src/gui/widgets/widget.cpp
@@ -77,8 +77,6 @@
#include "listeners/deathlistener.h"
#include "listeners/widgetlistener.h"
-#include "render/graphics.h"
-
#include "debug.h"
Font* Widget::mGlobalFont = nullptr;
@@ -123,7 +121,7 @@ Widget::~Widget()
(*iter)->death(event);
}
- _setFocusHandler(nullptr);
+ setFocusHandler(nullptr);
mWidgets.remove(this);
mWidgetsSet.erase(this);
@@ -234,7 +232,7 @@ void Widget::setVisible(bool visible)
mVisible = visible;
}
-void Widget::_setFocusHandler(FocusHandler *const focusHandler)
+void Widget::setFocusHandler(FocusHandler *const focusHandler)
{
if (mFocusHandler)
{
@@ -426,17 +424,17 @@ bool Widget::isModalMouseInputFocused() const
return mFocusHandler->getModalMouseInputFocused() == this;
}
-const std::list<MouseListener*>& Widget::_getMouseListeners()
+const std::list<MouseListener*>& Widget::getMouseListeners()
{
return mMouseListeners;
}
-const std::list<KeyListener*>& Widget::_getKeyListeners()
+const std::list<KeyListener*>& Widget::getKeyListeners()
{
return mKeyListeners;
}
-const std::list<FocusListener*>& Widget::_getFocusListeners()
+const std::list<FocusListener*>& Widget::getFocusListeners()
{
return mFocusListeners;
}
@@ -446,7 +444,7 @@ Rect Widget::getChildrenArea()
return Rect(0, 0, 0, 0);
}
-FocusHandler* Widget::_getInternalFocusHandler()
+FocusHandler* Widget::getInternalFocusHandler()
{
return mInternalFocusHandler;
}
diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h
index 20361d13b..de5a79502 100644
--- a/src/gui/widgets/widget.h
+++ b/src/gui/widgets/widget.h
@@ -76,7 +76,6 @@
#include "localconsts.h"
class ActionListener;
-class BasicContainer;
class DeathListener;
class FocusHandler;
class FocusListener;
@@ -482,10 +481,10 @@ class Widget : public Widget2
* are doing.
*
* @param focusHandler The focus handler to use.
- * @see _getFocusHandler
+ * @see getFocusHandler
* @since 0.1.0
*/
- virtual void _setFocusHandler(FocusHandler *const focusHandler);
+ virtual void setFocusHandler(FocusHandler *const focusHandler);
/**
* Gets the focus handler used.
@@ -495,10 +494,10 @@ class Widget : public Widget2
* are doing.
*
* @return The focus handler used.
- * @see _setFocusHandler
+ * @see setFocusHandler
* @since 0.1.0
*/
- virtual FocusHandler* _getFocusHandler() A_WARN_UNUSED
+ virtual FocusHandler* getFocusHandler() A_WARN_UNUSED
{ return mFocusHandler; }
/**
@@ -666,7 +665,7 @@ class Widget : public Widget2
* @see getParent
* @since 0.1.0
*/
- virtual void _setParent(Widget* parent)
+ virtual void setParent(Widget* parent)
{ mParent = parent; }
/**
@@ -853,8 +852,8 @@ class Widget : public Widget2
* @return The mouse listeners of the widget.
* @since 0.6.0
*/
- virtual const std::list<MouseListener*>& _getMouseListeners()
- A_WARN_UNUSED;
+ virtual const std::list<MouseListener*>& getMouseListeners()
+ A_WARN_UNUSED;
/**
* Gets the key listeners of the widget.
@@ -862,8 +861,8 @@ class Widget : public Widget2
* @return The key listeners of the widget.
* @since 0.6.0
*/
- virtual const std::list<KeyListener*>& _getKeyListeners()
- A_WARN_UNUSED;
+ virtual const std::list<KeyListener*>& getKeyListeners()
+ A_WARN_UNUSED;
/**
* Gets the focus listeners of the widget.
@@ -871,8 +870,8 @@ class Widget : public Widget2
* @return The focus listeners of the widget.
* @since 0.7.0
*/
- virtual const std::list<FocusListener*>& _getFocusListeners()
- A_WARN_UNUSED;
+ virtual const std::list<FocusListener*>& getFocusListeners()
+ A_WARN_UNUSED;
/**
* Gets the area of the widget occupied by the widget's children.
@@ -904,7 +903,7 @@ class Widget : public Widget2
* @see setInternalFocusHandler
* @since 0.1.0
*/
- virtual FocusHandler* _getInternalFocusHandler() A_WARN_UNUSED;
+ virtual FocusHandler* getInternalFocusHandler() A_WARN_UNUSED;
/**
* Sets the internal focus handler. An internal focus handler is
diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h
index 2d73418ba..7890fd648 100644
--- a/src/gui/widgets/widget2.h
+++ b/src/gui/widgets/widget2.h
@@ -45,7 +45,7 @@ class Widget2
{
if (!theme)
return Palette::BLACK;
- const int colorId = theme->getIdByChar(c, valid);;
+ const int colorId = theme->getIdByChar(c, valid);
if (valid)
return theme->getColor(mPaletteOffset + colorId, 255);
else