Files
itgmania212121/stepmania/src/EditMenu.cpp
T

475 lines
14 KiB
C++
Raw Normal View History

2003-02-16 04:01:45 +00:00
#include "global.h"
2003-02-11 02:20:38 +00:00
#include "EditMenu.h"
#include "RageLog.h"
#include "SongManager.h"
#include "GameState.h"
#include "ThemeManager.h"
#include "GameManager.h"
2003-08-03 00:13:55 +00:00
#include "Steps.h"
2003-04-22 12:13:36 +00:00
#include "song.h"
2005-03-05 21:35:30 +00:00
#include "StepsUtil.h"
#include "Foreach.h"
2005-03-07 07:47:18 +00:00
#include "CommonMetrics.h"
2005-03-07 23:55:18 +00:00
static const CString EditMenuRowNames[NUM_EDIT_MENU_ROWS] = {
"Group",
"Song",
"StepsType",
"Steps",
"SourceStepsType",
"SourceSteps",
"Action"
};
XToString( EditMenuRow, NUM_EDIT_MENU_ROWS );
XToThemedString( EditMenuRow, NUM_EDIT_MENU_ROWS );
2003-02-11 02:20:38 +00:00
#define ARROWS_X( i ) THEME->GetMetricF("EditMenu",ssprintf("Arrows%dX",i+1))
#define SONG_BANNER_WIDTH THEME->GetMetricF("EditMenu","SongBannerWidth")
#define SONG_BANNER_HEIGHT THEME->GetMetricF("EditMenu","SongBannerHeight")
#define GROUP_BANNER_WIDTH THEME->GetMetricF("EditMenu","GroupBannerWidth")
#define GROUP_BANNER_HEIGHT THEME->GetMetricF("EditMenu","GroupBannerHeight")
#define ROW_LABELS_X THEME->GetMetricF("EditMenu","RowLabelsX")
2005-03-07 20:10:07 +00:00
#define ROW_LABEL_ON_COMMAND THEME->GetMetricA("EditMenu","RowLabelOnCommand")
2003-02-11 02:20:38 +00:00
#define ROW_VALUE_X( i ) THEME->GetMetricF("EditMenu",ssprintf("RowValue%dX",i+1))
2005-03-07 20:10:07 +00:00
#define ROW_VALUE_ON_COMMAND THEME->GetMetricA("EditMenu","RowValueOnCommand")
2003-02-11 02:20:38 +00:00
#define ROW_Y( i ) THEME->GetMetricF("EditMenu",ssprintf("Row%dY",i+1))
EditMenu::EditMenu()
2003-01-30 07:18:33 +00:00
{
2005-03-18 01:53:46 +00:00
LOG->Trace( "EditMenu::EditMenu()" );
SetName( "EditMenu" );
2004-09-21 07:53:39 +00:00
for( int i=0; i<2; i++ )
2003-01-30 07:18:33 +00:00
{
2005-02-06 03:32:53 +00:00
m_sprArrows[i].Load( THEME->GetPathG("EditMenu",i==0?"left":"right") );
2003-01-30 07:18:33 +00:00
m_sprArrows[i].SetX( ARROWS_X(i) );
this->AddChild( &m_sprArrows[i] );
}
2005-03-07 23:55:18 +00:00
m_SelectedRow = (EditMenuRow)0;
2003-01-30 07:18:33 +00:00
ZERO( m_iSelection );
2003-02-11 02:20:38 +00:00
// start out on easy, not beginner
2005-03-05 21:35:30 +00:00
m_iSelection[ROW_STEPS] = DIFFICULTY_EASY;
m_iSelection[ROW_SOURCE_STEPS] = DIFFICULTY_EASY;
2003-02-11 02:20:38 +00:00
2005-03-07 23:55:18 +00:00
FOREACH_EditMenuRow( r )
2003-01-30 07:18:33 +00:00
{
2005-03-07 23:55:18 +00:00
m_textLabel[r].LoadFromFont( THEME->GetPathF("EditMenu","title") );
m_textLabel[r].SetXY( ROW_LABELS_X, ROW_Y(r) );
m_textLabel[r].SetText( EditMenuRowToThemedString(r) );
m_textLabel[r].RunCommands( ROW_LABEL_ON_COMMAND );
m_textLabel[r].SetHorizAlign( Actor::align_left );
this->AddChild( &m_textLabel[r] );
m_textValue[r].LoadFromFont( THEME->GetPathF("EditMenu","value") );
m_textValue[r].SetXY( ROW_VALUE_X(r), ROW_Y(r) );
m_textValue[r].SetText( "blah" );
m_textValue[r].RunCommands( ROW_VALUE_ON_COMMAND );
this->AddChild( &m_textValue[r] );
2003-01-30 07:18:33 +00:00
}
2005-03-18 01:53:46 +00:00
m_GroupBanner.SetName( "GroupBanner" );
SET_XY( m_GroupBanner );
2003-01-30 07:18:33 +00:00
this->AddChild( &m_GroupBanner );
2005-03-18 01:53:46 +00:00
m_SongBanner.SetName( "SongBanner" );
SET_XY( m_SongBanner );
2003-01-30 07:18:33 +00:00
this->AddChild( &m_SongBanner );
2005-03-18 01:53:46 +00:00
m_SongTextBanner.SetName( "SongTextBanner" );
m_SongTextBanner.Load( "TextBanner" );
SET_XY( m_SongTextBanner );
2003-01-30 07:18:33 +00:00
this->AddChild( &m_SongTextBanner );
2005-03-18 01:53:46 +00:00
m_Meter.SetName( "Meter" );
m_Meter.Load( "EditDifficultyMeter" );
2005-03-18 01:53:46 +00:00
SET_XY( m_Meter );
2003-01-30 07:18:33 +00:00
this->AddChild( &m_Meter );
2005-03-18 01:53:46 +00:00
m_SourceMeter.SetName( "SourceMeter" );
m_SourceMeter.Load( "EditDifficultyMeter" );
2005-03-18 01:53:46 +00:00
SET_XY( m_SourceMeter );
2003-01-30 07:18:33 +00:00
this->AddChild( &m_SourceMeter );
2005-03-18 01:53:46 +00:00
m_textMeter.SetName( "MeterNumber" );
m_textMeter.LoadFromFont( THEME->GetPathF("EditMenu","meter") );
SET_XY_AND_ON_COMMAND( m_textMeter );
this->AddChild( &m_textMeter );
m_textSourceMeter.SetName( "SourceMeterNumber" );
m_textSourceMeter.LoadFromFont( THEME->GetPathF("EditMenu","meter") );
SET_XY_AND_ON_COMMAND( m_textSourceMeter );
this->AddChild( &m_textSourceMeter );
2005-02-06 03:32:53 +00:00
m_soundChangeRow.Load( THEME->GetPathS("EditMenu","row") );
m_soundChangeValue.Load( THEME->GetPathS("EditMenu","value") );
2003-01-30 07:18:33 +00:00
// fill in data structures
SONGMAN->GetGroupNames( m_sGroups );
GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, m_StepsTypes );
2005-03-07 07:47:18 +00:00
if( HOME_EDIT_MODE )
{
m_vDifficulties.push_back( DIFFICULTY_EDIT );
}
else
{
FOREACH_Difficulty( dc )
m_vDifficulties.push_back( dc );
}
FOREACH_Difficulty( dc )
m_vSourceDifficulties.push_back( dc );
2003-01-30 07:18:33 +00:00
RefreshAll();
}
EditMenu::~EditMenu()
{
}
void EditMenu::RefreshAll()
{
2005-03-07 23:55:18 +00:00
ChangeToRow( (EditMenuRow)0 );
OnRowValueChanged( (EditMenuRow)0 );
2003-02-17 00:15:13 +00:00
2003-01-30 07:18:33 +00:00
// Select the current song if any
if( GAMESTATE->m_pCurSong )
{
2004-09-21 07:53:39 +00:00
for( unsigned i=0; i<m_sGroups.size(); i++ )
if( GAMESTATE->m_pCurSong->m_sGroupName == m_sGroups[i] )
2003-01-30 07:18:33 +00:00
m_iSelection[ROW_GROUP] = i;
OnRowValueChanged( ROW_GROUP );
2004-09-21 07:53:39 +00:00
for( unsigned i=0; i<m_pSongs.size(); i++ )
if( GAMESTATE->m_pCurSong == m_pSongs[i] )
2003-01-30 07:18:33 +00:00
m_iSelection[ROW_SONG] = i;
OnRowValueChanged( ROW_SONG );
2003-03-13 20:46:59 +00:00
2003-08-07 06:16:17 +00:00
// Select the current StepsType and difficulty if any
2004-05-24 06:12:17 +00:00
if( GAMESTATE->m_pCurSteps[PLAYER_1] )
2003-03-13 20:46:59 +00:00
{
2004-09-21 07:53:39 +00:00
for( unsigned i=0; i<m_StepsTypes.size(); i++ )
{
2004-05-24 06:12:17 +00:00
if( m_StepsTypes[i] == GAMESTATE->m_pCurSteps[PLAYER_1]->m_StepsType )
2003-03-13 20:46:59 +00:00
{
2004-07-12 02:19:24 +00:00
m_iSelection[ROW_STEPS_TYPE] = i;
OnRowValueChanged( ROW_STEPS_TYPE );
2003-03-13 20:46:59 +00:00
}
}
2005-03-05 21:35:30 +00:00
2005-03-08 20:13:44 +00:00
for( unsigned i=0; i<m_vpSteps.size(); i++ )
2005-03-05 21:35:30 +00:00
{
const Steps *pSteps = m_vpSteps[i];
if( pSteps == GAMESTATE->m_pCurSteps[PLAYER_1] )
{
m_iSelection[ROW_STEPS] = i;
OnRowValueChanged( ROW_STEPS );
}
2005-03-05 21:35:30 +00:00
}
2003-03-13 20:46:59 +00:00
}
}
}
2003-02-11 02:20:38 +00:00
void EditMenu::DrawPrimitives()
{
ActorFrame::DrawPrimitives();
}
2003-02-11 02:20:38 +00:00
bool EditMenu::CanGoUp()
{
2003-01-30 07:18:33 +00:00
return m_SelectedRow != 0;
}
2003-02-11 02:20:38 +00:00
bool EditMenu::CanGoDown()
2003-01-30 07:18:33 +00:00
{
2005-03-07 23:55:18 +00:00
return m_SelectedRow != NUM_EDIT_MENU_ROWS-1;
}
2003-02-11 02:20:38 +00:00
bool EditMenu::CanGoLeft()
{
2003-01-30 07:18:33 +00:00
return m_iSelection[m_SelectedRow] != 0;
}
2003-02-11 02:20:38 +00:00
bool EditMenu::CanGoRight()
2003-01-30 07:18:33 +00:00
{
2005-03-07 23:55:18 +00:00
int num_values[NUM_EDIT_MENU_ROWS] =
2003-01-30 07:18:33 +00:00
{
m_sGroups.size(),
m_pSongs.size(),
2003-08-07 06:36:34 +00:00
m_StepsTypes.size(),
2005-03-05 21:35:30 +00:00
m_vpSteps.size(),
2003-08-07 06:36:34 +00:00
m_StepsTypes.size(),
2005-03-05 21:35:30 +00:00
m_vpSourceSteps.size(),
2003-01-30 07:18:33 +00:00
m_Actions.size()
};
return m_iSelection[m_SelectedRow] != (num_values[m_SelectedRow]-1);
}
2003-02-11 02:20:38 +00:00
void EditMenu::Up()
{
2003-01-30 07:18:33 +00:00
if( CanGoUp() )
{
2005-03-05 21:35:30 +00:00
if( GetSelectedSteps() && m_SelectedRow==ROW_ACTION )
ChangeToRow( ROW_STEPS );
2003-01-30 07:18:33 +00:00
else
2005-03-07 23:55:18 +00:00
ChangeToRow( EditMenuRow(m_SelectedRow-1) );
2003-01-30 07:18:33 +00:00
m_soundChangeRow.PlayRandom();
}
}
2003-02-11 02:20:38 +00:00
void EditMenu::Down()
{
2003-01-30 07:18:33 +00:00
if( CanGoDown() )
{
2005-03-05 21:35:30 +00:00
if( GetSelectedSteps() && m_SelectedRow==ROW_STEPS )
2003-01-30 07:18:33 +00:00
ChangeToRow( ROW_ACTION );
else
2005-03-07 23:55:18 +00:00
ChangeToRow( EditMenuRow(m_SelectedRow+1) );
2003-01-30 07:18:33 +00:00
m_soundChangeRow.PlayRandom();
}
}
2003-02-11 02:20:38 +00:00
void EditMenu::Left()
{
2003-01-30 07:18:33 +00:00
if( CanGoLeft() )
{
2003-01-30 07:18:33 +00:00
m_iSelection[m_SelectedRow]--;
OnRowValueChanged( m_SelectedRow );
m_soundChangeValue.PlayRandom();
}
}
2003-02-11 02:20:38 +00:00
void EditMenu::Right()
{
2003-01-30 07:18:33 +00:00
if( CanGoRight() )
{
m_iSelection[m_SelectedRow]++;
OnRowValueChanged( m_SelectedRow );
m_soundChangeValue.PlayRandom();
}
}
2005-03-07 23:55:18 +00:00
void EditMenu::ChangeToRow( EditMenuRow newRow )
2003-01-30 07:18:33 +00:00
{
m_SelectedRow = newRow;
2003-01-30 07:18:33 +00:00
for( int i=0; i<2; i++ )
m_sprArrows[i].SetY( ROW_Y(newRow) );
m_sprArrows[0].SetDiffuse( CanGoLeft()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
m_sprArrows[1].SetDiffuse( CanGoRight()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
2003-02-18 23:15:38 +00:00
m_sprArrows[0].EnableAnimation( CanGoLeft() );
m_sprArrows[1].EnableAnimation( CanGoRight() );
}
2005-03-07 23:55:18 +00:00
void EditMenu::OnRowValueChanged( EditMenuRow row )
{
2003-01-30 07:18:33 +00:00
m_sprArrows[0].SetDiffuse( CanGoLeft()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
m_sprArrows[1].SetDiffuse( CanGoRight()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
2003-02-18 23:15:38 +00:00
m_sprArrows[0].EnableAnimation( CanGoLeft() );
m_sprArrows[1].EnableAnimation( CanGoRight() );
2003-01-30 07:18:33 +00:00
switch( row )
{
case ROW_GROUP:
m_textValue[ROW_GROUP].SetText( SONGMAN->ShortenGroupName(GetSelectedGroup()) );
m_GroupBanner.LoadFromGroup( GetSelectedGroup() );
m_GroupBanner.ScaleToClipped( GROUP_BANNER_WIDTH, GROUP_BANNER_HEIGHT );
2003-01-30 07:18:33 +00:00
m_pSongs.clear();
SONGMAN->GetSongs( m_pSongs, GetSelectedGroup() );
2003-01-30 07:18:33 +00:00
m_iSelection[ROW_SONG] = 0;
// fall through
case ROW_SONG:
m_textValue[ROW_SONG].SetText( "" );
m_SongBanner.LoadFromSong( GetSelectedSong() );
m_SongBanner.ScaleToClipped( SONG_BANNER_WIDTH, SONG_BANNER_HEIGHT );
2003-01-30 07:18:33 +00:00
m_SongTextBanner.LoadFromSong( GetSelectedSong() );
// fall through
2004-07-12 02:19:24 +00:00
case ROW_STEPS_TYPE:
2005-03-05 21:35:30 +00:00
m_textValue[ROW_STEPS_TYPE].SetText( GAMEMAN->StepsTypeToThemedString(GetSelectedStepsType()) );
CLAMP( m_iSelection[ROW_STEPS], 0, m_vDifficulties.size()-1 ); // jump back to the slot for DIFFICULTY_EDIT
2005-03-05 21:35:30 +00:00
m_vpSteps.clear();
FOREACH( Difficulty, m_vDifficulties, dc )
2005-03-05 21:35:30 +00:00
{
if( *dc == DIFFICULTY_EDIT )
{
vector<Steps*> v;
GetSelectedSong()->GetSteps( v, GetSelectedStepsType(), DIFFICULTY_EDIT );
StepsUtil::SortStepsByDescription( v );
m_vpSteps.insert( m_vpSteps.end(), v.begin(), v.end() );
m_vpSteps.push_back( NULL ); // "New Edit"
}
else
{
Steps *pSteps = GetSelectedSong()->GetStepsByDifficulty( GetSelectedStepsType(), *dc );
m_vpSteps.push_back( pSteps );
}
2005-03-05 21:35:30 +00:00
}
2003-01-30 07:18:33 +00:00
// fall through
2005-03-05 21:35:30 +00:00
case ROW_STEPS:
{
2005-03-06 00:08:48 +00:00
CString s;
2005-03-05 21:35:30 +00:00
Steps *pSteps = GetSelectedSteps();
if( pSteps && GetSelectedDifficulty() == DIFFICULTY_EDIT )
{
if( pSteps->GetDescription().empty() )
s += "-no name-";
else
s += pSteps->GetDescription();
s += " (" + DifficultyToThemedString(DIFFICULTY_EDIT) + ")";
}
2005-03-05 23:06:52 +00:00
else
{
2005-03-06 00:08:48 +00:00
s = DifficultyToThemedString(GetSelectedDifficulty());
// UGLY. "Edit" -> "New Edit"
2005-03-07 07:47:18 +00:00
if( HOME_EDIT_MODE )
s = "New " + s;
}
2005-03-06 00:08:48 +00:00
m_textValue[ROW_STEPS].SetText( s );
2005-03-05 21:35:30 +00:00
}
2005-03-06 00:08:48 +00:00
if( GetSelectedSteps() )
2005-03-18 01:53:46 +00:00
{
2005-03-06 00:08:48 +00:00
m_Meter.SetFromSteps( GetSelectedSteps() );
2005-03-18 01:53:46 +00:00
m_textMeter.SetText( ssprintf("%d", GetSelectedSteps()->GetMeter()) );
m_textMeter.SetDiffuse( SONGMAN->GetDifficultyColor( GetSelectedSteps()->GetDifficulty() ) );
}
2005-03-06 00:08:48 +00:00
else
2005-03-18 01:53:46 +00:00
{
2005-03-06 00:08:48 +00:00
m_Meter.SetFromMeterAndDifficulty( 0, GetSelectedDifficulty() );
2005-03-18 01:53:46 +00:00
m_textMeter.SetText( ssprintf("%d", 0) );
}
m_textMeter.SetHidden( GetSelectedSteps()? false:true );
2003-01-30 07:18:33 +00:00
// fall through
2004-07-12 02:19:24 +00:00
case ROW_SOURCE_STEPS_TYPE:
2005-03-05 21:35:30 +00:00
m_textLabel[ROW_SOURCE_STEPS_TYPE].SetHidden( GetSelectedSteps() ? true : false );
m_textValue[ROW_SOURCE_STEPS_TYPE].SetHidden( GetSelectedSteps() ? true : false );
m_textValue[ROW_SOURCE_STEPS_TYPE].SetText( GAMEMAN->StepsTypeToThemedString(GetSelectedSourceStepsType()) );
CLAMP( m_iSelection[ROW_SOURCE_STEPS], 0, m_vSourceDifficulties.size()-1 ); // jump back to the slot for DIFFICULTY_EDIT
2005-03-05 21:35:30 +00:00
m_vpSourceSteps.clear();
FOREACH( Difficulty, m_vSourceDifficulties, dc )
2005-03-05 21:35:30 +00:00
{
if( *dc == DIFFICULTY_EDIT )
{
vector<Steps*> v;
GetSelectedSong()->GetSteps( v, GetSelectedStepsType(), DIFFICULTY_EDIT );
StepsUtil::SortStepsByDescription( v );
m_vpSourceSteps.insert( m_vpSourceSteps.end(), v.begin(), v.end() );
// if we don't have any edits, pad with NULL so that we have one slot for every difficulty
if( v.empty() )
2005-03-08 00:33:39 +00:00
m_vpSourceSteps.push_back( NULL );
}
else
{
Steps *pSteps = GetSelectedSong()->GetStepsByDifficulty( GetSelectedStepsType(), *dc );
m_vpSourceSteps.push_back( pSteps );
}
2005-03-05 21:35:30 +00:00
}
2003-01-30 07:18:33 +00:00
// fall through
2005-03-05 21:35:30 +00:00
case ROW_SOURCE_STEPS:
m_textLabel[ROW_SOURCE_STEPS].SetHidden( GetSelectedSteps() ? true : false );
m_textValue[ROW_SOURCE_STEPS].SetHidden( GetSelectedSteps() ? true : false );
2005-03-06 00:08:48 +00:00
{
CString s;
Steps *pSourceSteps = GetSelectedSourceSteps();
if( pSourceSteps && GetSelectedSourceDifficulty() == DIFFICULTY_EDIT )
s = pSourceSteps->GetDescription() + " (" + DifficultyToThemedString(DIFFICULTY_EDIT) + ")";
else
s = DifficultyToThemedString(GetSelectedSourceDifficulty());
m_textValue[ROW_SOURCE_STEPS].SetText( s );
}
2005-03-05 23:06:52 +00:00
if( GetSelectedSourceSteps() )
2005-03-18 01:53:46 +00:00
{
2005-03-05 23:06:52 +00:00
m_SourceMeter.SetFromSteps( GetSelectedSourceSteps() );
2005-03-18 01:53:46 +00:00
m_textSourceMeter.SetText( ssprintf("%d", GetSelectedSourceSteps()->GetMeter()) );
m_textSourceMeter.SetDiffuse( SONGMAN->GetDifficultyColor( GetSelectedSourceSteps()->GetDifficulty() ) );
}
2005-03-05 23:06:52 +00:00
else
2005-03-18 01:53:46 +00:00
{
2005-03-05 23:06:52 +00:00
m_SourceMeter.SetFromMeterAndDifficulty( 0, GetSelectedSourceDifficulty() );
2005-03-18 01:53:46 +00:00
m_textSourceMeter.SetText( ssprintf("%d", 0) );
}
2005-03-05 21:35:30 +00:00
m_SourceMeter.SetHidden( GetSelectedSteps() ? true : false );
2005-03-18 01:53:46 +00:00
m_textSourceMeter.SetHidden( (GetSelectedSteps() == false && GetSelectedSourceSteps()) ? false : true );
2003-01-30 07:18:33 +00:00
m_Actions.clear();
2005-03-05 21:35:30 +00:00
if( GetSelectedSteps() )
2003-01-30 07:18:33 +00:00
{
2005-03-07 23:55:18 +00:00
m_Actions.push_back( EDIT_MENU_ACTION_EDIT );
m_Actions.push_back( EDIT_MENU_ACTION_DELETE );
2003-01-30 07:18:33 +00:00
}
2005-03-05 21:35:30 +00:00
else if( GetSelectedSourceSteps() )
2003-01-30 07:18:33 +00:00
{
2005-03-07 23:55:18 +00:00
m_Actions.push_back( EDIT_MENU_ACTION_COPY );
m_Actions.push_back( EDIT_MENU_ACTION_AUTOGEN );
m_Actions.push_back( EDIT_MENU_ACTION_BLANK );
2003-01-30 07:18:33 +00:00
}
else
{
2005-03-07 23:55:18 +00:00
m_Actions.push_back( EDIT_MENU_ACTION_BLANK );
2003-01-30 07:18:33 +00:00
}
m_iSelection[ROW_ACTION] = 0;
// fall through
case ROW_ACTION:
2005-03-07 23:55:18 +00:00
m_textValue[ROW_ACTION].SetText( EditMenuActionToThemedString(GetSelectedAction()) );
2003-01-30 07:18:33 +00:00
break;
default:
ASSERT(0); // invalid row
}
}
Difficulty EditMenu::GetSelectedDifficulty()
{
int i = m_iSelection[ROW_STEPS];
CLAMP( i, 0, m_vDifficulties.size()-1 );
return m_vDifficulties[i];
}
Difficulty EditMenu::GetSelectedSourceDifficulty()
{
int i = m_iSelection[ROW_SOURCE_STEPS];
CLAMP( i, 0, m_vSourceDifficulties.size()-1 );
return m_vSourceDifficulties[i];
}
2004-01-01 01:21:59 +00:00
2004-06-07 21:14:03 +00:00
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/