diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-04-14 11:27:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-04-14 12:34:23 +0300 |
commit | a7d7346b9eb3fa62a8912e31d5c00f8e05390425 (patch) | |
tree | ba2d006e8aaac74138eb13ba458d30abf8f01182 /src/guichan | |
parent | 9569f124d176b4220f28f9a41812c33883737228 (diff) | |
download | manaverse-a7d7346b9eb3fa62a8912e31d5c00f8e05390425.tar.gz manaverse-a7d7346b9eb3fa62a8912e31d5c00f8e05390425.tar.bz2 manaverse-a7d7346b9eb3fa62a8912e31d5c00f8e05390425.tar.xz manaverse-a7d7346b9eb3fa62a8912e31d5c00f8e05390425.zip |
some more style fixes from cpplint.
Diffstat (limited to 'src/guichan')
30 files changed, 50 insertions, 71 deletions
diff --git a/src/guichan/actionevent.cpp b/src/guichan/actionevent.cpp index deda65d36..a2f80b19d 100644 --- a/src/guichan/actionevent.cpp +++ b/src/guichan/actionevent.cpp @@ -56,16 +56,14 @@ namespace gcn :Event(source), mId(id) { - } ActionEvent::~ActionEvent() { - } const std::string& ActionEvent::getId() const { return mId; } -} +} // namespace gcn diff --git a/src/guichan/basiccontainer.cpp b/src/guichan/basiccontainer.cpp index 5defa924e..e15b924c7 100644 --- a/src/guichan/basiccontainer.cpp +++ b/src/guichan/basiccontainer.cpp @@ -370,4 +370,4 @@ namespace gcn return nullptr; } -} +} // namespace gcn diff --git a/src/guichan/cliprectangle.cpp b/src/guichan/cliprectangle.cpp index 5bff1ab81..bb5547211 100644 --- a/src/guichan/cliprectangle.cpp +++ b/src/guichan/cliprectangle.cpp @@ -85,4 +85,4 @@ namespace gcn return *this; } -} +} // namespace gcn diff --git a/src/guichan/color.cpp b/src/guichan/color.cpp index 29b4f2bdc..42e4a3f57 100644 --- a/src/guichan/color.cpp +++ b/src/guichan/color.cpp @@ -92,9 +92,9 @@ namespace gcn Color Color::operator-(const Color& color) const { - Color result(r - color.r, - g - color.g, - b - color.b, + Color result(r - color.r, + g - color.g, + b - color.b, 255); result.r = (result.r > 255 ? 255 : (result.r < 0 ? 0 : result.r)); @@ -143,4 +143,4 @@ namespace gcn return out; } -} +} // namespace gcn diff --git a/src/guichan/event.cpp b/src/guichan/event.cpp index f37bf2846..ecd309f87 100644 --- a/src/guichan/event.cpp +++ b/src/guichan/event.cpp @@ -55,16 +55,14 @@ namespace gcn Event::Event(Widget *const source) : mSource(source) { - } Event::~Event() { - } Widget* Event::getSource() const { return mSource; } -} +} // namespace gcn diff --git a/src/guichan/exception.cpp b/src/guichan/exception.cpp index 0117aa2a6..b55ae6b0a 100644 --- a/src/guichan/exception.cpp +++ b/src/guichan/exception.cpp @@ -58,7 +58,6 @@ namespace gcn mFilename("?"), mLine(0) { - } Exception::Exception(const std::string& message) @@ -67,7 +66,6 @@ namespace gcn mFilename("?"), mLine(0) { - } Exception::Exception(const std::string& message, @@ -79,7 +77,6 @@ namespace gcn mFilename(filename), mLine(line) { - } const std::string& Exception::getFunction() const @@ -101,4 +98,4 @@ namespace gcn { return mLine; } -} +} // namespace gcn diff --git a/src/guichan/focushandler.cpp b/src/guichan/focushandler.cpp index 71e2d25ed..93d6ec9d4 100644 --- a/src/guichan/focushandler.cpp +++ b/src/guichan/focushandler.cpp @@ -548,4 +548,4 @@ namespace gcn { mLastWidgetPressed = lastWidgetPressed; } -} +} // namespace gcn diff --git a/src/guichan/font.cpp b/src/guichan/font.cpp index fb8d2ae41..e04ce0e83 100644 --- a/src/guichan/font.cpp +++ b/src/guichan/font.cpp @@ -65,4 +65,4 @@ namespace gcn return static_cast<int>(text.size()); } -} +} // namespace gcn diff --git a/src/guichan/graphics.cpp b/src/guichan/graphics.cpp index a17884e6f..201f5d300 100644 --- a/src/guichan/graphics.cpp +++ b/src/guichan/graphics.cpp @@ -84,7 +84,7 @@ namespace gcn carea.xOffset = area.x; carea.yOffset = area.y; mClipStack.push(carea); - return true; + return true; } const ClipRectangle &top = mClipStack.top(); @@ -127,7 +127,6 @@ namespace gcn void Graphics::popClipArea() { - if (mClipStack.empty()) throw GCN_EXCEPTION("Tried to pop clip area from empty stack."); @@ -157,4 +156,4 @@ namespace gcn { } */ -} +} // namespace gcn diff --git a/src/guichan/gui.cpp b/src/guichan/gui.cpp index a72b70f84..d91ac7ee0 100644 --- a/src/guichan/gui.cpp +++ b/src/guichan/gui.cpp @@ -479,7 +479,7 @@ namespace gcn { Widget *const widget = getWidgetAt(x, y); - //+++ possible nullpointer + // +++ possible nullpointer if (mFocusHandler->getModalMouseInputFocused() && !widget->isModalMouseInputFocused()) { @@ -493,7 +493,7 @@ namespace gcn { Widget* widget = mFocusHandler->getFocused(); - //+++ possible nullpointer + // +++ possible nullpointer while (widget->_getInternalFocusHandler() && widget->_getInternalFocusHandler()->getFocused()) { @@ -716,7 +716,7 @@ namespace gcn { BLOCK_START("Gui::handleModalMouseInputFocus") // Check if modal mouse input focus has been gained by a widget. - if ((mFocusHandler->getLastWidgetWithModalMouseInputFocus() + if ((mFocusHandler->getLastWidgetWithModalMouseInputFocus() != mFocusHandler->getModalMouseInputFocused()) && (!mFocusHandler->getLastWidgetWithModalMouseInputFocus())) { @@ -739,7 +739,7 @@ namespace gcn { BLOCK_START("Gui::handleModalFocus") // Check if modal focus has been gained by a widget. - if ((mFocusHandler->getLastWidgetWithModalFocus() + if ((mFocusHandler->getLastWidgetWithModalFocus() != mFocusHandler->getModalFocused()) && (!mFocusHandler->getLastWidgetWithModalFocus())) { @@ -827,4 +827,4 @@ namespace gcn parent = swap->getParent(); } } -} +} // namespace gcn diff --git a/src/guichan/inputevent.cpp b/src/guichan/inputevent.cpp index 30c9ada15..844ef2cbd 100644 --- a/src/guichan/inputevent.cpp +++ b/src/guichan/inputevent.cpp @@ -64,7 +64,6 @@ namespace gcn mMetaPressed(metaPressed), mIsConsumed(false) { - } bool InputEvent::isShiftPressed() const @@ -96,4 +95,4 @@ namespace gcn { return mIsConsumed; } -} +} // namespace gcn diff --git a/src/guichan/key.cpp b/src/guichan/key.cpp index ccc3e27aa..e1e72c436 100644 --- a/src/guichan/key.cpp +++ b/src/guichan/key.cpp @@ -91,4 +91,4 @@ namespace gcn { return (mValue != key.mValue); } -} +} // namespace gcn diff --git a/src/guichan/keyevent.cpp b/src/guichan/keyevent.cpp index f93dd670d..bfcc6dc9e 100644 --- a/src/guichan/keyevent.cpp +++ b/src/guichan/keyevent.cpp @@ -69,12 +69,10 @@ namespace gcn mIsNumericPad(numericPad), mKey(key) { - } KeyEvent::~KeyEvent() { - } unsigned int KeyEvent::getType() const @@ -91,4 +89,4 @@ namespace gcn { return mKey; } -} +} // namespace gcn diff --git a/src/guichan/keyinput.cpp b/src/guichan/keyinput.cpp index bf12ce418..906b6effe 100644 --- a/src/guichan/keyinput.cpp +++ b/src/guichan/keyinput.cpp @@ -61,7 +61,6 @@ namespace gcn mMetaPressed(false), mNumericPad(false) { - } void KeyInput::setType(unsigned int type) @@ -133,4 +132,4 @@ namespace gcn { mNumericPad = numpad; } -} +} // namespace gcn diff --git a/src/guichan/mouseevent.cpp b/src/guichan/mouseevent.cpp index 80ff0fcd8..352623d61 100644 --- a/src/guichan/mouseevent.cpp +++ b/src/guichan/mouseevent.cpp @@ -99,4 +99,4 @@ namespace gcn { return mType; } -} +} // namespace gcn diff --git a/src/guichan/rectangle.cpp b/src/guichan/rectangle.cpp index 02e4f31c9..ce5b72bfe 100644 --- a/src/guichan/rectangle.cpp +++ b/src/guichan/rectangle.cpp @@ -134,4 +134,4 @@ namespace gcn return out; } -} +} // namespace gcn diff --git a/src/guichan/sdl/sdlgraphics.cpp b/src/guichan/sdl/sdlgraphics.cpp index a7b6c0e3c..9678f7a60 100644 --- a/src/guichan/sdl/sdlgraphics.cpp +++ b/src/guichan/sdl/sdlgraphics.cpp @@ -274,7 +274,7 @@ namespace gcn } default: break; - } // end switch + } // end switch SDL_UnlockSurface(mTarget); } @@ -392,7 +392,7 @@ namespace gcn default: break; - } // end switch + } // end switch SDL_UnlockSurface(mTarget); } @@ -598,4 +598,4 @@ namespace gcn SDL_BlitSurface(surface, &source, mTarget, &destination); } -} +} // namespace gcn diff --git a/src/guichan/selectionevent.cpp b/src/guichan/selectionevent.cpp index 9d586bd53..eec84c5b0 100644 --- a/src/guichan/selectionevent.cpp +++ b/src/guichan/selectionevent.cpp @@ -55,11 +55,9 @@ namespace gcn SelectionEvent::SelectionEvent(Widget *const source) : Event(source) { - } SelectionEvent::~SelectionEvent() { - } -} +} // namespace gcn diff --git a/src/guichan/widget.cpp b/src/guichan/widget.cpp index 00e3decf6..dcd64371e 100644 --- a/src/guichan/widget.cpp +++ b/src/guichan/widget.cpp @@ -177,7 +177,7 @@ namespace gcn } void Widget::setDimension(const Rectangle& dimension) - { + { const Rectangle oldDimension = mDimension; mDimension = dimension; @@ -317,8 +317,8 @@ namespace gcn const Color& Widget::getSelectionColor() const { return mSelectionColor; - } - + } + void Widget::_setFocusHandler(FocusHandler* focusHandler) { if (mFocusHandler) @@ -535,7 +535,7 @@ namespace gcn if (mParent) { - return (mFocusHandler->getModalFocused() == this) + return (mFocusHandler->getModalFocused() == this) || mParent->isModalFocused(); } @@ -552,7 +552,7 @@ namespace gcn if (mParent) { - return (mFocusHandler->getModalMouseInputFocused() == this) + return (mFocusHandler->getModalMouseInputFocused() == this) || mParent->isModalMouseInputFocused(); } @@ -664,4 +664,4 @@ namespace gcn if (mParent) mParent->showWidgetPart(this, rectangle); } -} +} // namespace gcn diff --git a/src/guichan/widgets/button.cpp b/src/guichan/widgets/button.cpp index 8c0cf0f96..6ea6c8f3a 100644 --- a/src/guichan/widgets/button.cpp +++ b/src/guichan/widgets/button.cpp @@ -171,4 +171,4 @@ namespace gcn mMousePressed = false; mKeyPressed = false; } -} +} // namespace gcn diff --git a/src/guichan/widgets/checkbox.cpp b/src/guichan/widgets/checkbox.cpp index 420345eda..4e76e75d2 100644 --- a/src/guichan/widgets/checkbox.cpp +++ b/src/guichan/widgets/checkbox.cpp @@ -130,4 +130,4 @@ namespace gcn mSelected = !mSelected; distributeActionEvent(); } -} +} // namespace gcn diff --git a/src/guichan/widgets/container.cpp b/src/guichan/widgets/container.cpp index e3bbeb995..19f992519 100644 --- a/src/guichan/widgets/container.cpp +++ b/src/guichan/widgets/container.cpp @@ -64,7 +64,6 @@ namespace gcn Container::~Container() { - } void Container::draw(Graphics* graphics) @@ -115,4 +114,4 @@ namespace gcn { return BasicContainer::findWidgetById(id); } -} +} // namespace gcn diff --git a/src/guichan/widgets/label.cpp b/src/guichan/widgets/label.cpp index 9dce2bff9..db1ea6e8a 100644 --- a/src/guichan/widgets/label.cpp +++ b/src/guichan/widgets/label.cpp @@ -98,4 +98,4 @@ namespace gcn void Label::adjustSize() { } -} +} // namespace gcn diff --git a/src/guichan/widgets/listbox.cpp b/src/guichan/widgets/listbox.cpp index 834a4bb82..938d82721 100644 --- a/src/guichan/widgets/listbox.cpp +++ b/src/guichan/widgets/listbox.cpp @@ -196,7 +196,7 @@ namespace gcn { mSelectionListeners.push_back(selectionListener); } - + void ListBox::removeSelectionListener(SelectionListener* selectionListener) { mSelectionListeners.remove(selectionListener); @@ -217,4 +217,4 @@ namespace gcn { return getFont()->getHeight(); } -} +} // namespace gcn diff --git a/src/guichan/widgets/radiobutton.cpp b/src/guichan/widgets/radiobutton.cpp index 75136eb01..9be0b75c9 100644 --- a/src/guichan/widgets/radiobutton.cpp +++ b/src/guichan/widgets/radiobutton.cpp @@ -184,4 +184,4 @@ namespace gcn void RadioButton::adjustSize() { } -} +} // namespace gcn diff --git a/src/guichan/widgets/scrollarea.cpp b/src/guichan/widgets/scrollarea.cpp index 67154fbad..6874e41c9 100644 --- a/src/guichan/widgets/scrollarea.cpp +++ b/src/guichan/widgets/scrollarea.cpp @@ -414,7 +414,7 @@ namespace gcn { mHBarVisible = (getContent()->getWidth() > w); } - else // (mVPolicy == SHOW_ALWAYS) + else // (mVPolicy == SHOW_ALWAYS) { mHBarVisible = (getContent()->getWidth() > w - mScrollbarWidth); @@ -440,7 +440,7 @@ namespace gcn { mVBarVisible = (getContent()->getHeight() > h); } - else // (mHPolicy == SHOW_ALWAYS) + else // (mHPolicy == SHOW_ALWAYS) { mVBarVisible = (getContent()->getHeight() > h - mScrollbarWidth); @@ -455,7 +455,7 @@ namespace gcn { const Rectangle area = Rectangle(0, 0, mVBarVisible ? (getWidth() - mScrollbarWidth) : getWidth(), - mHBarVisible ? (getHeight() - mScrollbarWidth) : getHeight()); + mHBarVisible ? (getHeight() - mScrollbarWidth) : getHeight()); if (area.width < 0 || area.height < 0) return Rectangle(); @@ -569,13 +569,8 @@ namespace gcn mOpaque = opaque; } - bool ScrollArea::isOpaque() const { return mOpaque; } -} - -/* - * Wow! This is a looooong source file. - */ +} // namespace gcn diff --git a/src/guichan/widgets/slider.cpp b/src/guichan/widgets/slider.cpp index 4e94d82ea..7611fdfd7 100644 --- a/src/guichan/widgets/slider.cpp +++ b/src/guichan/widgets/slider.cpp @@ -270,4 +270,4 @@ namespace gcn mouseEvent.consume(); } -} +} // namespace gcn diff --git a/src/guichan/widgets/textbox.cpp b/src/guichan/widgets/textbox.cpp index c858c7ede..bfb6aff89 100644 --- a/src/guichan/widgets/textbox.cpp +++ b/src/guichan/widgets/textbox.cpp @@ -112,7 +112,6 @@ namespace gcn std::string sub = text.substr(lastPos, length); mTextRows.push_back(sub); lastPos = pos + 1; - } while (pos != std::string::npos); adjustSize(); @@ -176,7 +175,7 @@ namespace gcn { mCaretRow = row; mCaretColumn = position; - return; // we are done + return; // we are done } else { @@ -319,4 +318,4 @@ namespace gcn { mOpaque = opaque; } -} +} // namespace gcn diff --git a/src/guichan/widgets/textfield.cpp b/src/guichan/widgets/textfield.cpp index 1dcf74215..7d9bd87f6 100644 --- a/src/guichan/widgets/textfield.cpp +++ b/src/guichan/widgets/textfield.cpp @@ -142,4 +142,4 @@ namespace gcn void TextField::fontChanged() { } -} +} // namespace gcn diff --git a/src/guichan/widgets/window.cpp b/src/guichan/widgets/window.cpp index e541ef242..f04a47e9e 100644 --- a/src/guichan/widgets/window.cpp +++ b/src/guichan/widgets/window.cpp @@ -210,4 +210,4 @@ namespace gcn setSize(w + 2* getPadding(), h + getPadding() + getTitleBarHeight()); } -} +} // namespace gcn |