diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-11-28 19:05:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-11-28 19:05:52 +0300 |
commit | b6eb53b9abdf48b88cb1978b9af97f2a879d2717 (patch) | |
tree | 5aad5623d352ec0b4aa245856958c61a384861c7 /src/gui/widgets | |
parent | 4d453108f45f9fb2ff4f5715cc1b3ddd63d36a80 (diff) | |
parent | 71fe51d38a406012e166589b7b720d83c1ab3ade (diff) | |
download | plus-stripped1.1.11.27.tar.gz plus-stripped1.1.11.27.tar.bz2 plus-stripped1.1.11.27.tar.xz plus-stripped1.1.11.27.zip |
Merge commit 'v1.1.11.27' into strippedstripped1.1.11.27
Conflicts:
data/Makefile.am
Diffstat (limited to 'src/gui/widgets')
30 files changed, 35 insertions, 169 deletions
diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h index 4e077fafb..962c0b363 100644 --- a/src/gui/widgets/chattab.h +++ b/src/gui/widgets/chattab.h @@ -28,11 +28,7 @@ #include "gui/widgets/browserbox.h" #include "gui/widgets/tab.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif +#include "localconsts.h" class ScrollArea; @@ -58,6 +54,7 @@ class ChatTab : public Tab * Constructor. */ ChatTab(const std::string &name); + ~ChatTab(); /** @@ -106,7 +103,8 @@ class ChatTab : public Tab * Add any extra help text to the output. Allows tabs to define help * for commands defined by the tab itself. */ - virtual void showHelp() {} + virtual void showHelp() + { } /** * Handle special commands. Allows a tab to handle commands it diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h index 4e293aad6..af38065f5 100644 --- a/src/gui/widgets/checkbox.h +++ b/src/gui/widgets/checkbox.h @@ -27,12 +27,6 @@ #include "localconsts.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; /** diff --git a/src/gui/widgets/desktop.h b/src/gui/widgets/desktop.h index 6364ecfe9..b1f059ffe 100644 --- a/src/gui/widgets/desktop.h +++ b/src/gui/widgets/desktop.h @@ -27,12 +27,6 @@ #include <guichan/widgetlistener.hpp> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; /** diff --git a/src/gui/widgets/dropshortcutcontainer.h b/src/gui/widgets/dropshortcutcontainer.h index 348f48567..1f03fd53b 100644 --- a/src/gui/widgets/dropshortcutcontainer.h +++ b/src/gui/widgets/dropshortcutcontainer.h @@ -28,12 +28,6 @@ #include "gui/widgets/shortcutcontainer.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; class Item; class ItemPopup; diff --git a/src/gui/widgets/emoteshortcutcontainer.h b/src/gui/widgets/emoteshortcutcontainer.h index 06c009f0b..743ca4e87 100644 --- a/src/gui/widgets/emoteshortcutcontainer.h +++ b/src/gui/widgets/emoteshortcutcontainer.h @@ -27,12 +27,6 @@ #include <vector> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class AnimatedSprite; class Image; class TextPopup; diff --git a/src/gui/widgets/flowcontainer.h b/src/gui/widgets/flowcontainer.h index 2ef6035f0..d1f276b3c 100644 --- a/src/gui/widgets/flowcontainer.h +++ b/src/gui/widgets/flowcontainer.h @@ -26,12 +26,6 @@ #include <guichan/widgetlistener.hpp> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - /** * A container that arranges its contents like words on a page. * diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index cf3cb8ad8..17f517644 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -33,12 +33,6 @@ #include <vector> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class GuiTableActionListener; /** diff --git a/src/gui/widgets/horizontcontainer.h b/src/gui/widgets/horizontcontainer.h index 80014c171..2a3f77d2b 100644 --- a/src/gui/widgets/horizontcontainer.h +++ b/src/gui/widgets/horizontcontainer.h @@ -26,12 +26,6 @@ #include <guichan/widgetlistener.hpp> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - /** * A widget container. * diff --git a/src/gui/widgets/inventoryfilter.h b/src/gui/widgets/inventoryfilter.h index be69489a8..c3762189e 100644 --- a/src/gui/widgets/inventoryfilter.h +++ b/src/gui/widgets/inventoryfilter.h @@ -27,12 +27,6 @@ #include "gui/widgets/horizontcontainer.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class InventoryFilter : public HorizontContainer, public gcn::ActionListener { public: diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h index e4188f54b..2c465fdee 100644 --- a/src/gui/widgets/itemcontainer.h +++ b/src/gui/widgets/itemcontainer.h @@ -31,12 +31,6 @@ #include <list> #include <algorithm> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; class Inventory; class Item; diff --git a/src/gui/widgets/itemlinkhandler.h b/src/gui/widgets/itemlinkhandler.h index 8dd2f62f5..bc3bdc51c 100644 --- a/src/gui/widgets/itemlinkhandler.h +++ b/src/gui/widgets/itemlinkhandler.h @@ -25,21 +25,16 @@ #include "gui/widgets/linkhandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class ItemPopup; class ItemLinkHandler : public LinkHandler { public: ItemLinkHandler(); + ~ItemLinkHandler(); - void handleLink(const std::string &link, - gcn::MouseEvent *event A_UNUSED); + + void handleLink(const std::string &link, gcn::MouseEvent *event); private: ItemPopup *mItemPopup; diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h index 473cef350..587723279 100644 --- a/src/gui/widgets/itemshortcutcontainer.h +++ b/src/gui/widgets/itemshortcutcontainer.h @@ -29,12 +29,6 @@ #include <guichan/mouselistener.hpp> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; class Item; class ItemPopup; diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp index 7f2f1f621..f0359062e 100644 --- a/src/gui/widgets/layout.cpp +++ b/src/gui/widgets/layout.cpp @@ -222,11 +222,15 @@ LayoutCell &LayoutArray::place(gcn::Widget *widget, int x, int y, int w, int h) return cell; } -void LayoutArray::align(int &pos, int &size, int dim, - LayoutCell const &cell, int *sizes) const +void LayoutArray::align(int &pos, int &size, int dim, LayoutCell const &cell, + int *sizes, int sizeCount) const { int size_max = sizes[0]; - for (int i = 1; i < cell.mExtent[dim]; ++i) + int cnt = cell.mExtent[dim]; + if (sizeCount && cell.mExtent[dim] > sizeCount) + cnt = sizeCount; + + for (int i = 1; i < cnt; ++i) size_max += sizes[i] + mSpacing; size = std::min<int>(cell.mSize[dim], size_max); @@ -274,7 +278,8 @@ std::vector<int> LayoutArray::getSizes(int dim, int upp) const } } - if (upp == Layout::AUTO_DEF) return sizes; + if (upp == Layout::AUTO_DEF) + return sizes; // Compute the FILL sizes. int nb = static_cast<int>(sizes.size()); @@ -343,8 +348,10 @@ void LayoutArray::reflow(int nx, int ny, int nw, int nh) if (cell && cell->mType != LayoutCell::NONE) { int dx = x, dy = y, dw = 0, dh = 0; - align(dx, dw, 0, *cell, &widths[gridX]); - align(dy, dh, 1, *cell, &heights[gridY]); + align(dx, dw, 0, *cell, &widths[gridX], + widths.size() - gridX); + align(dy, dh, 1, *cell, &heights[gridY], + heights.size() - gridY); cell->reflow(dx, dy, dw, dh); } x += widths[gridX] + mSpacing; diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h index c4c703644..754d13a0b 100644 --- a/src/gui/widgets/layout.h +++ b/src/gui/widgets/layout.h @@ -127,8 +127,8 @@ class LayoutArray /** * Gets the position and size of a widget along a given axis */ - void align(int &pos, int &size, int dim, - LayoutCell const &cell, int *sizes) const; + void align(int &pos, int &size, int dim, LayoutCell const &cell, + int *sizes, int sizeCount) const; /** * Ensures the private vectors are large enough. diff --git a/src/gui/widgets/layouthelper.h b/src/gui/widgets/layouthelper.h index c38356c07..a01051595 100644 --- a/src/gui/widgets/layouthelper.h +++ b/src/gui/widgets/layouthelper.h @@ -27,12 +27,6 @@ #include <guichan/widgetlistener.hpp> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - /** * A helper class for adding a layout to a Guichan container widget. The layout * will register itself as a widget listener and relayout the widgets in the diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index 418b83f58..8ac0bbc3b 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -25,12 +25,6 @@ #include <guichan/widgets/listbox.hpp> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class SelectionListener; /** diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h index 9d4343ba3..64e4b52ac 100644 --- a/src/gui/widgets/popup.h +++ b/src/gui/widgets/popup.h @@ -32,12 +32,6 @@ #include <guichan/mouselistener.hpp> #include <guichan/widgetlistener.hpp> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class GraphicsVertexes; class Skin; class WindowContainer; diff --git a/src/gui/widgets/radiobutton.h b/src/gui/widgets/radiobutton.h index 677195bd6..d1c347acb 100644 --- a/src/gui/widgets/radiobutton.h +++ b/src/gui/widgets/radiobutton.h @@ -25,12 +25,6 @@ #include <guichan/widgets/radiobutton.hpp> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; /** diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h index 56e21c58c..105791080 100644 --- a/src/gui/widgets/scrollarea.h +++ b/src/gui/widgets/scrollarea.h @@ -26,12 +26,6 @@ #include <guichan/widgets/scrollarea.hpp> #include <guichan/widgetlistener.hpp> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class GraphicsVertexes; class Image; class ImageRect; diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h index 15d2d41ea..5b8a9df87 100644 --- a/src/gui/widgets/setupitem.h +++ b/src/gui/widgets/setupitem.h @@ -33,12 +33,6 @@ #include <list> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class CheckBox; class Configuration; class ContainerPlacer; diff --git a/src/gui/widgets/setuptabscroll.h b/src/gui/widgets/setuptabscroll.h index d2aa7002f..2b0c6f65e 100644 --- a/src/gui/widgets/setuptabscroll.h +++ b/src/gui/widgets/setuptabscroll.h @@ -26,11 +26,7 @@ #include <map> #include <set> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif +#include "localconsts.h" class SetupItem; class ScrollArea; diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h index 38e238f20..c5acbbefc 100644 --- a/src/gui/widgets/shoplistbox.h +++ b/src/gui/widgets/shoplistbox.h @@ -25,12 +25,6 @@ #include "gui/widgets/listbox.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class ShopItems; class ItemPopup; @@ -82,7 +76,7 @@ class ShopListBox : public ListBox void mouseMoved(gcn::MouseEvent &event); - void mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED); + void mouseExited(gcn::MouseEvent& mouseEvent); private: void init(); diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h index df8529bd5..8587950c6 100644 --- a/src/gui/widgets/shortcutcontainer.h +++ b/src/gui/widgets/shortcutcontainer.h @@ -29,12 +29,6 @@ #include "gui/widgets/tab.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; /** @@ -55,7 +49,8 @@ class ShortcutContainer : public gcn::Widget, /** * Destructor. */ - ~ShortcutContainer() {} + ~ShortcutContainer() + { } /** * Draws the shortcuts diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h index 619c0c795..9ac45d0a0 100644 --- a/src/gui/widgets/slider.h +++ b/src/gui/widgets/slider.h @@ -25,12 +25,6 @@ #include <guichan/widgets/slider.hpp> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; /** diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h index 88b00338a..4191f9921 100644 --- a/src/gui/widgets/spellshortcutcontainer.h +++ b/src/gui/widgets/spellshortcutcontainer.h @@ -27,13 +27,6 @@ #include <guichan/mouselistener.hpp> #include "gui/widgets/shortcutcontainer.h" -//#include "textcommand.h" - -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif class Image; class SpellPopup; diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index af241d7c5..d71109dd3 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -32,12 +32,6 @@ #include <string> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Tab; /** diff --git a/src/gui/widgets/vertcontainer.h b/src/gui/widgets/vertcontainer.h index 3b0ceeca7..08546aa47 100644 --- a/src/gui/widgets/vertcontainer.h +++ b/src/gui/widgets/vertcontainer.h @@ -28,12 +28,6 @@ #include <vector> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - /** * A widget container. * diff --git a/src/gui/widgets/whispertab.cpp b/src/gui/widgets/whispertab.cpp index c99c4e0c5..33859d8be 100644 --- a/src/gui/widgets/whispertab.cpp +++ b/src/gui/widgets/whispertab.cpp @@ -165,3 +165,8 @@ void WhisperTab::saveToLogFile(std::string &msg) if (chatLogger) chatLogger->log(getNick(), msg); } + +void WhisperTab::getAutoCompleteList(std::vector<std::string> &names) const +{ + names.push_back(mNick); +} diff --git a/src/gui/widgets/whispertab.h b/src/gui/widgets/whispertab.h index 5bca422a6..8678c932c 100644 --- a/src/gui/widgets/whispertab.h +++ b/src/gui/widgets/whispertab.h @@ -33,7 +33,8 @@ class Channel; class WhisperTab : public ChatTab { public: - const std::string &getNick() const { return mNick; } + const std::string &getNick() const + { return mNick; } void showHelp(); @@ -45,6 +46,8 @@ class WhisperTab : public ChatTab void saveToLogFile(std::string &msg); + void getAutoCompleteList(std::vector<std::string> &names) const; + protected: friend class ChatWindow; diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index 5ace2328e..6249626d3 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -31,12 +31,6 @@ #include <guichan/widgets/window.hpp> -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class ContainerPlacer; class GraphicsVertexes; class Layout; |