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

@@ -4,7 +4,6 @@
See license in Gwen.h
*/
#include "Gwen/Gwen.h"
#include "Gwen/Skin.h"
#include "Gwen/Controls/TabButton.h"
@@ -15,33 +14,30 @@
using namespace Gwen;
using namespace Gwen::Controls;
GWEN_CONTROL_CONSTRUCTOR( TabButton )
GWEN_CONTROL_CONSTRUCTOR(TabButton)
{
m_Page = NULL;
m_Control = NULL;
SetPadding( Padding( 2, 2, 2, 2 ) );
SetPadding(Padding(2, 2, 2, 2));
DragAndDrop_SetPackage( true, "TabButtonMove" );
SetAlignment( Pos::Top | Pos::Left );
SetTextPadding( Padding( 5, 3, 3, 3 ) );
DragAndDrop_SetPackage(true, "TabButtonMove");
SetAlignment(Pos::Top | Pos::Left);
SetTextPadding(Padding(5, 3, 3, 3));
}
void TabButton::Render( Skin::Base* skin )
void TabButton::Render(Skin::Base* skin)
{
skin->DrawTabButton( this, m_Page && m_Page->Visible() );
skin->DrawTabButton(this, m_Page && m_Page->Visible());
}
void TabButton::SetTabControl( TabControl* ctrl )
void TabButton::SetTabControl(TabControl* ctrl)
{
if ( m_Control == ctrl ) return;
if (m_Control == ctrl) return;
if ( m_Control )
if (m_Control)
{
m_Control->OnLoseTab( this );
m_Control->OnLoseTab(this);
}
m_Control = ctrl;
@@ -52,47 +48,44 @@ bool TabButton::DragAndDrop_ShouldStartDrag()
return m_Control->DoesAllowDrag();
}
bool TabButton::OnKeyUp( bool bDown )
bool TabButton::OnKeyUp(bool bDown)
{
OnKeyLeft( bDown );
OnKeyLeft(bDown);
return true;
}
bool TabButton::OnKeyDown( bool bDown )
bool TabButton::OnKeyDown(bool bDown)
{
OnKeyRight( bDown );
OnKeyRight(bDown);
return true;
}
bool TabButton::OnKeyLeft( bool bDown )
bool TabButton::OnKeyLeft(bool bDown)
{
if ( bDown )
if (bDown)
{
Base::List::reverse_iterator it = std::find( m_Parent->Children.rbegin(), m_Parent->Children.rend(), this );
if ( it != m_Parent->Children.rend() && (++it != m_Parent->Children.rend()) )
Base::List::reverse_iterator it = std::find(m_Parent->Children.rbegin(), m_Parent->Children.rend(), this);
if (it != m_Parent->Children.rend() && (++it != m_Parent->Children.rend()))
{
Base* pNextTab = *it;
GetTabControl()->OnTabPressed( pNextTab );
GetTabControl()->OnTabPressed(pNextTab);
Gwen::KeyboardFocus = pNextTab;
}
}
return true;
}
bool TabButton::OnKeyRight( bool bDown )
bool TabButton::OnKeyRight(bool bDown)
{
if ( bDown )
if (bDown)
{
Base::List::iterator it = std::find( m_Parent->Children.begin(), m_Parent->Children.end(), this );
if ( it != m_Parent->Children.end() && (++it != m_Parent->Children.end()) )
Base::List::iterator it = std::find(m_Parent->Children.begin(), m_Parent->Children.end(), this);
if (it != m_Parent->Children.end() && (++it != m_Parent->Children.end()))
{
Base* pNextTab = *it;
GetTabControl()->OnTabPressed( pNextTab );
GetTabControl()->OnTabPressed(pNextTab);
Gwen::KeyboardFocus = pNextTab;
}
}
return true;
}