From f56bb35301836e56582a575a75864392a0177875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20P=2E=20Tjern=C3=B8?= Date: Mon, 2 Dec 2013 19:31:46 -0800 Subject: Fix line endings. WHAMMY. --- mp/src/vgui2/vgui_controls/BuildFactoryHelper.cpp | 208 +++++++++++----------- 1 file changed, 104 insertions(+), 104 deletions(-) (limited to 'mp/src/vgui2/vgui_controls/BuildFactoryHelper.cpp') diff --git a/mp/src/vgui2/vgui_controls/BuildFactoryHelper.cpp b/mp/src/vgui2/vgui_controls/BuildFactoryHelper.cpp index 6d3743d3..46f38cd1 100644 --- a/mp/src/vgui2/vgui_controls/BuildFactoryHelper.cpp +++ b/mp/src/vgui2/vgui_controls/BuildFactoryHelper.cpp @@ -1,104 +1,104 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// -// -// Purpose: Helper for the CHudElement class to add themselves to the list of hud elements -// -// $NoKeywords: $ -//=============================================================================// -#include "vgui/IVGui.h" -#include "vgui_controls/MessageMap.h" - -// memdbgon must be the last include file in a .cpp file!!! -#include "tier0/memdbgon.h" - -using namespace vgui; - -// Start with empty list -CBuildFactoryHelper *CBuildFactoryHelper::m_sHelpers = NULL; - -//----------------------------------------------------------------------------- -// Purpose: Constructs a panel factory -// Input : pfnCreate - fn Ptr to a function which generates a panel -//----------------------------------------------------------------------------- -CBuildFactoryHelper::CBuildFactoryHelper( char const *className, PANELCREATEFUNC func ) -{ - // Make this fatal - if ( HasFactory( className ) ) - { - Error( "CBuildFactoryHelper: Factory for '%s' already exists!!!!\n", className ); - } - - //List is empty, or element belongs at front, insert here - m_pNext = m_sHelpers; - m_sHelpers = this; - - Assert( func ); - m_CreateFunc = func; - Assert( className ); - m_pClassName = className; -} - -//----------------------------------------------------------------------------- -// Purpose: Returns next object in list -// Output : CBuildFactoryHelper -//----------------------------------------------------------------------------- -CBuildFactoryHelper *CBuildFactoryHelper::GetNext( void ) -{ - return m_pNext; -} - -char const *CBuildFactoryHelper::GetClassName() const -{ - return m_pClassName; -} - -vgui::Panel *CBuildFactoryHelper::CreatePanel() -{ - if ( !m_CreateFunc ) - return NULL; - - return ( *m_CreateFunc )(); -} - -// private static meethod -bool CBuildFactoryHelper::HasFactory( char const *className ) -{ - CBuildFactoryHelper *p = m_sHelpers; - while ( p ) - { - if ( !Q_stricmp( className, p->GetClassName() ) ) - return true; - - p = p->GetNext(); - } - return false; -} - -// static method -vgui::Panel *CBuildFactoryHelper::InstancePanel( char const *className ) -{ - CBuildFactoryHelper *p = m_sHelpers; - while ( p ) - { - if ( !Q_stricmp( className, p->GetClassName() ) ) - return p->CreatePanel(); - - p = p->GetNext(); - } - return NULL; -} - -// static method -void CBuildFactoryHelper::GetFactoryNames( CUtlVector< char const * >& list ) -{ - list.RemoveAll(); - - CBuildFactoryHelper *p = m_sHelpers; - while ( p ) - { - list.AddToTail( p->GetClassName() ); - p = p->GetNext(); - } -} - - - +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Helper for the CHudElement class to add themselves to the list of hud elements +// +// $NoKeywords: $ +//=============================================================================// +#include "vgui/IVGui.h" +#include "vgui_controls/MessageMap.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +using namespace vgui; + +// Start with empty list +CBuildFactoryHelper *CBuildFactoryHelper::m_sHelpers = NULL; + +//----------------------------------------------------------------------------- +// Purpose: Constructs a panel factory +// Input : pfnCreate - fn Ptr to a function which generates a panel +//----------------------------------------------------------------------------- +CBuildFactoryHelper::CBuildFactoryHelper( char const *className, PANELCREATEFUNC func ) +{ + // Make this fatal + if ( HasFactory( className ) ) + { + Error( "CBuildFactoryHelper: Factory for '%s' already exists!!!!\n", className ); + } + + //List is empty, or element belongs at front, insert here + m_pNext = m_sHelpers; + m_sHelpers = this; + + Assert( func ); + m_CreateFunc = func; + Assert( className ); + m_pClassName = className; +} + +//----------------------------------------------------------------------------- +// Purpose: Returns next object in list +// Output : CBuildFactoryHelper +//----------------------------------------------------------------------------- +CBuildFactoryHelper *CBuildFactoryHelper::GetNext( void ) +{ + return m_pNext; +} + +char const *CBuildFactoryHelper::GetClassName() const +{ + return m_pClassName; +} + +vgui::Panel *CBuildFactoryHelper::CreatePanel() +{ + if ( !m_CreateFunc ) + return NULL; + + return ( *m_CreateFunc )(); +} + +// private static meethod +bool CBuildFactoryHelper::HasFactory( char const *className ) +{ + CBuildFactoryHelper *p = m_sHelpers; + while ( p ) + { + if ( !Q_stricmp( className, p->GetClassName() ) ) + return true; + + p = p->GetNext(); + } + return false; +} + +// static method +vgui::Panel *CBuildFactoryHelper::InstancePanel( char const *className ) +{ + CBuildFactoryHelper *p = m_sHelpers; + while ( p ) + { + if ( !Q_stricmp( className, p->GetClassName() ) ) + return p->CreatePanel(); + + p = p->GetNext(); + } + return NULL; +} + +// static method +void CBuildFactoryHelper::GetFactoryNames( CUtlVector< char const * >& list ) +{ + list.RemoveAll(); + + CBuildFactoryHelper *p = m_sHelpers; + while ( p ) + { + list.AddToTail( p->GetClassName() ); + p = p->GetNext(); + } +} + + + -- cgit v1.2.3