/*
* Copyright 2004, 2005 Perforce Software. All rights reserved.
*
* Developed by Data Shades Ltd.
*/
#include <xsi_context.h>
#include <xsi_command.h>
using namespace XSI;
#include "P4GTSoftImage.h"
/*
* Softimage file types
*/
static StrBufArray fileTypes;
/*
* Setup Softimage file types
*/
void InitFileTypes()
{
fileTypes.Put( _T("Scene Files (*.scn)") );
fileTypes.Put( _T("All Files (*.*)") );
}
/*
* Implementations of all the menu commands.
*/
void InitCommand( CRef& in_context )
{
Context ctx(in_context);
Command cmd(ctx.GetSource());
cmd.EnableReturnValue(false);
}
CStatus PerforceAddMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceAddMenuItem_Execute( CRef& in_context )
{
perforceOps->Add();
return XSI::CStatus::OK;
}
CStatus PerforceCheckOutMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceCheckOutMenuItem_Execute( CRef& in_context )
{
perforceOps->Edit();
return XSI::CStatus::OK;
}
CStatus PerforceCheckInMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceCheckInMenuItem_Execute( CRef& in_context )
{
perforceOps->Submit();
return XSI::CStatus::OK;
}
CStatus PerforceLockMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceLockMenuItem_Execute( CRef& in_context )
{
perforceOps->ToggleLock();
return XSI::CStatus::OK;
}
CStatus PerforceUndoMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceUndoMenuItem_Execute( CRef& in_context )
{
perforceOps->Revert();
return XSI::CStatus::OK;
}
CStatus PerforceResultsMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceResultsMenuItem_Execute( CRef& in_context )
{
perforceOps->ShowLastResults();
return XSI::CStatus::OK;
}
CStatus PerforceStatusMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceStatusMenuItem_Execute( CRef& in_context )
{
perforceOps->ShowStatus();
return XSI::CStatus::OK;
}
CStatus PerforceHistoryMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceHistoryMenuItem_Execute( CRef& in_context )
{
perforceOps->ShowHistory();
return XSI::CStatus::OK;
}
CStatus PerforceOpenedMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceOpenedMenuItem_Execute( CRef& in_context )
{
perforceOps->ShowOpenFiles();
return XSI::CStatus::OK;
}
CStatus PerforceInfoMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceInfoMenuItem_Execute( CRef& in_context )
{
perforceOps->ShowInfo();
return XSI::CStatus::OK;
}
CStatus PerforceOpenMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceOpenMenuItem_Execute( CRef& in_context )
{
if ( fileTypes.Count() == 0 ) {
InitFileTypes();
}
perforceOps->ShowOpenDepot( &fileTypes );
return XSI::CStatus::OK;
}
CStatus PerforceOptionsMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceOptionsMenuItem_Execute( CRef& in_context )
{
perforceOps->ShowOptions();
return XSI::CStatus::OK;
}
CStatus PerforceHelpMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceHelpMenuItem_Execute( CRef& in_context )
{
perforceOps->ShowHelp();
return XSI::CStatus::OK;
}
CStatus PerforceAboutMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceAboutMenuItem_Execute( CRef& in_context )
{
perforceOps->ShowAbout();
return XSI::CStatus::OK;
}
CStatus PerforceOnlineMenuItem_Init( CRef& in_context )
{
InitCommand( in_context );
return XSI::CStatus::OK;
}
CStatus PerforceOnlineMenuItem_Execute( CRef& in_context )
{
perforceOps->ToggleOnline();
return XSI::CStatus::OK;
}
# |
Change |
User |
Description |
Committed |
|
#1
|
10140 |
Matt Attaway |
Initial release of the P4GT source code. |
|
|