Code-style consistency improvement:

Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files.
make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type.
This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
erwincoumans
2018-09-23 14:17:31 -07:00
parent b73b05e9fb
commit ab8f16961e
1773 changed files with 1081087 additions and 474249 deletions

View File

@@ -12,79 +12,75 @@
#include "Gwen/Controls/Base.h"
#include "Gwen/Controls/Label.h"
namespace Gwen
namespace Gwen
{
namespace Controls
namespace Controls
{
class ImagePanel;
class GWEN_EXPORT Button : public Label
{
public:
GWEN_CONTROL(Button, Label);
virtual void Render(Skin::Base* skin);
virtual void OnMouseClickLeft(int x, int y, bool bDown);
virtual void OnMouseDoubleClickLeft(int x, int y);
virtual bool OnKeySpace(bool bDown);
virtual void OnPress();
virtual void AcceleratePressed();
virtual bool IsDepressed() const { return m_bDepressed; }
//
// Buttons can be toggle type, which means that it is
// toggled on and off. Its toggle status is in IsDepressed.
//
virtual void SetIsToggle(bool b) { m_bToggle = b; }
virtual bool IsToggle() const { return m_bToggle; }
virtual bool GetToggleState() const { return m_bToggleStatus; }
virtual void SetToggleState(bool b);
virtual void Toggle() { SetToggleState(!GetToggleState()); }
virtual void SetImage(const TextObject& strName, bool bCenter = false);
// You can use this to trigger OnPress directly from other controls using GWEN_CALL_EX
virtual void ReceiveEventPress(Base* /*pControl*/)
{
class ImagePanel;
class GWEN_EXPORT Button : public Label
{
public:
GWEN_CONTROL( Button, Label );
virtual void Render( Skin::Base* skin );
virtual void OnMouseClickLeft( int x, int y, bool bDown );
virtual void OnMouseDoubleClickLeft( int x, int y );
virtual bool OnKeySpace( bool bDown );
virtual void OnPress();
virtual void AcceleratePressed();
virtual bool IsDepressed() const { return m_bDepressed; }
//
// Buttons can be toggle type, which means that it is
// toggled on and off. Its toggle status is in IsDepressed.
//
virtual void SetIsToggle( bool b ){ m_bToggle = b; }
virtual bool IsToggle() const { return m_bToggle; }
virtual bool GetToggleState() const { return m_bToggleStatus; }
virtual void SetToggleState( bool b );
virtual void Toggle(){ SetToggleState( !GetToggleState() ); }
virtual void SetImage( const TextObject& strName, bool bCenter = false );
// You can use this to trigger OnPress directly from other controls using GWEN_CALL_EX
virtual void ReceiveEventPress( Base* /*pControl*/ )
{
OnPress();
}
virtual void SizeToContents();
virtual void Layout( Skin::Base* pSkin );
virtual bool OnKeyReturn(bool bDown)
{
onKeyboardReturn.Call(this);
return true;
}
public:
Gwen::Event::Caller onPress;
Gwen::Event::Caller onDown;
Gwen::Event::Caller onUp;
Gwen::Event::Caller onDoubleClick;
Gwen::Event::Caller onKeyboardReturn;
Gwen::Event::Caller onToggle;
Gwen::Event::Caller onToggleOn;
Gwen::Event::Caller onToggleOff;
protected:
ImagePanel* m_Image;
bool m_bDepressed;
bool m_bToggle;
bool m_bToggleStatus;
bool m_bCenterImage;
};
OnPress();
}
}
virtual void SizeToContents();
virtual void Layout(Skin::Base* pSkin);
virtual bool OnKeyReturn(bool bDown)
{
onKeyboardReturn.Call(this);
return true;
}
public:
Gwen::Event::Caller onPress;
Gwen::Event::Caller onDown;
Gwen::Event::Caller onUp;
Gwen::Event::Caller onDoubleClick;
Gwen::Event::Caller onKeyboardReturn;
Gwen::Event::Caller onToggle;
Gwen::Event::Caller onToggleOn;
Gwen::Event::Caller onToggleOff;
protected:
ImagePanel* m_Image;
bool m_bDepressed;
bool m_bToggle;
bool m_bToggleStatus;
bool m_bCenterImage;
};
} // namespace Controls
} // namespace Gwen
#endif