From be9b998b2ee87c0238c2ed1b41c8c2bc723f4ce4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 28 Jul 2014 20:06:11 +0300 Subject: Fix formatting in gui files. --- src/gui/widgets/avatarlistbox.h | 38 +++--- src/gui/widgets/guitable.h | 213 +++++++++++++++++---------------- src/gui/widgets/tabs/setup_relations.h | 44 +++---- 3 files changed, 149 insertions(+), 146 deletions(-) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/avatarlistbox.h b/src/gui/widgets/avatarlistbox.h index e0711a7b7..0ae0b5ee9 100644 --- a/src/gui/widgets/avatarlistbox.h +++ b/src/gui/widgets/avatarlistbox.h @@ -34,33 +34,33 @@ class Image; class AvatarListBox final : public ListBox, public ConfigListener { -public: - AvatarListBox(const Widget2 *const widget, - AvatarListModel *const model); + public: + AvatarListBox(const Widget2 *const widget, + AvatarListModel *const model); - A_DELETE_COPY(AvatarListBox) + A_DELETE_COPY(AvatarListBox) - ~AvatarListBox(); + ~AvatarListBox(); - /** - * Draws the list box. - */ - void draw(Graphics *gcnGraphics) override final; + /** + * Draws the list box. + */ + void draw(Graphics *gcnGraphics) override final; - void mousePressed(MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; - void mouseReleased(MouseEvent &event A_UNUSED) override final; + void mouseReleased(MouseEvent &event A_UNUSED) override final; - void optionChanged(const std::string &value) override final; + void optionChanged(const std::string &value) override final; -private: - int mImagePadding; - bool mShowGender; - bool mShowLevel; + private: + int mImagePadding; + bool mShowGender; + bool mShowLevel; - static int instances; - static Image *onlineIcon; - static Image *offlineIcon; + static int instances; + static Image *onlineIcon; + static Image *offlineIcon; }; #endif // GUI_WIDGETS_AVATARLISTBOX_H diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index 4f4e2cfa3..d0deb9ba0 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -53,150 +53,153 @@ class GuiTable final : public Widget, // so that the action listener can call distributeActionEvent friend class GuiTableActionListener; -public: - GuiTable(const Widget2 *const widget, - TableModel *const initial_model, - const bool opacity = true); + public: + GuiTable(const Widget2 *const widget, + TableModel *const initial_model, + const bool opacity = true); - A_DELETE_COPY(GuiTable) + A_DELETE_COPY(GuiTable) - ~GuiTable(); + ~GuiTable(); - /** - * Retrieves the active table model - */ - const TableModel *getModel() const A_WARN_UNUSED; + /** + * Retrieves the active table model + */ + const TableModel *getModel() const A_WARN_UNUSED; - /** - * Sets the table model - * - * Note that actions issued by widgets returned from the model will update - * the table selection, but only AFTER any event handlers installed within - * the widget have been triggered. To be notified after such an update, add - * an action listener to the table instead. - */ - void setModel(TableModel *const m); + /** + * Sets the table model + * + * Note that actions issued by widgets returned from the model will + * update the table selection, but only AFTER any event handlers + * installed within the widget have been triggered. To be notified + * after such an update, add an action listener to the table instead. + */ + void setModel(TableModel *const m); - void setSelected(const int row, const int column); + void setSelected(const int row, const int column); - int getSelectedRow() const A_WARN_UNUSED; + int getSelectedRow() const A_WARN_UNUSED; - int getSelectedColumn() const A_WARN_UNUSED; + int getSelectedColumn() const A_WARN_UNUSED; - void setSelectedRow(const int selected); + void setSelectedRow(const int selected); - void setSelectedColumn(const int selected); + void setSelectedColumn(const int selected); - bool isWrappingEnabled() const A_WARN_UNUSED - { return mWrappingEnabled; } + bool isWrappingEnabled() const A_WARN_UNUSED + { return mWrappingEnabled; } - void setWrappingEnabled(bool wrappingEnabled) - { mWrappingEnabled = wrappingEnabled; } + void setWrappingEnabled(bool wrappingEnabled) + { mWrappingEnabled = wrappingEnabled; } - Rect getChildrenArea() override final A_WARN_UNUSED; + Rect getChildrenArea() override final A_WARN_UNUSED; - /** - * Toggle whether to use linewise selection mode, in which the table selects - * an entire line at a time, rather than a single cell. - * - * Note that column information is tracked even in linewise selection mode; - * this mode therefore only affects visualisation. - * - * Disabled by default. - * - * \param linewise: Whether to enable linewise selection mode - */ - void setLinewiseSelection(bool linewise) - { - mLinewiseMode = linewise; - } + /** + * Toggle whether to use linewise selection mode, in which the table + * selects an entire line at a time, rather than a single cell. + * + * Note that column information is tracked even in linewise selection + * mode; + * + * this mode therefore only affects visualisation. + * + * Disabled by default. + * + * \param linewise: Whether to enable linewise selection mode + */ + void setLinewiseSelection(bool linewise) + { mLinewiseMode = linewise;} - // Inherited from Widget - void draw(Graphics* graphics) override final; + // Inherited from Widget + void draw(Graphics* graphics) override final; - Widget *getWidgetAt(int x, int y) override final A_WARN_UNUSED; + Widget *getWidgetAt(int x, int y) override final A_WARN_UNUSED; - void moveToTop(Widget *child) override final; + void moveToTop(Widget *child) override final; - void moveToBottom(Widget *child) override final; + 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; + // Inherited from KeyListener + void keyPressed(KeyEvent& event) override final; - /** - * Sets the table to be opaque, that is sets the table - * to display its background. - * - * @param opaque True if the table should be opaque, false otherwise. - */ - void setOpaque(bool opaque) - { mOpaque = opaque; } + /** + * Sets the table to be opaque, that is sets the table + * to display its background. + * + * @param opaque True if the table should be opaque, false otherwise. + */ + void setOpaque(bool opaque) + { mOpaque = opaque; } - /** - * Checks if the table is opaque, that is if the table area displays its - * background. - * - * @return True if the table is opaque, false otherwise. - */ - bool isOpaque() const A_WARN_UNUSED - { return mOpaque; } + /** + * Checks if the table is opaque, that is if the table area displays + * its background. + * + * @return True if the table is opaque, false otherwise. + */ + bool isOpaque() const A_WARN_UNUSED + { return mOpaque; } - // Inherited from MouseListener - void mousePressed(MouseEvent& event) override final; + // Inherited from MouseListener + void mousePressed(MouseEvent& event) override final; - void mouseWheelMovedUp(MouseEvent& event) override final; + void mouseWheelMovedUp(MouseEvent& event) override final; - void mouseWheelMovedDown(MouseEvent& event) override final; + void mouseWheelMovedDown(MouseEvent& event) override final; - void mouseDragged(MouseEvent& event) override final; + void mouseDragged(MouseEvent& event) override final; - // Constraints inherited from TableModelListener - void modelUpdated(const bool completed) override final; + // Constraints inherited from TableModelListener + void modelUpdated(const bool completed) override final; - void requestFocus(); + void requestFocus(); - void setSelectable(bool b) - { mSelectable = b; } + void setSelectable(bool b) + { mSelectable = b; } -protected: - /** Frees all action listeners on inner widgets. */ - void uninstallActionListeners(); - /** Installs all action listeners on inner widgets. */ - void installActionListeners(); + protected: + /** Frees all action listeners on inner widgets. */ + void uninstallActionListeners(); - int getRowHeight() const A_WARN_UNUSED; + /** Installs all action listeners on inner widgets. */ + void installActionListeners(); - int getColumnWidth(const int i) const A_WARN_UNUSED; + int getRowHeight() const A_WARN_UNUSED; -private: - int getRowForY(int y) const A_WARN_UNUSED; // -1 on error - int getColumnForX(int x) const A_WARN_UNUSED; // -1 on error - void recomputeDimensions(); + int getColumnWidth(const int i) const A_WARN_UNUSED; - static float mAlpha; + private: + int getRowForY(int y) const A_WARN_UNUSED; // -1 on error - TableModel *mModel; + int getColumnForX(int x) const A_WARN_UNUSED; // -1 on error - /** If someone moves a fresh widget to the top, we must display it. */ - Widget *mTopWidget; + void recomputeDimensions(); - /** Vector for compactness; used as a list in practice. */ - std::vector mActionListeners2; + static float mAlpha; - /** - * Holds the background color of the table. - */ - Color mHighlightColor; + TableModel *mModel; - int mSelectedRow; - int mSelectedColumn; + /** If someone moves a fresh widget to the top, we must display it. */ + Widget *mTopWidget; - bool mLinewiseMode; - bool mWrappingEnabled; - bool mOpaque; - bool mSelectable; + /** Vector for compactness; used as a list in practice. */ + std::vector mActionListeners2; + + /** + * Holds the background color of the table. + */ + Color mHighlightColor; + + int mSelectedRow; + int mSelectedColumn; + + bool mLinewiseMode; + bool mWrappingEnabled; + bool mOpaque; + bool mSelectable; }; #endif // GUI_WIDGETS_GUITABLE_H diff --git a/src/gui/widgets/tabs/setup_relations.h b/src/gui/widgets/tabs/setup_relations.h index 9fc197ffc..7d133f9c9 100644 --- a/src/gui/widgets/tabs/setup_relations.h +++ b/src/gui/widgets/tabs/setup_relations.h @@ -41,41 +41,41 @@ class StaticTableModel; class Setup_Relations final : public SetupTab, public PlayerRelationsListener { -public: - explicit Setup_Relations(const Widget2 *const widget); + public: + explicit Setup_Relations(const Widget2 *const widget); - A_DELETE_COPY(Setup_Relations) + A_DELETE_COPY(Setup_Relations) - ~Setup_Relations(); + ~Setup_Relations(); - void apply() override final; + void apply() override final; - void cancel() override final; + void cancel() override final; - void reset(); + void reset(); - void action(const ActionEvent &event) override final; + void action(const ActionEvent &event) override final; - void updatedPlayer(const std::string &name); + void updatedPlayer(const std::string &name); - void updateAll(); + void updateAll(); - void externalUpdated() override final; + void externalUpdated() override final; -private: - StaticTableModel *mPlayerTableTitleModel; - PlayerTableModel *mPlayerTableModel; - GuiTable *mPlayerTable; - GuiTable *mPlayerTitleTable; - ScrollArea *mPlayerScrollArea; + private: + StaticTableModel *mPlayerTableTitleModel; + PlayerTableModel *mPlayerTableModel; + GuiTable *mPlayerTable; + GuiTable *mPlayerTitleTable; + ScrollArea *mPlayerScrollArea; - CheckBox *mDefaultTrading; - CheckBox *mDefaultWhisper; + CheckBox *mDefaultTrading; + CheckBox *mDefaultWhisper; - Button *mDeleteButton; + Button *mDeleteButton; - ListModel *mIgnoreActionChoicesModel; - DropDown *mIgnoreActionChoicesBox; + ListModel *mIgnoreActionChoicesModel; + DropDown *mIgnoreActionChoicesBox; }; #endif // GUI_WIDGETS_TABS_SETUP_RELATIONS_H -- cgit v1.2.3-70-g09d2