Add rayman2 source files
This commit is contained in:
223
Rayman_X/cpa/tempgrp/Ctl/Src/Others/CTL_EnLi.cpp
Normal file
223
Rayman_X/cpa/tempgrp/Ctl/Src/Others/CTL_EnLi.cpp
Normal file
@@ -0,0 +1,223 @@
|
||||
// Implementation for the definition of 'enum' type lists in the editor
|
||||
//////////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Others\CTL_EnLi.hpp"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_EnumElement::CTL_Editor_EnumElement(CString _csElementName,
|
||||
long _lEnumValue,
|
||||
CString _csAdditionalString,
|
||||
void *_p_vAdditionnalPointer)
|
||||
{
|
||||
m_pri_csElementName = _csElementName;
|
||||
m_pri_lEnumValue = _lEnumValue;
|
||||
m_pri_csAdditionalString = _csAdditionalString;
|
||||
m_pri_p_vAdditionnalPointer = _p_vAdditionnalPointer;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_EnumElement::~CTL_Editor_EnumElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//Value
|
||||
//************************************************************************
|
||||
void CTL_Editor_EnumElement::m_pub_fn_vSetValue(long lNewValue)
|
||||
{
|
||||
m_pri_lEnumValue = lNewValue;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
long CTL_Editor_EnumElement::m_pub_fn_lGetValue()
|
||||
{
|
||||
return m_pri_lEnumValue;
|
||||
}
|
||||
|
||||
//Element Name
|
||||
//************************************************************************
|
||||
void CTL_Editor_EnumElement::m_pub_fn_vSetElementName(CString _csNewString)
|
||||
{
|
||||
m_pri_csElementName = _csNewString;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CString CTL_Editor_EnumElement::m_pub_fn_csGetElementName()
|
||||
{
|
||||
return m_pri_csElementName;
|
||||
}
|
||||
|
||||
//Additional String
|
||||
//************************************************************************
|
||||
void CTL_Editor_EnumElement::m_pub_fn_vSetAdditionalString(CString _csNewString)
|
||||
{
|
||||
m_pri_csAdditionalString = _csNewString;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CString CTL_Editor_EnumElement::m_pub_fn_csGetAdditionalString()
|
||||
{
|
||||
return m_pri_csAdditionalString;
|
||||
}
|
||||
|
||||
//Additionnal Pointer
|
||||
//************************************************************************
|
||||
void CTL_Editor_EnumElement::m_pub_fn_vSetAdditionnalPointer(void *_p_vAdditionnalPointer)
|
||||
{
|
||||
m_pri_p_vAdditionnalPointer = _p_vAdditionnalPointer;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
void *CTL_Editor_EnumElement::m_pub_fn_pvGetAdditionnalPointer()
|
||||
{
|
||||
return m_pri_p_vAdditionnalPointer;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//************************************************************************
|
||||
//************************************************************************
|
||||
CTL_Editor_EnumDescriptor::CTL_Editor_EnumDescriptor(CString csEnumName,
|
||||
unsigned char ucSize)
|
||||
{
|
||||
m_csEnumName = csEnumName;
|
||||
|
||||
m_ucEnumSize = ucSize;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_EnumDescriptor::~CTL_Editor_EnumDescriptor()
|
||||
{
|
||||
m_fn_vEmptyList();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
void CTL_Editor_EnumDescriptor::m_fn_vEmptyList()
|
||||
{
|
||||
POSITION pos = GetHeadPosition();
|
||||
while ( pos != NULL )
|
||||
delete GetNext(pos);
|
||||
|
||||
RemoveAll();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_EnumElement *CTL_Editor_EnumDescriptor::m_fn_pclAddElement(CString _csElementName,
|
||||
long _lEnumValue /*= LIST_ENUM_ERROR*/,
|
||||
CString _csAdditionalString /*= ""*/,
|
||||
void *_p_vAdditionnalPointer /*= NULL*/)
|
||||
{
|
||||
//Adds only if name is not found in list
|
||||
if ( m_fn_pclGetElementFromString(_csElementName) == NULL )
|
||||
{
|
||||
CTL_Editor_EnumElement *pclNewElement = new CTL_Editor_EnumElement(_csElementName,
|
||||
_lEnumValue,
|
||||
_csAdditionalString,
|
||||
_p_vAdditionnalPointer);
|
||||
|
||||
AddTail(pclNewElement);
|
||||
|
||||
return pclNewElement;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CString CTL_Editor_EnumDescriptor::m_fn_csGetStringFromEnumIndex(long lEnumIndex)
|
||||
{
|
||||
CTL_Editor_EnumElement *pclCurrentElement;
|
||||
BOOL bFound = FALSE;
|
||||
POSITION pos = GetHeadPosition();
|
||||
while ( (pos != NULL) && !bFound )
|
||||
{
|
||||
pclCurrentElement = GetNext(pos);
|
||||
bFound = ( pclCurrentElement->m_pub_fn_lGetValue() == lEnumIndex );
|
||||
}
|
||||
|
||||
if ( bFound )
|
||||
return (pclCurrentElement->m_pub_fn_csGetElementName());
|
||||
else
|
||||
return "*** E R R O R ***";
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_EnumElement *CTL_Editor_EnumDescriptor::m_fn_pclGetElementFromEnumIndex(long lEnumIndex)
|
||||
{
|
||||
CTL_Editor_EnumElement *pclCurrentElement;
|
||||
BOOL bFound = FALSE;
|
||||
POSITION pos = GetHeadPosition();
|
||||
while ( (pos != NULL) && !bFound )
|
||||
{
|
||||
pclCurrentElement = GetNext(pos);
|
||||
bFound = ( pclCurrentElement->m_pub_fn_lGetValue() == lEnumIndex );
|
||||
}
|
||||
|
||||
if ( bFound )
|
||||
return pclCurrentElement;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_EnumElement *CTL_Editor_EnumDescriptor::m_fn_pclGetElementFromString(CString _csStringToFind)
|
||||
{
|
||||
CTL_Editor_EnumElement *pclCurrentElement;
|
||||
BOOL bFound = FALSE;
|
||||
POSITION pos = GetHeadPosition();
|
||||
while ( (pos != NULL) && !bFound )
|
||||
{
|
||||
pclCurrentElement = GetNext(pos);
|
||||
bFound = ( pclCurrentElement->m_pub_fn_csGetElementName().Compare(_csStringToFind) == 0 );
|
||||
}
|
||||
|
||||
if ( bFound )
|
||||
return pclCurrentElement;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
unsigned char CTL_Editor_EnumDescriptor::m_fn_ucGetEnumSize()
|
||||
{
|
||||
return m_ucEnumSize;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
//************************************************************************
|
||||
//************************************************************************
|
||||
CTL_Editor_EnumDescriptorList::CTL_Editor_EnumDescriptorList()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_EnumDescriptorList::~CTL_Editor_EnumDescriptorList()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_EnumDescriptor *CTL_Editor_EnumDescriptorList::m_fn_pclGetEnumDescriptorByName(CString csDescriptorName)
|
||||
{
|
||||
CTL_Editor_EnumDescriptor *pclCurrent;
|
||||
BOOL bFound = FALSE;
|
||||
POSITION pos = GetHeadPosition();
|
||||
while ( (pos != NULL) && !bFound )
|
||||
{
|
||||
pclCurrent = GetNext(pos);
|
||||
bFound = ( pclCurrent->m_csEnumName == csDescriptorName );
|
||||
}
|
||||
|
||||
if ( bFound )
|
||||
return pclCurrent;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
141
Rayman_X/cpa/tempgrp/Ctl/Src/Others/CTL_Mask.cpp
Normal file
141
Rayman_X/cpa/tempgrp/Ctl/Src/Others/CTL_Mask.cpp
Normal file
@@ -0,0 +1,141 @@
|
||||
// Implementation for the list of Masks
|
||||
//
|
||||
// (used by Masked Data and Controls)
|
||||
//
|
||||
// Writen by YB
|
||||
///////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Others\CTL_Mask.hpp"
|
||||
|
||||
//######################################################################
|
||||
//######################################################################
|
||||
//######################################################################
|
||||
|
||||
//**********************************************************************
|
||||
CTL_Editor_Mask::CTL_Editor_Mask(CString _csString,
|
||||
unsigned long _ulValue)
|
||||
{
|
||||
m_pri_csString = _csString;
|
||||
m_pri_ulMaskValue = _ulValue;
|
||||
}
|
||||
|
||||
//**********************************************************************
|
||||
CTL_Editor_Mask::~CTL_Editor_Mask()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//**********************************************************************
|
||||
CString CTL_Editor_Mask::m_pub_fn_csGetString()
|
||||
{
|
||||
return m_pri_csString;
|
||||
}
|
||||
|
||||
//**********************************************************************
|
||||
unsigned long CTL_Editor_Mask::m_pub_fn_ulGetMaskValue()
|
||||
{
|
||||
return m_pri_ulMaskValue;
|
||||
}
|
||||
|
||||
|
||||
//######################################################################
|
||||
//######################################################################
|
||||
//######################################################################
|
||||
|
||||
//**********************************************************************
|
||||
CTL_Editor_MaskDescriptor::CTL_Editor_MaskDescriptor(CString _csName)
|
||||
{
|
||||
m_pri_csName = _csName;
|
||||
}
|
||||
|
||||
//**********************************************************************
|
||||
CTL_Editor_MaskDescriptor::~CTL_Editor_MaskDescriptor()
|
||||
{
|
||||
m_pri_fn_vEmptyList();
|
||||
}
|
||||
|
||||
//**********************************************************************
|
||||
CString CTL_Editor_MaskDescriptor::m_pub_fn_csGetName()
|
||||
{
|
||||
return m_pri_csName;
|
||||
}
|
||||
|
||||
//**********************************************************************
|
||||
CTL_Editor_Mask *CTL_Editor_MaskDescriptor::m_pub_fn_pclAddMask(CString _csString,
|
||||
unsigned long _ulValue)
|
||||
{
|
||||
CTL_Editor_Mask *pclNewMask = new CTL_Editor_Mask(_csString, _ulValue);
|
||||
|
||||
AddTail(pclNewMask);
|
||||
|
||||
return pclNewMask;
|
||||
}
|
||||
|
||||
//**********************************************************************
|
||||
void CTL_Editor_MaskDescriptor::m_pri_fn_vEmptyList()
|
||||
{
|
||||
POSITION pos = GetHeadPosition();
|
||||
|
||||
while ( pos != NULL )
|
||||
delete ( GetNext(pos) );
|
||||
|
||||
RemoveAll();
|
||||
}
|
||||
|
||||
|
||||
//######################################################################
|
||||
//######################################################################
|
||||
//######################################################################
|
||||
|
||||
//**********************************************************************
|
||||
CTL_Editor_MaskList::CTL_Editor_MaskList()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//**********************************************************************
|
||||
CTL_Editor_MaskList::~CTL_Editor_MaskList()
|
||||
{
|
||||
m_pub_fn_vEmptyList();
|
||||
}
|
||||
|
||||
//**********************************************************************
|
||||
CTL_Editor_MaskDescriptor *CTL_Editor_MaskList::m_pub_fn_pclAddMaskDescriptor(CString _csName)
|
||||
{
|
||||
CTL_Editor_MaskDescriptor *pclNewMaskDesc = new CTL_Editor_MaskDescriptor(_csName);
|
||||
|
||||
AddTail(pclNewMaskDesc);
|
||||
|
||||
return pclNewMaskDesc;
|
||||
}
|
||||
|
||||
//**********************************************************************
|
||||
void CTL_Editor_MaskList::m_pub_fn_vEmptyList()
|
||||
{
|
||||
POSITION pos = GetHeadPosition();
|
||||
|
||||
while ( pos != NULL )
|
||||
delete ( GetNext(pos) );
|
||||
|
||||
RemoveAll();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
CTL_Editor_MaskDescriptor *CTL_Editor_MaskList::m_fn_pclGetMaskDescriptorByName(CString _csDescriptorName)
|
||||
{
|
||||
CTL_Editor_MaskDescriptor *pclCurrent;
|
||||
BOOL bFound = FALSE;
|
||||
POSITION pos = GetHeadPosition();
|
||||
while ( (pos != NULL) && !bFound )
|
||||
{
|
||||
pclCurrent = GetNext(pos);
|
||||
bFound = ( pclCurrent->m_pub_fn_csGetName().CompareNoCase(_csDescriptorName) == 0 );
|
||||
}
|
||||
|
||||
if ( bFound )
|
||||
return pclCurrent;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
163
Rayman_X/cpa/tempgrp/Ctl/Src/Others/CTL_ODat.cpp
Normal file
163
Rayman_X/cpa/tempgrp/Ctl/Src/Others/CTL_ODat.cpp
Normal file
@@ -0,0 +1,163 @@
|
||||
// Definitions for the classes to handle lists of Owner Data
|
||||
//
|
||||
// YB
|
||||
///////////////////////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Others\CTL_ODat.hpp"
|
||||
|
||||
//External Modules
|
||||
#include "CTL_ErO.hpp"
|
||||
//End of External Modules
|
||||
|
||||
//#############################################################
|
||||
//#############################################################
|
||||
//#############################################################
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_OwnerData::CTL_OwnerData(void *_pvDataPtr,
|
||||
CString _csName)
|
||||
{
|
||||
m_pri_pvDataPtr = _pvDataPtr;
|
||||
m_pri_csName = _csName;
|
||||
|
||||
m_pri_tdeType = CTL_OWNER_DATA_TYPE_POINTER;
|
||||
|
||||
m_pri_lData = 0;
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_OwnerData::CTL_OwnerData(long _lData,
|
||||
CString _csName)
|
||||
{
|
||||
m_pri_lData = _lData;
|
||||
m_pri_csName = _csName;
|
||||
|
||||
m_pri_tdeType = CTL_OWNER_DATA_TYPE_LONG;
|
||||
|
||||
m_pri_pvDataPtr = NULL;
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_OwnerData::~CTL_OwnerData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
CString CTL_OwnerData::m_pub_fn_csGetName()
|
||||
{
|
||||
return m_pri_csName;
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
void *CTL_OwnerData::m_pub_fn_pvGetDataPtr()
|
||||
{
|
||||
//ANNECY CB
|
||||
// ERROR_ASSERT( m_pri_tdeType == CTL_OWNER_DATA_TYPE_POINTER );
|
||||
//END
|
||||
return m_pri_pvDataPtr;
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
void CTL_OwnerData::m_pub_fn_vSetDataPtr(void *_pvDataPtr)
|
||||
{
|
||||
m_pri_pvDataPtr = _pvDataPtr;
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
long CTL_OwnerData::m_pub_fn_lGetData()
|
||||
{
|
||||
//ANNECY CB
|
||||
// ERROR_ASSERT( m_pri_tdeType == CTL_OWNER_DATA_TYPE_LONG );
|
||||
//END
|
||||
return m_pri_lData;
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
void CTL_OwnerData::m_pub_fn_vSetData(long _lData)
|
||||
{
|
||||
m_pri_lData = _lData;
|
||||
}
|
||||
|
||||
|
||||
//#############################################################
|
||||
//#############################################################
|
||||
//#############################################################
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_ListOfOwnerData::CTL_ListOfOwnerData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_ListOfOwnerData::~CTL_ListOfOwnerData()
|
||||
{
|
||||
m_pub_fn_vEmptyListAndDestroyElements();
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
void CTL_ListOfOwnerData::m_pub_fn_vAddOwnerData(CTL_OwnerData *_pclNewOwnerData)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_OwnerData *CTL_ListOfOwnerData::m_pub_fn_pclAddOwnerData(void *_pvDataPtr,
|
||||
CString _csName)
|
||||
{
|
||||
CTL_OwnerData *pclNewOD = new CTL_OwnerData(_pvDataPtr, _csName);
|
||||
|
||||
AddTail(pclNewOD);
|
||||
|
||||
return pclNewOD;
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_OwnerData *CTL_ListOfOwnerData::m_pub_fn_pclAddOwnerData(long _lData,
|
||||
CString _csName)
|
||||
{
|
||||
CTL_OwnerData *pclNewOD = new CTL_OwnerData(_lData, _csName);;
|
||||
|
||||
AddTail(pclNewOD);
|
||||
|
||||
return pclNewOD;
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
void CTL_ListOfOwnerData::m_pub_fn_vEmptyListAndDestroyElements()
|
||||
{
|
||||
POSITION pos = GetHeadPosition();
|
||||
while ( pos != NULL )
|
||||
delete ( GetNext(pos) );
|
||||
|
||||
RemoveAll();
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
void CTL_ListOfOwnerData::m_pub_fn_vEmptyListWithoutDestroyingElements()
|
||||
{
|
||||
RemoveAll();
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
CTL_OwnerData *CTL_ListOfOwnerData::m_pub_fn_pclFindOwnerDataWithName(CString _csSearchedName)
|
||||
{
|
||||
CTL_OwnerData *pclCurrentOD;
|
||||
BOOL bFound = FALSE;
|
||||
POSITION pos = GetHeadPosition();
|
||||
while ( (pos != NULL) && (!bFound) )
|
||||
{
|
||||
pclCurrentOD = GetNext(pos);
|
||||
|
||||
bFound = ( pclCurrentOD->m_pub_fn_csGetName().Compare(_csSearchedName) == 0 );
|
||||
}
|
||||
|
||||
if ( bFound )
|
||||
return pclCurrentOD;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
203
Rayman_X/cpa/tempgrp/Ctl/Src/Others/CTL_Pri.cpp
Normal file
203
Rayman_X/cpa/tempgrp/Ctl/Src/Others/CTL_Pri.cpp
Normal file
@@ -0,0 +1,203 @@
|
||||
// Global private functions
|
||||
//
|
||||
// YB
|
||||
//////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Others\CTL_Pri.hpp"
|
||||
|
||||
#include "Controls\CTL_BCtl.hpp"
|
||||
#include "Controls\CTL_Ctl.hpp"
|
||||
|
||||
//External Modules
|
||||
#include "CTL_ErO.hpp"
|
||||
#include "IncTUT.h"
|
||||
//End of External Modules
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Global vars
|
||||
CString CTL_g_csModuleNameForErO;
|
||||
|
||||
//Module
|
||||
HMODULE CTL_g_hModule = 0;
|
||||
|
||||
//Cursors for BaseFormView class
|
||||
HCURSOR CTL_g_hcursor_CloseHand;
|
||||
HCURSOR CTL_g_hcursor_UpDownHand;
|
||||
|
||||
#ifndef CTL_WITH_NO_TUT
|
||||
//The TUT Dll Functions
|
||||
CTL_td_p_fn_vRegisterControl CTL_p_fn_vRegisterControl = NULL;
|
||||
CTL_td_p_fn_bUnregisterControl CTL_p_fn_bUnregisterControl = NULL;
|
||||
|
||||
//For TUT Module
|
||||
CString CTL_g_csCurrentTAG;
|
||||
CString CTL_g_csCurrentSecondaryInfo;
|
||||
#endif //CTL_WITH_NO_TUT
|
||||
|
||||
// End of Global vars
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
|
||||
//******************************************************************************
|
||||
void CTL_fn_vInternalInitModule()
|
||||
{
|
||||
//Computes version String
|
||||
CTL_g_csVersion = "2.0.3 [" + CString(__DATE__) + " (using TUT)]";
|
||||
|
||||
//Registers Module for ErO
|
||||
CTL_g_csModuleNameForErO = "Data / Controls DLL";
|
||||
|
||||
ERROR_g_fn_vAddAModuleDescriptor( CTL_g_csModuleNameForErO,
|
||||
CTL_g_csVersion,
|
||||
"Yves BABITCH",
|
||||
"01 48 18 53 32 (Montreuil)",
|
||||
"ybabitch@ubisoft.fr",
|
||||
"Daniel PALIX",
|
||||
"04 50 51 26 63 (Annecy)",
|
||||
"dpalix@ubisoft.fr",
|
||||
"","",""
|
||||
);
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
long CTL_fn_lComputeSizeOfStaticForName(class CTL_Editor_BaseControl *_pclSenderBaseControl)
|
||||
{
|
||||
CTL_Editor_Control *pclControl = _pclSenderBaseControl->m_pub_fn_pclGetParentControl();
|
||||
|
||||
ERROR_ASSERT( pclControl != NULL );
|
||||
|
||||
CString csTextToDisplay = pclControl->m_pub_fn_csGetControlName();
|
||||
|
||||
CClientDC dc(_pclSenderBaseControl->m_fn_pclGetWnd());
|
||||
dc.SelectObject(_pclSenderBaseControl->m_fn_pclGetWnd()->GetFont());
|
||||
|
||||
return ( dc.GetTextExtent(csTextToDisplay).cx + 6 );
|
||||
}
|
||||
|
||||
#ifndef CTL_WITH_NO_TUT
|
||||
//******************************************************************************
|
||||
BOOL CTL_fn_bGetTUT_DLLFunctions()
|
||||
{
|
||||
if ( CTL_p_fn_vRegisterControl == NULL )
|
||||
{
|
||||
//Gets Module
|
||||
#ifdef _DEBUG
|
||||
HMODULE hTUTModule = (HMODULE)LoadLibrary("Edt_Data\\Tools\\TUTDFEvd.dll");
|
||||
#else
|
||||
HMODULE hTUTModule = (HMODULE)LoadLibrary("Edt_Data\\Tools\\TUTDFEvr.dll");
|
||||
#endif //_DEBUG_
|
||||
|
||||
if ( hTUTModule != NULL )
|
||||
{
|
||||
//Gets functions
|
||||
FARPROC Function = GetProcAddress(hTUTModule, "fn_vRegisterControl");
|
||||
|
||||
CTL_p_fn_vRegisterControl = (CTL_td_p_fn_vRegisterControl)Function;
|
||||
|
||||
if ( CTL_p_fn_bUnregisterControl == NULL )
|
||||
{
|
||||
Function = GetProcAddress(hTUTModule, "fn_bUnregisterControl");
|
||||
CTL_p_fn_bUnregisterControl = (CTL_td_p_fn_bUnregisterControl)Function;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ( (CTL_p_fn_vRegisterControl != NULL) && (CTL_p_fn_bUnregisterControl != NULL) );
|
||||
}
|
||||
#endif //CTL_WITH_NO_TUT
|
||||
|
||||
//**************************************************************************
|
||||
void CTL_fn_vSetMemoryForFloat(void *pvDest,
|
||||
long double ldfSourceValue,
|
||||
char cDataLength)
|
||||
{
|
||||
//ANNECY CB
|
||||
#if 0
|
||||
ERROR_PREPARE_M(CTL_g_csModuleNameForErO,
|
||||
"Seting memory to update a motor data",
|
||||
"CTL_fn_vSetMemoryForFloat(...)",
|
||||
E_ERROR_GRAVITY_INSTABLE,
|
||||
"The destination is not a valid pointer : memory has not been updated");
|
||||
ERROR_ASSERT( pvDest != NULL );
|
||||
#endif
|
||||
//END
|
||||
if ( pvDest != NULL )
|
||||
{
|
||||
switch ( cDataLength )
|
||||
{
|
||||
case sizeof(float)/*FLOAT*/ :
|
||||
{
|
||||
float fTempValue = (float)ldfSourceValue;
|
||||
memcpy(pvDest, &fTempValue, sizeof(float));
|
||||
}
|
||||
break;
|
||||
|
||||
/* case DOUBLE :
|
||||
{
|
||||
double dfTempValue = (double)ldfSourceValue;
|
||||
memcpy(pvDest, &dfTempValue, sizeof(double));
|
||||
}
|
||||
break;
|
||||
|
||||
case LONG_DOUBLE :
|
||||
{
|
||||
long double ldfTempValue = (long double)ldfSourceValue;
|
||||
memcpy(pvDest, &ldfTempValue, sizeof(long double));
|
||||
}
|
||||
break;
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
void CTL_fn_vGetMemoryForFloat(void *pvSource,
|
||||
long double &r_ldfEditorValue,
|
||||
char cDataLength)
|
||||
{
|
||||
//ANNECY CB
|
||||
#if 0
|
||||
ERROR_PREPARE_M(CTL_g_csModuleNameForErO,
|
||||
"Seting memory to update a motor data",
|
||||
"CTL_fn_vGetMemoryForFloat(...)",
|
||||
E_ERROR_GRAVITY_INSTABLE,
|
||||
"The source is not a valid pointer : memory has not been updated");
|
||||
ERROR_ASSERT( pvSource != NULL );
|
||||
#endif
|
||||
//END
|
||||
|
||||
if ( pvSource != NULL )
|
||||
{
|
||||
switch ( cDataLength )
|
||||
{
|
||||
case sizeof(float) :
|
||||
{
|
||||
float fTempValue;
|
||||
memcpy(&fTempValue, pvSource, sizeof(float));
|
||||
r_ldfEditorValue = fTempValue;
|
||||
}
|
||||
break;
|
||||
|
||||
/* case DOUBLE :
|
||||
{
|
||||
double dfTempValue;
|
||||
memcpy(&dfTempValue, pvSource, sizeof(double));
|
||||
r_ldfEditorValue = dfTempValue;
|
||||
}
|
||||
break;
|
||||
|
||||
case LONG_DOUBLE :
|
||||
{
|
||||
long double ldfTempValue;
|
||||
memcpy(&ldfTempValue, pvSource, sizeof(long double));
|
||||
r_ldfEditorValue = ldfTempValue;
|
||||
}
|
||||
break;
|
||||
*/
|
||||
default:
|
||||
ERROR_ASSERT( FALSE );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
190
Rayman_X/cpa/tempgrp/Ctl/Src/Others/CTL_Pub.cpp
Normal file
190
Rayman_X/cpa/tempgrp/Ctl/Src/Others/CTL_Pub.cpp
Normal file
@@ -0,0 +1,190 @@
|
||||
// Global public functions
|
||||
//
|
||||
// YB
|
||||
//////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Others\CTL_Pub.hpp"
|
||||
|
||||
//External Modules
|
||||
#include "CTL_ErO.hpp"
|
||||
//End of External Modules
|
||||
|
||||
long CTL_g_lCurrentId = 10000;
|
||||
|
||||
CString CTL_g_csVersion;
|
||||
|
||||
CTL_td_p_fn_bControlCanBeDisplayed CTL_g_p_fnDefaultCallBack_ControlCanBeDisplayed = NULL;
|
||||
CTL_td_p_fn_vCallBackWhenDataHasChanged CTL_g_p_fnDefaultCallBack_DataHasChanged = NULL;
|
||||
|
||||
CTL_td_p_fn_vStaticHasBeenClicked CTL_g_p_fnDefaultCallBack_StaticHasBeenClicked = NULL;
|
||||
CTL_tdp_fn_vGetColor CTL_g_p_fnDefaultCallBack_GetColor = NULL;
|
||||
|
||||
#ifndef CTL_WITH_NO_TUT
|
||||
//For TUT Module
|
||||
extern CString CTL_g_csCurrentTAG;
|
||||
extern CString CTL_g_csCurrentSecondaryInfo;
|
||||
#endif //CTL_WITH_NO_TUT
|
||||
|
||||
|
||||
//******************************************************************************
|
||||
void CTL_fn_vSetDefaultCallBackFunctionWhenControlMustBeDisplayed(CTL_td_p_fn_bControlCanBeDisplayed _p_fnCallBack)
|
||||
{
|
||||
CTL_g_p_fnDefaultCallBack_ControlCanBeDisplayed = _p_fnCallBack;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
void CTL_fn_vSetDefaultCallBackFunctionWhenDataHasChanged(CTL_td_p_fn_vCallBackWhenDataHasChanged _p_fnCallBack)
|
||||
{
|
||||
CTL_g_p_fnDefaultCallBack_DataHasChanged = _p_fnCallBack;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
void CTL_fn_vSetDefaultCallBackFunctionWhenStaticIsClicked(CTL_td_p_fn_vStaticHasBeenClicked _p_fnDefaultCallBack_StaticHasBeenClicked)
|
||||
{
|
||||
CTL_g_p_fnDefaultCallBack_StaticHasBeenClicked = _p_fnDefaultCallBack_StaticHasBeenClicked;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
void CTL_fn_vSetDefaultCallBackFunctionToGetStaticColor(CTL_tdp_fn_vGetColor _p_fnDefaultCallBack_StaticColor)
|
||||
{
|
||||
CTL_g_p_fnDefaultCallBack_GetColor = _p_fnDefaultCallBack_StaticColor;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
CString CTL_fn_csGetVersion()
|
||||
{
|
||||
return CTL_g_csVersion;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
void CTL_fn_vSetModuleInfo(CString _csTAG,
|
||||
CString _csSecondaryInfo)
|
||||
{
|
||||
#ifndef CTL_WITH_NO_TUT
|
||||
ERROR_PREPARE_M(CTL_g_csModuleNameForErO,
|
||||
"Setting Module info for controls registration (TUT)",
|
||||
"CTL_fn_csSetModuleInfo(...)",
|
||||
E_ERROR_GRAVITY_INSTABLE,
|
||||
"You are going to overwrite the actual Module name ! Please call 'CTL_fn_vResetModuleInfo()'");
|
||||
ERROR_ASSERT( CTL_g_csCurrentTAG.IsEmpty() );
|
||||
|
||||
CTL_g_csCurrentTAG = _csTAG;
|
||||
CTL_g_csCurrentSecondaryInfo = _csSecondaryInfo;
|
||||
#endif //CTL_WITH_NO_TUT
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
void CTL_fn_vResetModuleInfo()
|
||||
{
|
||||
#ifndef CTL_WITH_NO_TUT
|
||||
CTL_g_csCurrentTAG = "";
|
||||
CTL_g_csCurrentSecondaryInfo = "";
|
||||
#endif //CTL_WITH_NO_TUT
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
CString CTL_fn_csGetCurrentTAG()
|
||||
{
|
||||
#ifndef CTL_WITH_NO_TUT
|
||||
return CTL_g_csCurrentTAG;
|
||||
#endif //CTL_WITH_NO_TUT
|
||||
|
||||
return "<< CTL is not using TUT ! >>";
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
CString CTL_fn_csGetCurrentSecondaryInfo()
|
||||
{
|
||||
#ifndef CTL_WITH_NO_TUT
|
||||
return CTL_g_csCurrentSecondaryInfo;
|
||||
#endif //CTL_WITH_NO_TUT
|
||||
|
||||
return "<< CTL is not using TUT ! >>";
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
void CTL_fn_vSetMemory(void *pvDest,
|
||||
void *pvSource,
|
||||
char cDataLength)
|
||||
{
|
||||
//ANNECY CB
|
||||
#if 0
|
||||
ERROR_PREPARE_M(CTL_g_csModuleNameForErO,
|
||||
"Seting memory to update a motor data",
|
||||
"CTL_fn_vSetMemory(...)",
|
||||
E_ERROR_GRAVITY_INSTABLE,
|
||||
"The source is not a valid pointer : memory has not been updated");
|
||||
ERROR_ASSERT( pvSource != NULL );
|
||||
ERROR_PREPARE_M(CTL_g_csModuleNameForErO,
|
||||
"Seting memory to update a motor data",
|
||||
"CTL_fn_vSetMemory(...)",
|
||||
E_ERROR_GRAVITY_INSTABLE,
|
||||
"The destination is not a valid pointer : memory has not been updated");
|
||||
ERROR_ASSERT( pvDest != NULL );
|
||||
#endif
|
||||
//END
|
||||
|
||||
if ( (pvSource != NULL) && (pvDest != NULL) )
|
||||
{
|
||||
if (cDataLength == 0)
|
||||
{
|
||||
*((char *)pvDest) &=0xf0;
|
||||
*((char *)pvDest) |= *((char *)pvSource);
|
||||
}
|
||||
else
|
||||
memcpy(pvDest, pvSource, cDataLength);
|
||||
}
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
void CTL_fn_vGetMemory(void *pvSource,
|
||||
void *pvDest,
|
||||
char cDataLength)
|
||||
{
|
||||
//ANNECY CB
|
||||
#if 0
|
||||
ERROR_PREPARE_M(CTL_g_csModuleNameForErO,
|
||||
"Geting memory to update a motor data",
|
||||
"CTL_fn_vGetMemory(...)",
|
||||
E_ERROR_GRAVITY_INSTABLE,
|
||||
"The source is not a valid pointer : memory has not been updated");
|
||||
ERROR_ASSERT( pvSource != NULL );
|
||||
ERROR_PREPARE_M(CTL_g_csModuleNameForErO,
|
||||
"Geting memory to update a motor data",
|
||||
"CTL_fn_vGetMemory(...)",
|
||||
E_ERROR_GRAVITY_INSTABLE,
|
||||
"The destination is not a valid pointer : memory has not been updated");
|
||||
ERROR_ASSERT( pvDest != NULL );
|
||||
#endif
|
||||
//END
|
||||
|
||||
if ( (pvSource != NULL) && (pvDest != NULL) )
|
||||
{
|
||||
if (cDataLength == 0)
|
||||
{
|
||||
memcpy(pvDest, pvSource, 1);
|
||||
*((char *)pvDest) &= 0x0f;
|
||||
}
|
||||
else
|
||||
memcpy(pvDest, pvSource, cDataLength);
|
||||
}
|
||||
}
|
||||
|
||||
//****************************************************************************
|
||||
//Returns 'CTL_g_lCurrentId', and adds one to it
|
||||
//.... Will be improved in future versions ....
|
||||
long CTL_fn_lGetNextAvailableIDForControl()
|
||||
{
|
||||
CTL_g_lCurrentId ++;
|
||||
|
||||
return (CTL_g_lCurrentId - 1);
|
||||
}
|
||||
|
||||
//****************************************************************************
|
||||
//Returns the last returned ID
|
||||
long CPA_EXPORT CTL_fn_lGetCurrentIDForControl()
|
||||
{
|
||||
return (CTL_g_lCurrentId - 1);
|
||||
}
|
||||
|
88
Rayman_X/cpa/tempgrp/Ctl/Src/Others/CTL_TTT.cpp
Normal file
88
Rayman_X/cpa/tempgrp/Ctl/Src/Others/CTL_TTT.cpp
Normal file
@@ -0,0 +1,88 @@
|
||||
// Implementation for the class CMyDocument
|
||||
//
|
||||
// YB
|
||||
//
|
||||
/////////////////////////////////////////////
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Others\CTL_TTT.hpp"
|
||||
|
||||
//==================================================================================================
|
||||
//==================================================================================================
|
||||
|
||||
tdoTTTData &CTL_ToolTipTextDatabase::operator [](unsigned int uiControlId)
|
||||
{
|
||||
POSITION xPos;
|
||||
tdoTTTData *p_stData;
|
||||
|
||||
//look in the list for an existing association
|
||||
xPos = m_oDataList.GetHeadPosition();
|
||||
while ( xPos && (p_stData = m_oDataList.GetNext(xPos)) )
|
||||
if ( p_stData->m_uiId() == uiControlId )
|
||||
return *p_stData;
|
||||
|
||||
//none were found, add a dummy one
|
||||
p_stData = new tdoTTTData();
|
||||
p_stData->m_roSet(""); //bbb 17/03/97
|
||||
p_stData->m_uiId(uiControlId); //bbb 17/03/97
|
||||
m_oDataList.AddTail(p_stData);
|
||||
return *p_stData;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
|
||||
CTL_ToolTipTextDatabase::~CTL_ToolTipTextDatabase()
|
||||
{
|
||||
while ( !m_oDataList.IsEmpty() )
|
||||
{
|
||||
tdoTTTData *p_stData = m_oDataList.GetHead();
|
||||
m_oDataList.RemoveHead();
|
||||
delete p_stData;
|
||||
}
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
//==================================================================================================
|
||||
|
||||
tdoTTTData::~tdoTTTData()
|
||||
{ //bbb 17/03/97 tout dedans
|
||||
m_uiId(-1);
|
||||
if ( m_pszModelText )
|
||||
free((void *) m_pszModelText);
|
||||
if ( m_pszInstanceText )
|
||||
free((void *) m_pszInstanceText);
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
tdoTTTData::tdoTTTData()
|
||||
{
|
||||
m_uiId(-1); //bbb 17/03/97
|
||||
m_pszModelText = m_pszInstanceText = NULL; //bbb 17/03/97
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
|
||||
tdoTTTData &tdoTTTData::m_roSet(char *_pszModelText, char *_pszInstanceText)
|
||||
{ //bbb 17/03/97 tout dedans
|
||||
ASSERT(_pszModelText);
|
||||
|
||||
if ( m_pszModelText )
|
||||
free((void *) m_pszModelText);
|
||||
if ( m_pszInstanceText )
|
||||
free((void *) m_pszInstanceText);
|
||||
|
||||
m_pszModelText = strdup(_pszModelText);
|
||||
m_pszInstanceText = strdup(_pszInstanceText ? _pszInstanceText : _pszModelText);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
|
||||
const char *tdoTTTData::operator [](BOOL bIsAModel)
|
||||
{ //bbb 17/03/97 tout dedans
|
||||
return bIsAModel
|
||||
? m_pszModelText
|
||||
: m_pszInstanceText;
|
||||
}
|
||||
|
Reference in New Issue
Block a user