94 lines
3.2 KiB
C++
94 lines
3.2 KiB
C++
#include "StdAfx.h"
|
|
#include "SelectionSetParam.h"
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// forward declarations
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
/*
|
|
CKERROR CKSelectionSetParamCreator(CKParameter *param);
|
|
int CKSelectionSetParamStringFunc(CKParameter *p,CKSTRING value,CKBOOL ReadFrom);
|
|
WIN_HANDLE CKSelectionSetParamUIFunc(CKParameter *param,WIN_HANDLE ParentWindow,CKRECT *rect);
|
|
*/
|
|
|
|
CKERROR OnCreateParam(CKParameter*);
|
|
void OnDeleteParam(CKParameter*);
|
|
//void OnCopyParam(CKParameter*,CKParameter*);
|
|
//void OnCheckParam(CKParameter*);
|
|
//void OnSaveLoadParam(CKParameter* param,CKStateChunk **chunk,CKBOOL load);
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// register parameter
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
CKERROR RegisterCKSelectionSetParameter(CKContext* context)
|
|
{
|
|
CKParameterManager* pm = context->GetParameterManager();
|
|
if (!pm)
|
|
return CKERR_INVALIDPARAMETER;
|
|
|
|
CKParameterTypeDesc* groupDesc = pm->GetParameterTypeDescription(CKPGUID_GROUP);
|
|
|
|
CKParameterTypeDesc pSetParam = *groupDesc;
|
|
pSetParam.Guid = CKPGUID_SELECTIONSET;
|
|
pSetParam.DerivedFrom = CKPGUID_GROUP;
|
|
pSetParam.TypeName = "SelectionSet";
|
|
|
|
pSetParam.CreateDefaultFunction = OnCreateParam;
|
|
pSetParam.DeleteFunction = OnDeleteParam;
|
|
pSetParam.CopyFunction = 0;//OnCopyParam;
|
|
pSetParam.CheckFunction = 0;//OnCheckParam;
|
|
pSetParam.SaveLoadFunction = 0;//OnSaveLoadParam;
|
|
|
|
/*
|
|
pSetParam.DefaultSize = 0;
|
|
pSetParam.CreateDefaultFunction = 0;//CKSelectionSetParamCreator
|
|
pSetParam.DeleteFunction = 0;
|
|
pSetParam.SaveLoadFunction = 0;
|
|
pSetParam.CheckFunction = 0;
|
|
pSetParam.StringFunction = 0;//CKSelectionSetParamStringFunc
|
|
pSetParam.UICreatorFunction = 0;//CKSelectionSetParamUIFunc;
|
|
*/
|
|
|
|
pm->RegisterParameterType(&pSetParam);
|
|
|
|
#ifdef _DEBUG
|
|
CKParameterType ptype = pm->ParameterGuidToType(CKPGUID_SELECTIONSET);
|
|
#endif
|
|
|
|
return CK_OK;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
CKERROR UnRegisterCKSelectionSetParameter(CKContext* context)
|
|
{
|
|
CKParameterManager* pm = context->GetParameterManager();
|
|
if (!pm)
|
|
return CKERR_INVALIDPARAMETER;
|
|
pm->UnRegisterParameterType(CKPGUID_SELECTIONSET);
|
|
return CK_OK;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
CKERROR OnCreateParam(CKParameter* iParam)
|
|
{
|
|
GetSelectionSetManagerMacro2(iParam->m_Context);
|
|
SelSetMgr->RegisterSelectionSetParameter(iParam);
|
|
return CK_OK;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
void OnDeleteParam(CKParameter* iParam)
|
|
{
|
|
GetSelectionSetManagerMacro2(iParam->m_Context);
|
|
SelSetMgr->UnRegisterSelectionSetParameter(iParam->GetID());
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
void OnSaveLoadParam(CKParameter* param,CKStateChunk **chunk,CKBOOL load)
|
|
{
|
|
}
|