summaryrefslogtreecommitdiff
path: root/src/guichan
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-14 17:06:02 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-14 17:06:02 +0300
commit6b5c7e7a5ed32abfc98d9acdebacc50c68a91a1d (patch)
treef1acb027394af1aec49790354df97da4665488b7 /src/guichan
parenta7d7346b9eb3fa62a8912e31d5c00f8e05390425 (diff)
downloadmv-6b5c7e7a5ed32abfc98d9acdebacc50c68a91a1d.tar.gz
mv-6b5c7e7a5ed32abfc98d9acdebacc50c68a91a1d.tar.bz2
mv-6b5c7e7a5ed32abfc98d9acdebacc50c68a91a1d.tar.xz
mv-6b5c7e7a5ed32abfc98d9acdebacc50c68a91a1d.zip
another fixes from cpplint.
Diffstat (limited to 'src/guichan')
-rw-r--r--src/guichan/include/guichan/actionevent.hpp5
-rw-r--r--src/guichan/include/guichan/actionlistener.hpp7
-rw-r--r--src/guichan/include/guichan/basiccontainer.hpp4
-rw-r--r--src/guichan/include/guichan/cliprectangle.hpp5
-rw-r--r--src/guichan/include/guichan/color.hpp7
-rw-r--r--src/guichan/include/guichan/deathlistener.hpp7
-rw-r--r--src/guichan/include/guichan/event.hpp6
-rw-r--r--src/guichan/include/guichan/exception.hpp7
-rw-r--r--src/guichan/include/guichan/focushandler.hpp7
-rw-r--r--src/guichan/include/guichan/focuslistener.hpp9
-rw-r--r--src/guichan/include/guichan/font.hpp5
-rw-r--r--src/guichan/include/guichan/graphics.hpp4
-rw-r--r--src/guichan/include/guichan/gui.hpp5
-rw-r--r--src/guichan/include/guichan/image.hpp5
-rw-r--r--src/guichan/include/guichan/input.hpp5
-rw-r--r--src/guichan/include/guichan/inputevent.hpp5
-rw-r--r--src/guichan/include/guichan/key.hpp7
-rw-r--r--src/guichan/include/guichan/keyevent.hpp4
-rw-r--r--src/guichan/include/guichan/keyinput.hpp7
-rw-r--r--src/guichan/include/guichan/keylistener.hpp5
-rw-r--r--src/guichan/include/guichan/listmodel.hpp5
-rw-r--r--src/guichan/include/guichan/mouseevent.hpp6
-rw-r--r--src/guichan/include/guichan/mouseinput.hpp7
-rw-r--r--src/guichan/include/guichan/mouselistener.hpp14
-rw-r--r--src/guichan/include/guichan/platform.hpp2
-rw-r--r--src/guichan/include/guichan/rectangle.hpp5
-rw-r--r--src/guichan/include/guichan/sdl/sdlgraphics.hpp5
-rw-r--r--src/guichan/include/guichan/sdl/sdlpixel.hpp10
-rw-r--r--src/guichan/include/guichan/selectionevent.hpp7
-rw-r--r--src/guichan/include/guichan/selectionlistener.hpp7
-rw-r--r--src/guichan/include/guichan/widget.hpp14
-rw-r--r--src/guichan/include/guichan/widgetlistener.hpp5
-rw-r--r--src/guichan/include/guichan/widgets/button.hpp6
-rw-r--r--src/guichan/include/guichan/widgets/checkbox.hpp5
-rw-r--r--src/guichan/include/guichan/widgets/container.hpp5
-rw-r--r--src/guichan/include/guichan/widgets/label.hpp6
-rw-r--r--src/guichan/include/guichan/widgets/listbox.hpp6
-rw-r--r--src/guichan/include/guichan/widgets/radiobutton.hpp5
-rw-r--r--src/guichan/include/guichan/widgets/scrollarea.hpp14
-rw-r--r--src/guichan/include/guichan/widgets/slider.hpp8
-rw-r--r--src/guichan/include/guichan/widgets/textbox.hpp6
-rw-r--r--src/guichan/include/guichan/widgets/textfield.hpp6
-rw-r--r--src/guichan/include/guichan/widgets/window.hpp6
-rw-r--r--src/guichan/mouseinput.cpp2
-rw-r--r--src/guichan/sdl/sdlgraphics.cpp1
-rw-r--r--src/guichan/widget.cpp4
46 files changed, 121 insertions, 162 deletions
diff --git a/src/guichan/include/guichan/actionevent.hpp b/src/guichan/include/guichan/actionevent.hpp
index 12baa3419..4d130501d 100644
--- a/src/guichan/include/guichan/actionevent.hpp
+++ b/src/guichan/include/guichan/actionevent.hpp
@@ -81,7 +81,6 @@ namespace gcn
class GCN_CORE_DECLSPEC ActionEvent final : public Event
{
public:
-
/**
* Constructor.
*
@@ -111,6 +110,6 @@ namespace gcn
*/
std::string mId;
};
-}
+} // namespace gcn
-#endif // GCN_ACTIONEVENT_HPP
+#endif // GCN_ACTIONEVENT_HPP
diff --git a/src/guichan/include/guichan/actionlistener.hpp b/src/guichan/include/guichan/actionlistener.hpp
index 50e3349fd..37970af5f 100644
--- a/src/guichan/include/guichan/actionlistener.hpp
+++ b/src/guichan/include/guichan/actionlistener.hpp
@@ -63,7 +63,6 @@ namespace gcn
class GCN_CORE_DECLSPEC ActionListener
{
public:
-
/**
* Destructor.
*/
@@ -79,7 +78,7 @@ namespace gcn
* @since 0.6.0
*/
virtual void action(const ActionEvent& actionEvent) = 0;
-
+
protected:
/**
* Constructor.
@@ -90,6 +89,6 @@ namespace gcn
ActionListener()
{ }
};
-}
+} // namespace gcn
-#endif // end GCN_ACTIONLISTENER_HPP
+#endif // end GCN_ACTIONLISTENER_HPP
diff --git a/src/guichan/include/guichan/basiccontainer.hpp b/src/guichan/include/guichan/basiccontainer.hpp
index dc307fb27..7f2d81382 100644
--- a/src/guichan/include/guichan/basiccontainer.hpp
+++ b/src/guichan/include/guichan/basiccontainer.hpp
@@ -192,6 +192,6 @@ namespace gcn
*/
WidgetList mWidgets;
};
-}
+} // namespace gcn
-#endif // end GCN_BASICCONTAINER_HPP
+#endif // end GCN_BASICCONTAINER_HPP
diff --git a/src/guichan/include/guichan/cliprectangle.hpp b/src/guichan/include/guichan/cliprectangle.hpp
index 5b7397639..51887c032 100644
--- a/src/guichan/include/guichan/cliprectangle.hpp
+++ b/src/guichan/include/guichan/cliprectangle.hpp
@@ -61,7 +61,6 @@ namespace gcn
class GCN_CORE_DECLSPEC ClipRectangle final : public Rectangle
{
public:
-
/**
* Constructor.
*/
@@ -107,6 +106,6 @@ namespace gcn
*/
int yOffset;
};
-}
+} // namespace gcn
-#endif // end GCN_CLIPRECTANGLE_HPP
+#endif // end GCN_CLIPRECTANGLE_HPP
diff --git a/src/guichan/include/guichan/color.hpp b/src/guichan/include/guichan/color.hpp
index 0d7ccce5e..6fb650655 100644
--- a/src/guichan/include/guichan/color.hpp
+++ b/src/guichan/include/guichan/color.hpp
@@ -59,7 +59,6 @@ namespace gcn
class GCN_CORE_DECLSPEC Color final
{
public:
-
/**
* Constructor. Initializes the color to black.
*/
@@ -77,7 +76,7 @@ namespace gcn
*
* @param color The color to initialise the object with.
*/
- Color(const int color);
+ explicit Color(const int color);
/**
* Constructor. The default alpha value is 255.
@@ -171,6 +170,6 @@ namespace gcn
*/
int a;
};
-}
+} // namespace gcn
-#endif // end GCN_COLOR_HPP
+#endif // end GCN_COLOR_HPP
diff --git a/src/guichan/include/guichan/deathlistener.hpp b/src/guichan/include/guichan/deathlistener.hpp
index c419edd35..360032289 100644
--- a/src/guichan/include/guichan/deathlistener.hpp
+++ b/src/guichan/include/guichan/deathlistener.hpp
@@ -62,7 +62,6 @@ namespace gcn
class GCN_CORE_DECLSPEC DeathListener
{
public:
-
/**
* Destructor.
*/
@@ -76,7 +75,7 @@ namespace gcn
* @param event The event of the death.
*/
virtual void death(const Event& event) = 0;
-
+
protected:
/**
* Constructor.
@@ -87,6 +86,6 @@ namespace gcn
DeathListener()
{ }
};
-}
+} // namespace gcn
-#endif // end GCN_DEATHLISTENER_HPP
+#endif // end GCN_DEATHLISTENER_HPP
diff --git a/src/guichan/include/guichan/event.hpp b/src/guichan/include/guichan/event.hpp
index 5e85a3ca8..b4c5abcf7 100644
--- a/src/guichan/include/guichan/event.hpp
+++ b/src/guichan/include/guichan/event.hpp
@@ -68,7 +68,7 @@ namespace gcn
*
* @param source The source widget of the event.
*/
- Event(Widget *const source);
+ explicit Event(Widget *const source);
A_DELETE_COPY(Event)
@@ -91,6 +91,6 @@ namespace gcn
*/
Widget* mSource;
};
-}
+} // namespace gcn
-#endif // end GCN_EVENT_HPP
+#endif // end GCN_EVENT_HPP
diff --git a/src/guichan/include/guichan/exception.hpp b/src/guichan/include/guichan/exception.hpp
index 2e7b250b3..bbf8b31ce 100644
--- a/src/guichan/include/guichan/exception.hpp
+++ b/src/guichan/include/guichan/exception.hpp
@@ -88,7 +88,6 @@ namespace gcn
class GCN_CORE_DECLSPEC Exception final
{
public:
-
/**
* Constructor.
*/
@@ -99,7 +98,7 @@ namespace gcn
*
* @param message The error message of the exception.
*/
- Exception(const std::string& message);
+ explicit Exception(const std::string& message);
/**
* Constructor.
@@ -169,9 +168,9 @@ namespace gcn
*/
unsigned int mLine;
};
-}
+} // namespace gcn
-#endif // end GCN_EXCEPTION_HPP
+#endif // end GCN_EXCEPTION_HPP
/*
* "Final Fantasy XI is the BEST!... It's even better then water!"
diff --git a/src/guichan/include/guichan/focushandler.hpp b/src/guichan/include/guichan/focushandler.hpp
index 27b6bc91f..3e1402264 100644
--- a/src/guichan/include/guichan/focushandler.hpp
+++ b/src/guichan/include/guichan/focushandler.hpp
@@ -71,7 +71,6 @@ namespace gcn
class GCN_CORE_DECLSPEC FocusHandler
{
public:
-
/**
* Constructor.
*/
@@ -83,7 +82,7 @@ namespace gcn
* Destructor.
*/
virtual ~FocusHandler()
- { };
+ { }
/**
* Requests focus for a widget. Focus will only be granted to a widget
@@ -395,6 +394,6 @@ namespace gcn
*/
Widget* mLastWidgetPressed;
};
-}
+} // namespace gcn
-#endif // end GCN_FOCUSHANDLER_HPP
+#endif // end GCN_FOCUSHANDLER_HPP
diff --git a/src/guichan/include/guichan/focuslistener.hpp b/src/guichan/include/guichan/focuslistener.hpp
index 59e8cbe12..7e95ceb4d 100644
--- a/src/guichan/include/guichan/focuslistener.hpp
+++ b/src/guichan/include/guichan/focuslistener.hpp
@@ -64,7 +64,6 @@ namespace gcn
class GCN_CORE_DECLSPEC FocusListener
{
public:
-
/**
* Destructor.
*/
@@ -77,7 +76,7 @@ namespace gcn
* @param event Discribes the event.
*/
virtual void focusGained(const Event& event A_UNUSED)
- { };
+ { }
/**
* Called when a widget loses focus.
@@ -85,7 +84,7 @@ namespace gcn
* @param event Discribes the event.
*/
virtual void focusLost(const Event& event A_UNUSED)
- { };
+ { }
protected:
/**
@@ -97,6 +96,6 @@ namespace gcn
FocusListener()
{ }
};
-}
+} // namespace gcn
-#endif // end GCN_FOCUSLISTENER_HPP
+#endif // end GCN_FOCUSLISTENER_HPP
diff --git a/src/guichan/include/guichan/font.hpp b/src/guichan/include/guichan/font.hpp
index b5430574e..b400b9cb6 100644
--- a/src/guichan/include/guichan/font.hpp
+++ b/src/guichan/include/guichan/font.hpp
@@ -62,7 +62,6 @@ namespace gcn
class GCN_CORE_DECLSPEC Font
{
public:
-
/**
* Destructor.
*/
@@ -111,6 +110,6 @@ namespace gcn
virtual void drawString(Graphics* graphics, const std::string& text,
int x, int y) = 0;
};
-}
+} // namespace gcn
-#endif // end GCN_FONT_HPP
+#endif // end GCN_FONT_HPP
diff --git a/src/guichan/include/guichan/graphics.hpp b/src/guichan/include/guichan/graphics.hpp
index aadb81371..a8217d50d 100644
--- a/src/guichan/include/guichan/graphics.hpp
+++ b/src/guichan/include/guichan/graphics.hpp
@@ -271,6 +271,6 @@ namespace gcn
*/
Font* mFont;
};
-}
+} // namespace gcn
-#endif // end GCN_GRAPHICS_HPP
+#endif // end GCN_GRAPHICS_HPP
diff --git a/src/guichan/include/guichan/gui.hpp b/src/guichan/include/guichan/gui.hpp
index 543681598..ea952ec9c 100644
--- a/src/guichan/include/guichan/gui.hpp
+++ b/src/guichan/include/guichan/gui.hpp
@@ -97,7 +97,6 @@ namespace gcn
class GCN_CORE_DECLSPEC Gui
{
public:
-
/**
* Constructor.
*/
@@ -501,9 +500,9 @@ namespace gcn
*/
std::deque<Widget*> mWidgetWithMouseQueue;
};
-}
+} // namespace gcn
-#endif // end GCN_GUI_HPP
+#endif // end GCN_GUI_HPP
/* yakslem - "Women, it's a constant struggle."
* finalman - "Yes, but sometimes they succeed with their guesses."
diff --git a/src/guichan/include/guichan/image.hpp b/src/guichan/include/guichan/image.hpp
index 0feb74e78..2baa06fb2 100644
--- a/src/guichan/include/guichan/image.hpp
+++ b/src/guichan/include/guichan/image.hpp
@@ -72,7 +72,6 @@ namespace gcn
class GCN_CORE_DECLSPEC Image
{
public:
-
/**
* Constructor.
*/
@@ -141,6 +140,6 @@ namespace gcn
*/
virtual void convertToDisplayFormat() = 0;
};
-}
+} // namespace gcn
-#endif // end GCN_IMAGE_HPP
+#endif // end GCN_IMAGE_HPP
diff --git a/src/guichan/include/guichan/input.hpp b/src/guichan/include/guichan/input.hpp
index 829ab18fb..2a22ce965 100644
--- a/src/guichan/include/guichan/input.hpp
+++ b/src/guichan/include/guichan/input.hpp
@@ -69,7 +69,6 @@ namespace gcn
class GCN_CORE_DECLSPEC Input
{
public:
-
/**
* Destructor.
*/
@@ -113,6 +112,6 @@ namespace gcn
*/
virtual void _pollInput() = 0;
};
-}
+} // namespace gcn
-#endif // end GCN_INPUT_HPP
+#endif // end GCN_INPUT_HPP
diff --git a/src/guichan/include/guichan/inputevent.hpp b/src/guichan/include/guichan/inputevent.hpp
index 4b323f6d5..670b7099b 100644
--- a/src/guichan/include/guichan/inputevent.hpp
+++ b/src/guichan/include/guichan/inputevent.hpp
@@ -59,7 +59,6 @@ namespace gcn
class GCN_CORE_DECLSPEC InputEvent: public Event
{
public:
-
/**
* Constructor.
*
@@ -155,6 +154,6 @@ namespace gcn
*/
bool mIsConsumed;
};
-}
+} // namespace gcn
-#endif // end GCN_INPUTEVENT_HPP
+#endif // end GCN_INPUTEVENT_HPP
diff --git a/src/guichan/include/guichan/key.hpp b/src/guichan/include/guichan/key.hpp
index 6acce412c..8a2a9a13d 100644
--- a/src/guichan/include/guichan/key.hpp
+++ b/src/guichan/include/guichan/key.hpp
@@ -64,13 +64,12 @@ namespace gcn
class GCN_CORE_DECLSPEC Key final
{
public:
-
/**
* Constructor.
*
* @param value The ascii or enum value for the key.
*/
- Key(const int value = 0);
+ explicit Key(const int value = 0);
/**
* Checks if a key is a character.
@@ -180,6 +179,6 @@ namespace gcn
*/
int mValue;
};
-}
+} // namespace gcn
-#endif // end GCN_KEY_HPP
+#endif // end GCN_KEY_HPP
diff --git a/src/guichan/include/guichan/keyevent.hpp b/src/guichan/include/guichan/keyevent.hpp
index 99b632af1..61848192d 100644
--- a/src/guichan/include/guichan/keyevent.hpp
+++ b/src/guichan/include/guichan/keyevent.hpp
@@ -134,6 +134,6 @@ namespace gcn
*/
Key mKey;
};
-}
+} // namespace gcn
-#endif // end GCN_KEYEVENT_HPP
+#endif // end GCN_KEYEVENT_HPP
diff --git a/src/guichan/include/guichan/keyinput.hpp b/src/guichan/include/guichan/keyinput.hpp
index c19fbea22..6b1d8e932 100644
--- a/src/guichan/include/guichan/keyinput.hpp
+++ b/src/guichan/include/guichan/keyinput.hpp
@@ -60,7 +60,6 @@ namespace gcn
class GCN_CORE_DECLSPEC KeyInput
{
public:
-
/**
* Constructor.
*/
@@ -71,7 +70,7 @@ namespace gcn
mAltPressed(false),
mMetaPressed(false),
mNumericPad(false)
- { };
+ { }
/**
* Constructor.
@@ -266,6 +265,6 @@ namespace gcn
*/
bool mNumericPad;
};
-}
+} // namespace gcn
-#endif // end GCN_KEYINPUT_HPP
+#endif // end GCN_KEYINPUT_HPP
diff --git a/src/guichan/include/guichan/keylistener.hpp b/src/guichan/include/guichan/keylistener.hpp
index 7336f8623..427a8adbb 100644
--- a/src/guichan/include/guichan/keylistener.hpp
+++ b/src/guichan/include/guichan/keylistener.hpp
@@ -62,7 +62,6 @@ namespace gcn
class GCN_CORE_DECLSPEC KeyListener
{
public:
-
/**
* Destructor.
*/
@@ -97,6 +96,6 @@ namespace gcn
KeyListener()
{ }
};
-}
+} // namespace gcn
-#endif // end GCN_KEYLISTENER_HPP
+#endif // end GCN_KEYLISTENER_HPP
diff --git a/src/guichan/include/guichan/listmodel.hpp b/src/guichan/include/guichan/listmodel.hpp
index 681a9e0c8..640c3fcc5 100644
--- a/src/guichan/include/guichan/listmodel.hpp
+++ b/src/guichan/include/guichan/listmodel.hpp
@@ -62,7 +62,6 @@ namespace gcn
*/
class GCN_CORE_DECLSPEC ListModel
{
-
public:
/**
* Destructor.
@@ -85,6 +84,6 @@ namespace gcn
*/
virtual std::string getElementAt(int i) A_WARN_UNUSED = 0;
};
-}
+} // namespace gcn
-#endif // end GCN_LISTMODEL_HPP
+#endif // end GCN_LISTMODEL_HPP
diff --git a/src/guichan/include/guichan/mouseevent.hpp b/src/guichan/include/guichan/mouseevent.hpp
index 876eaa9ef..ca39e388c 100644
--- a/src/guichan/include/guichan/mouseevent.hpp
+++ b/src/guichan/include/guichan/mouseevent.hpp
@@ -62,7 +62,6 @@ namespace gcn
class GCN_CORE_DECLSPEC MouseEvent: public InputEvent
{
public:
-
/**
* Constructor.
*
@@ -145,7 +144,6 @@ namespace gcn
ENTERED,
EXITED,
DRAGGED
-
};
/**
@@ -196,6 +194,6 @@ namespace gcn
*/
friend class Gui;
};
-}
+} // namespace gcn
-#endif // GCN_MOUSEEVENT_HPP
+#endif // GCN_MOUSEEVENT_HPP
diff --git a/src/guichan/include/guichan/mouseinput.hpp b/src/guichan/include/guichan/mouseinput.hpp
index 435774573..287e905ec 100644
--- a/src/guichan/include/guichan/mouseinput.hpp
+++ b/src/guichan/include/guichan/mouseinput.hpp
@@ -64,7 +64,6 @@ namespace gcn
class GCN_CORE_DECLSPEC MouseInput
{
public:
-
/**
* Constructor.
*/
@@ -74,7 +73,7 @@ namespace gcn
mTimeStamp(0),
mX(0),
mY(0)
- { };
+ { }
/**
* Constructor.
@@ -239,6 +238,6 @@ namespace gcn
*/
int mY;
};
-}
+} // namespace gcn
-#endif // end GCN_MOUSEINPUT_HPP
+#endif // end GCN_MOUSEINPUT_HPP
diff --git a/src/guichan/include/guichan/mouselistener.hpp b/src/guichan/include/guichan/mouselistener.hpp
index 6258a64fb..2ed75e5ba 100644
--- a/src/guichan/include/guichan/mouselistener.hpp
+++ b/src/guichan/include/guichan/mouselistener.hpp
@@ -61,7 +61,6 @@ namespace gcn
class GCN_CORE_DECLSPEC MouseListener
{
public:
-
/**
* Destructor.
*/
@@ -76,7 +75,6 @@ namespace gcn
*/
virtual void mouseEntered(MouseEvent& mouseEvent A_UNUSED)
{
-
}
/**
@@ -87,7 +85,6 @@ namespace gcn
*/
virtual void mouseExited(MouseEvent& mouseEvent A_UNUSED)
{
-
}
/**
@@ -101,7 +98,6 @@ namespace gcn
*/
virtual void mousePressed(MouseEvent& mouseEvent A_UNUSED)
{
-
}
/**
@@ -112,7 +108,6 @@ namespace gcn
*/
virtual void mouseReleased(MouseEvent& mouseEvent A_UNUSED)
{
-
}
/**
@@ -124,7 +119,6 @@ namespace gcn
*/
virtual void mouseClicked(MouseEvent& mouseEvent A_UNUSED)
{
-
}
/**
@@ -135,7 +129,6 @@ namespace gcn
*/
virtual void mouseWheelMovedUp(MouseEvent& mouseEvent A_UNUSED)
{
-
}
/**
@@ -146,7 +139,6 @@ namespace gcn
*/
virtual void mouseWheelMovedDown(MouseEvent& mouseEvent A_UNUSED)
{
-
}
/**
@@ -158,7 +150,6 @@ namespace gcn
*/
virtual void mouseMoved(MouseEvent& mouseEvent A_UNUSED)
{
-
}
/**
@@ -170,7 +161,6 @@ namespace gcn
*/
virtual void mouseDragged(MouseEvent& mouseEvent A_UNUSED)
{
-
}
protected:
@@ -183,6 +173,6 @@ namespace gcn
MouseListener()
{ }
};
-}
+} // namespace gcn
-#endif // end GCN_MOUSELISTENER_HPP
+#endif // end GCN_MOUSELISTENER_HPP
diff --git a/src/guichan/include/guichan/platform.hpp b/src/guichan/include/guichan/platform.hpp
index c2ede557c..e27d87def 100644
--- a/src/guichan/include/guichan/platform.hpp
+++ b/src/guichan/include/guichan/platform.hpp
@@ -73,4 +73,4 @@
#define GCN_EXTENSION_DECLSPEC
#endif
-#endif // end GCN_PLATFORM_HPP
+#endif // end GCN_PLATFORM_HPP
diff --git a/src/guichan/include/guichan/rectangle.hpp b/src/guichan/include/guichan/rectangle.hpp
index 7580fea8c..5df69fec5 100644
--- a/src/guichan/include/guichan/rectangle.hpp
+++ b/src/guichan/include/guichan/rectangle.hpp
@@ -61,7 +61,6 @@ namespace gcn
class GCN_CORE_DECLSPEC Rectangle
{
public:
-
/**
* Constructor. The default rectangle is an empty rectangle
* at the coordinates (0,0).
@@ -138,6 +137,6 @@ namespace gcn
*/
int height;
};
-}
+} // namespace gcn
-#endif // end GCN_RECTANGEL_HPP
+#endif // end GCN_RECTANGEL_HPP
diff --git a/src/guichan/include/guichan/sdl/sdlgraphics.hpp b/src/guichan/include/guichan/sdl/sdlgraphics.hpp
index 8b565c400..fff1f6e29 100644
--- a/src/guichan/include/guichan/sdl/sdlgraphics.hpp
+++ b/src/guichan/include/guichan/sdl/sdlgraphics.hpp
@@ -62,7 +62,6 @@ namespace gcn
class GCN_EXTENSION_DECLSPEC SDLGraphics : public Graphics
{
public:
-
// Needed so that drawImage(gcn::Image *, int, int) is visible.
using Graphics::drawImage;
@@ -154,6 +153,6 @@ namespace gcn
Color mColor;
bool mAlpha;
};
-}
+} // namespace gcn
-#endif // end GCN_SDLGRAPHICS_HPP
+#endif // end GCN_SDLGRAPHICS_HPP
diff --git a/src/guichan/include/guichan/sdl/sdlpixel.hpp b/src/guichan/include/guichan/sdl/sdlpixel.hpp
index daf11acc5..c068aa290 100644
--- a/src/guichan/include/guichan/sdl/sdlpixel.hpp
+++ b/src/guichan/include/guichan/sdl/sdlpixel.hpp
@@ -237,8 +237,10 @@ namespace gcn
Uint8 *p = static_cast<uint8_t*>(surface->pixels)
+ y * surface->pitch + x * bpp;
- Uint32 pixel = SDL_MapRGB(surface->format, static_cast<uint8_t>(color.r),
- static_cast<uint8_t>(color.g), static_cast<uint8_t>(color.b));
+ Uint32 pixel = SDL_MapRGB(surface->format,
+ static_cast<uint8_t>(color.r),
+ static_cast<uint8_t>(color.g),
+ static_cast<uint8_t>(color.b));
switch (bpp)
{
@@ -285,6 +287,6 @@ namespace gcn
SDL_UnlockSurface(surface);
}
-}
+} // namespace gcn
-#endif // end GCN_SDLPIXEL_HPP
+#endif // end GCN_SDLPIXEL_HPP
diff --git a/src/guichan/include/guichan/selectionevent.hpp b/src/guichan/include/guichan/selectionevent.hpp
index 0d002a524..553091bc8 100644
--- a/src/guichan/include/guichan/selectionevent.hpp
+++ b/src/guichan/include/guichan/selectionevent.hpp
@@ -63,19 +63,18 @@ namespace gcn
class GCN_CORE_DECLSPEC SelectionEvent final: public Event
{
public:
-
/**
* Constructor.
*
* @param source source The widget of the selection event.
*/
- SelectionEvent(Widget *const source);
+ explicit SelectionEvent(Widget *const source);
/**
* Destructor.
*/
virtual ~SelectionEvent();
};
-}
+} // namespace gcn
-#endif // end GCN_SELECTIONEVENT_HPP
+#endif // end GCN_SELECTIONEVENT_HPP
diff --git a/src/guichan/include/guichan/selectionlistener.hpp b/src/guichan/include/guichan/selectionlistener.hpp
index 09039e5e0..173fbf9af 100644
--- a/src/guichan/include/guichan/selectionlistener.hpp
+++ b/src/guichan/include/guichan/selectionlistener.hpp
@@ -67,7 +67,6 @@ namespace gcn
class GCN_CORE_DECLSPEC SelectionListener
{
public:
-
/**
* Destructor.
*/
@@ -83,7 +82,7 @@ namespace gcn
* @since 0.8.0
*/
virtual void valueChanged(const SelectionEvent& event A_UNUSED)
- { };
+ { }
protected:
/**
@@ -95,6 +94,6 @@ namespace gcn
SelectionListener()
{ }
};
-}
+} // namespace gcn
-#endif // end GCN_SELECTIONLISTENER_HPP
+#endif // end GCN_SELECTIONLISTENER_HPP
diff --git a/src/guichan/include/guichan/widget.hpp b/src/guichan/include/guichan/widget.hpp
index d4e1158b3..8a49a9e3b 100644
--- a/src/guichan/include/guichan/widget.hpp
+++ b/src/guichan/include/guichan/widget.hpp
@@ -904,7 +904,7 @@ namespace gcn
* @since 0.1.0
*/
virtual void moveToTop(Widget* widget A_UNUSED)
- { };
+ { }
/**
* Moves a widget in this widget to the bottom of this widget.
@@ -915,7 +915,7 @@ namespace gcn
* @since 0.1.0
*/
virtual void moveToBottom(Widget* widget A_UNUSED)
- { };
+ { }
/**
* Focuses the next widget in the widget.
@@ -924,7 +924,7 @@ namespace gcn
* @since 0.1.0
*/
virtual void focusNext()
- { };
+ { }
/**
* Focuses the previous widget in the widget.
@@ -933,7 +933,7 @@ namespace gcn
* @since 0.1.0
*/
virtual void focusPrevious()
- { };
+ { }
/**
* Tries to show a specific part of a widget by moving it. Used if the
@@ -945,7 +945,7 @@ namespace gcn
*/
virtual void showWidgetPart(Widget* widget A_UNUSED,
Rectangle area A_UNUSED)
- { };
+ { }
/**
* Sets an id of a widget. An id can be useful if a widget needs to be
@@ -1208,6 +1208,6 @@ namespace gcn
static std::set<Widget*> mWidgetsSet;
};
-}
+} // namespace gcn
-#endif // end GCN_WIDGET_HPP
+#endif // end GCN_WIDGET_HPP
diff --git a/src/guichan/include/guichan/widgetlistener.hpp b/src/guichan/include/guichan/widgetlistener.hpp
index 71ea4d4e9..ab8a2b791 100644
--- a/src/guichan/include/guichan/widgetlistener.hpp
+++ b/src/guichan/include/guichan/widgetlistener.hpp
@@ -66,7 +66,6 @@ namespace gcn
class GCN_CORE_DECLSPEC WidgetListener
{
public:
-
/**
* Destructor.
*/
@@ -121,6 +120,6 @@ namespace gcn
WidgetListener()
{ }
};
-}
+} // namespace gcn
-#endif // end GCN_WIDGETLISTENER_HPP
+#endif // end GCN_WIDGETLISTENER_HPP
diff --git a/src/guichan/include/guichan/widgets/button.hpp b/src/guichan/include/guichan/widgets/button.hpp
index 052250e42..b34e5f921 100644
--- a/src/guichan/include/guichan/widgets/button.hpp
+++ b/src/guichan/include/guichan/widgets/button.hpp
@@ -83,7 +83,7 @@ namespace gcn
*
* @param caption The caption of the button.
*/
- Button(const std::string& caption);
+ explicit Button(const std::string& caption);
A_DELETE_COPY(Button)
@@ -197,6 +197,6 @@ namespace gcn
*/
unsigned int mSpacing;
};
-}
+} // namespace gcn
-#endif // end GCN_BUTTON_HPP
+#endif // end GCN_BUTTON_HPP
diff --git a/src/guichan/include/guichan/widgets/checkbox.hpp b/src/guichan/include/guichan/widgets/checkbox.hpp
index 481f28dba..8fee9ba19 100644
--- a/src/guichan/include/guichan/widgets/checkbox.hpp
+++ b/src/guichan/include/guichan/widgets/checkbox.hpp
@@ -68,7 +68,6 @@ namespace gcn
public KeyListener
{
public:
-
/**
* Contructor.
*/
@@ -158,6 +157,6 @@ namespace gcn
*/
std::string mCaption;
};
-}
+} // namespace gcn
-#endif // end GCN_CHECKBOX_HPP
+#endif // end GCN_CHECKBOX_HPP
diff --git a/src/guichan/include/guichan/widgets/container.hpp b/src/guichan/include/guichan/widgets/container.hpp
index 393a9a960..2fe1cf169 100644
--- a/src/guichan/include/guichan/widgets/container.hpp
+++ b/src/guichan/include/guichan/widgets/container.hpp
@@ -64,7 +64,6 @@ namespace gcn
class GCN_CORE_DECLSPEC Container: public BasicContainer
{
public:
-
/**
* Constructor. A container is opauqe as default, if you want a
* none opaque container call setQpaque(false).
@@ -158,6 +157,6 @@ namespace gcn
*/
bool mOpaque;
};
-}
+} // namespace gcn
-#endif // end GCN_CONTAINER_HPP
+#endif // end GCN_CONTAINER_HPP
diff --git a/src/guichan/include/guichan/widgets/label.hpp b/src/guichan/include/guichan/widgets/label.hpp
index a6000b47c..a99912de3 100644
--- a/src/guichan/include/guichan/widgets/label.hpp
+++ b/src/guichan/include/guichan/widgets/label.hpp
@@ -70,7 +70,7 @@ namespace gcn
*
* @param caption The caption of the label.
*/
- Label(const std::string& caption);
+ explicit Label(const std::string& caption);
A_DELETE_COPY(Label)
@@ -131,6 +131,6 @@ namespace gcn
*/
Graphics::Alignment mAlignment;
};
-}
+} // namespace gcn
-#endif // end GCN_LABEL_HPP
+#endif // end GCN_LABEL_HPP
diff --git a/src/guichan/include/guichan/widgets/listbox.hpp b/src/guichan/include/guichan/widgets/listbox.hpp
index 8438bd5ed..05eb0d78e 100644
--- a/src/guichan/include/guichan/widgets/listbox.hpp
+++ b/src/guichan/include/guichan/widgets/listbox.hpp
@@ -84,7 +84,7 @@ namespace gcn
*
* @param listModel the list model to use.
*/
- ListBox(ListModel *listModel);
+ explicit ListBox(ListModel *listModel);
A_DELETE_COPY(ListBox)
@@ -252,6 +252,6 @@ namespace gcn
*/
typedef SelectionListenerList::iterator SelectionListenerIterator;
};
-}
+} // namespace gcn
-#endif // end GCN_LISTBOX_HPP
+#endif // end GCN_LISTBOX_HPP
diff --git a/src/guichan/include/guichan/widgets/radiobutton.hpp b/src/guichan/include/guichan/widgets/radiobutton.hpp
index 0de04e078..ba81c1f8e 100644
--- a/src/guichan/include/guichan/widgets/radiobutton.hpp
+++ b/src/guichan/include/guichan/widgets/radiobutton.hpp
@@ -71,7 +71,6 @@ namespace gcn
public KeyListener
{
public:
-
/**
* Constructor.
*/
@@ -204,6 +203,6 @@ namespace gcn
*/
static GroupMap mGroupMap;
};
-}
+} // namespace gcn
-#endif // end GCN_RADIOBUTTON_HPP
+#endif // end GCN_RADIOBUTTON_HPP
diff --git a/src/guichan/include/guichan/widgets/scrollarea.hpp b/src/guichan/include/guichan/widgets/scrollarea.hpp
index 32a3f8f5b..50549e370 100644
--- a/src/guichan/include/guichan/widgets/scrollarea.hpp
+++ b/src/guichan/include/guichan/widgets/scrollarea.hpp
@@ -63,7 +63,6 @@ namespace gcn
public MouseListener
{
public:
-
/**
* Scrollpolicies for the horizontal and vertical scrollbar.
* The policies are:
@@ -90,7 +89,7 @@ namespace gcn
*
* @param content The content of the scroll area.
*/
- ScrollArea(Widget *const content);
+ explicit ScrollArea(Widget *const content);
/**
* Constructor.
@@ -101,8 +100,8 @@ namespace gcn
* @param vPolicy The policy for the vertical scrollbar. See enum with
* policies.
*/
- ScrollArea(Widget *content,
- ScrollPolicy hPolicy,
+ ScrollArea(Widget *content,
+ ScrollPolicy hPolicy,
ScrollPolicy vPolicy);
A_DELETE_COPY(ScrollArea)
@@ -325,8 +324,7 @@ namespace gcn
* @return True if the scroll area is opaque, false otherwise.
*/
bool isOpaque() const;
-
-
+
// Inherited from BasicContainer
virtual void showWidgetPart(Widget* widget, Rectangle area);
@@ -528,6 +526,6 @@ namespace gcn
*/
bool mOpaque;
};
-}
+} // namespace gcn
-#endif // end GCN_SCROLLAREA_HPP
+#endif // end GCN_SCROLLAREA_HPP
diff --git a/src/guichan/include/guichan/widgets/slider.hpp b/src/guichan/include/guichan/widgets/slider.hpp
index 43e301229..c4229a514 100644
--- a/src/guichan/include/guichan/widgets/slider.hpp
+++ b/src/guichan/include/guichan/widgets/slider.hpp
@@ -65,7 +65,6 @@ namespace gcn
public KeyListener
{
public:
-
/**
* Draw orientations for the slider. A slider can be drawn vertically or
* horizontally.
@@ -81,7 +80,7 @@ namespace gcn
*
* @param scaleEnd The end value of the slider scale.
*/
- Slider(const double scaleEnd = 1.0);
+ explicit Slider(const double scaleEnd = 1.0);
/**
* Constructor.
@@ -224,7 +223,6 @@ namespace gcn
virtual void keyPressed(KeyEvent& keyEvent) override;
protected:
-
/**
* Converts a marker position to a value in the scale.
*
@@ -287,6 +285,6 @@ namespace gcn
*/
Orientation mOrientation;
};
-}
+} // namespace gcn
-#endif // end GCN_SLIDER_HPP
+#endif // end GCN_SLIDER_HPP
diff --git a/src/guichan/include/guichan/widgets/textbox.hpp b/src/guichan/include/guichan/widgets/textbox.hpp
index ba26966cc..8900936ab 100644
--- a/src/guichan/include/guichan/widgets/textbox.hpp
+++ b/src/guichan/include/guichan/widgets/textbox.hpp
@@ -75,7 +75,7 @@ namespace gcn
*
* @param text The default text of the text box.
*/
- TextBox(const std::string& text);
+ explicit TextBox(const std::string& text);
A_DELETE_COPY(TextBox)
@@ -287,6 +287,6 @@ namespace gcn
*/
bool mOpaque;
};
-}
+} // namespace gcn
-#endif // end GCN_TEXTBOX_HPP
+#endif // end GCN_TEXTBOX_HPP
diff --git a/src/guichan/include/guichan/widgets/textfield.hpp b/src/guichan/include/guichan/widgets/textfield.hpp
index 27c4aee26..6b048a03b 100644
--- a/src/guichan/include/guichan/widgets/textfield.hpp
+++ b/src/guichan/include/guichan/widgets/textfield.hpp
@@ -74,7 +74,7 @@ namespace gcn
*
* @param text The default text of the text field.
*/
- TextField(const std::string& text);
+ explicit TextField(const std::string& text);
A_DELETE_COPY(TextField)
@@ -167,6 +167,6 @@ namespace gcn
*/
int mXScroll;
};
-}
+} // namespace gcn
-#endif // end GCN_TEXTFIELD_HPP
+#endif // end GCN_TEXTFIELD_HPP
diff --git a/src/guichan/include/guichan/widgets/window.hpp b/src/guichan/include/guichan/widgets/window.hpp
index 442e3da1b..436664e24 100644
--- a/src/guichan/include/guichan/widgets/window.hpp
+++ b/src/guichan/include/guichan/widgets/window.hpp
@@ -71,7 +71,7 @@ namespace gcn
*
* @param caption the caption of the window.
*/
- Window(const std::string& caption);
+ explicit Window(const std::string& caption);
A_DELETE_COPY(Window)
@@ -246,6 +246,6 @@ namespace gcn
*/
bool mMoved;
};
-}
+} // namespace gcn
-#endif // end GCN_WINDOW_HPP
+#endif // end GCN_WINDOW_HPP
diff --git a/src/guichan/mouseinput.cpp b/src/guichan/mouseinput.cpp
index b0b36e410..929e2886b 100644
--- a/src/guichan/mouseinput.cpp
+++ b/src/guichan/mouseinput.cpp
@@ -114,4 +114,4 @@ namespace gcn
{
return mY;
}
-}
+} // namespace gcn
diff --git a/src/guichan/sdl/sdlgraphics.cpp b/src/guichan/sdl/sdlgraphics.cpp
index 9678f7a60..a44acf458 100644
--- a/src/guichan/sdl/sdlgraphics.cpp
+++ b/src/guichan/sdl/sdlgraphics.cpp
@@ -63,7 +63,6 @@
namespace gcn
{
-
SDLGraphics::SDLGraphics() :
Graphics(),
mTarget(nullptr),
diff --git a/src/guichan/widget.cpp b/src/guichan/widget.cpp
index dcd64371e..d1150dbf0 100644
--- a/src/guichan/widget.cpp
+++ b/src/guichan/widget.cpp
@@ -110,8 +110,8 @@ namespace gcn
{
BLOCK_START("Widget::drawFrame")
const Color &faceColor = getBaseColor();
- Color highlightColor = faceColor + 0x303030;
- Color shadowColor = faceColor - 0x303030;
+ Color highlightColor = faceColor + Color(0x303030);
+ Color shadowColor = faceColor - Color(0x303030);
const int alpha = getBaseColor().a;
const int width = getWidth() + getFrameSize() * 2 - 1;
const int height = getHeight() + getFrameSize() * 2 - 1;