40#ifndef INCLUDED_DISTI_CALLBACK_CALLER_H
41#define INCLUDED_DISTI_CALLBACK_CALLER_H
51# define _snprintf snprintf
59template<
class T,
class O = DisplayObject>
136 O* targetObject =
dynamic_cast<O*
>( target );
149 obj =
dynamic_cast<T*
>( targetComp->ParentDisplayFrame() );
153 obj =
dynamic_cast<T*
>( targetObject->DisplayObject::Parent() );
164 return ( obj->*(
_method._1 ) )( targetObject, ev );
174 if( callbackData == NULL )
291 std::stringstream strmNew;
292 std::stringstream strmOld;
299 strNew = strmNew.str();
300 strOld = strmOld.str();
302 if( strNew.compare( strOld ) != 0 )
310 std::string str = std::string(
_attribName ) +
" " + strNew;
311 ObjectEvent newEvent( displayObj,
"AttributeChanged", str.c_str() );
312 displayObj->handle( &newEvent );
The CallbackMethodCallerBase class.
Definition: callback_caller.h:255
const AttributeName & _attribName
Definition: callback_caller.h:285
T & _curVal
Definition: callback_caller.h:284
T _prevVal
Definition: callback_caller.h:283
bool _emitEvent
whether or not to emit an event
Definition: callback_caller.h:286
void EmitAttributeChangedEventProperty()
Emits an "AttributeChanged" ObjectEvent, and calls NotifyAttributeChanged to tell subscribers that th...
Definition: callback_caller.h:289
AttributeChangedEventEmitter(AttributeChangedNotifier *container, T &val, const AttributeName &attribName, bool emitEvent=false)
Definition: callback_caller.h:263
~AttributeChangedEventEmitter()
Definition: callback_caller.h:273
AttributeChangedNotifier * _container
Definition: callback_caller.h:282
Definition: disti_metadata.h:514
virtual void NotifyAttributeChanged(const AttributeName &name)=0
Definition: disti_metadata.h:87
Definition: callback_caller.h:195
virtual CallbackMethodCallerBase * Duplicate() const override
Definition: callback_caller.h:211
virtual void SetContainer(DisplayObject *container) override
Definition: callback_caller.h:217
int Call(DisplayObject *, DisplayEvent *) override
Definition: callback_caller.h:223
AttributeName _attributeName
The associated property name for the callback.
Definition: callback_caller.h:243
void CallType3() override
Allows for a very simple callback, with no additional data passed.
Definition: callback_caller.h:228
void(T::* MethodType)(void)
Typedef for function pointer.
Definition: callback_caller.h:197
T * _container
The object which contains the method to call.
Definition: callback_caller.h:242
void CallType2(DisplayEvent *, void *=NULL) override
Definition: callback_caller.h:226
CallbackAttributeNotifier(T *container, const AttributeName &attributeName, MethodType method=NULL)
Definition: callback_caller.h:204
MethodType _method
The function pointer to call back.
Definition: callback_caller.h:244
Definition: callback_caller_base.h:56
Definition: callback_caller.h:61
int(T::* MethodType1)(O *, DisplayEvent *)
Typedef for functions matching base class' Call signature.
Definition: callback_caller.h:63
virtual CallbackMethodCallerBase * Duplicate() const override
Definition: callback_caller.h:119
void(T::* MethodType2)(DisplayEvent *ev, void *)
Typedef for functions matching base class' CallType2 signature.
Definition: callback_caller.h:64
virtual void SetContainer(DisplayObject *container) override
Definition: callback_caller.h:129
CallbackMethodCallerTemplate(MethodType2 method, T *container, void *callbackData=NULL)
Definition: callback_caller.h:100
void CallType3() override
Allows for a very simple callback, with no additional data passed.
Definition: callback_caller.h:181
union disti::CallbackMethodCallerTemplate::@0 _method
The function pointer to call back.
void * _callbackData
Only used for MethodType2.
Definition: callback_caller.h:69
T * _container
The object which contains the method to call.
Definition: callback_caller.h:70
int _methodType
The method type (1, 2, or 3).
Definition: callback_caller.h:68
void(T::* MethodType3)(void)
Typedef for functions matching base class' CallType3 signature.
Definition: callback_caller.h:65
int Call(DisplayObject *target, DisplayEvent *ev) override
Definition: callback_caller.h:134
void CallType2(DisplayEvent *ev, void *callbackData=NULL) override
Definition: callback_caller.h:170
CallbackMethodCallerTemplate(MethodType3 method, T *container)
Definition: callback_caller.h:111
CallbackMethodCallerTemplate(MethodType1 method, T *container=NULL)
Definition: callback_caller.h:88
Definition: component_base.h:68
The disti::DisplayObject class and global enumerations.
The disti::DisplayFrame class.
The standard Mouse and keyboard events and event structures.
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:214
Force inclusion of the DirectShow library.
Definition: bmpimage.h:47