tahoma2d/toonz/sources/include/tparamchange.h

66 lines
1.7 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef TPARAMCHANGE_INCLUDED
#define TPARAMCHANGE_INCLUDED
// TnzCore includes
#include "tcommon.h"
#undef DVAPI
#undef DVVAR
#ifdef TPARAM_EXPORTS
#define DVAPI DV_EXPORT_API
#define DVVAR DV_EXPORT_VAR
#else
#define DVAPI DV_IMPORT_API
#define DVVAR DV_IMPORT_VAR
#endif
//===========================================================
// Forward declarations
class TParam;
//===========================================================
//*****************************************************************************************
// TParamChange declaration
//*****************************************************************************************
2016-06-15 18:43:10 +12:00
class DVAPI TParamChange {
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
TParam *m_param; //!< (not owned) The parameter being changed
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
double m_firstAffectedFrame,
m_lastAffectedFrame; //!< First and last frames affected by the change
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
bool
m_keyframeChanged; //!< Whether a keyframe has been altered by the change
bool m_dragging; //!< Whether the change is about a mouse being dragged
bool m_undoing; //!< Whether the change is happening within an undo operation
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
static double m_minFrame;
static double m_maxFrame;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
TParamChange(TParam *param, double firstAffectedFrame,
double lastAffectedFrame, bool keyframeChanged, bool dragging,
bool undoing);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
virtual ~TParamChange() {}
2016-03-19 06:57:51 +13:00
};
//*****************************************************************************************
// TParamObserver definition
//*****************************************************************************************
2016-06-15 18:43:10 +12:00
class DVAPI TParamObserver {
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
virtual ~TParamObserver() {}
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
virtual void onChange(const TParamChange &) = 0;
2016-03-19 06:57:51 +13:00
};
2016-06-15 18:43:10 +12:00
#endif // TPARAMCHANGE_INCLUDED