40 #ifndef _CALLBACK_CALLER_H
41 #define _CALLBACK_CALLER_H
50 #define _snprintf snprintf
59 template<
class T,
class O = DisplayObject>
65 typedef void (T::*MethodType3)(void);
93 _callbackData(callbackData),
101 _container(container)
109 newOne->_callbackData = _callbackData;
110 newOne->_method = _method;
111 newOne->_methodType = _methodType;
112 newOne->_container = _container;
118 _container =
dynamic_cast<T*
>(container);
124 O* targetObject =
dynamic_cast<O*
>(target);
125 if (_method._1 && _methodType == 1 && targetObject)
131 obj =
dynamic_cast<T*
>(targetObject->DisplayObject::Parent());
134 return (obj->*(_method._1))(targetObject, ev);
140 void CallType2(
DisplayEvent* ev,
void* callbackData = NULL)
142 if (_method._2 && _methodType == 2 && _container)
144 if (callbackData == NULL)
145 callbackData = _callbackData;
147 (_container->*(_method._2))(ev, callbackData);
153 if (_method._3 && _methodType == 3 && _container)
155 (_container->*(_method._3))();
167 typedef void ( T::*MethodType )( void );
171 : _container( container )
172 , _attributeName( attributeName )
185 _container =
dynamic_cast<T*
>( container );
191 void CallType2(
DisplayEvent* ,
void* callbackData = NULL ) {}
198 _container->NotifyAttributeChanged( _attributeName );
202 ( _container->*( _method ) )();
235 _emitEvent( emitEvent )
257 std::stringstream strmNew;
258 std::stringstream strmOld;
265 strNew = strmNew.str();
266 strOld = strmOld.str();
268 if( strNew.compare( strOld ) != 0 )
274 if(
DisplayObject* displayObj = dynamic_cast<DisplayObject*>( _container ) )
276 std::string str = std::string( _attribName ) +
" " + strNew;
277 ObjectEvent newEvent( displayObj,
"AttributeChanged", str.c_str() );
278 displayObj->handle( &newEvent );
void EmitAttributeChangedEventProperty()
Definition: callback_caller.h:255
AttributeChangedEventEmitter(AttributeChangedNotifier *container, T &val, const AttributeName &attribName, bool emitEvent=false)
Definition: callback_caller.h:230
~AttributeChangedEventEmitter()
Definition: callback_caller.h:240
T _prevVal
Definition: callback_caller.h:250
The disti::DisplayObject class and global enumerations.
AttributeChangedNotifier * _container
Definition: callback_caller.h:249
The CallbackMethodCallerBase class.
The standard Mouse and keyboard events and event structures.
const AttributeName & _attribName
Definition: callback_caller.h:252
Definition: callback_caller.h:221
T & _curVal
Definition: callback_caller.h:251
Definition: callback_caller_base.h:56
The disti::DisplayFrame class.
Definition: callback_caller.h:164
Definition: callback_caller.h:60
Definition: disti_metadata.h:447
virtual void NotifyAttributeChanged(const AttributeName &name)=0
Definition: disti_metadata.h:83
Definition: bmpimage.h:46