Based on patch from Louis Lenders xerox.xerox2000x@gmail.com
From: Vijay Kiran Kamuju infyquest@gmail.com Signed-off-by: Vijay Kiran Kamuju infyquest@gmail.com --- dlls/uianimation/main.c | 219 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 219 insertions(+)
diff --git a/dlls/uianimation/main.c b/dlls/uianimation/main.c index 765d116aeb..074b86e279 100644 --- a/dlls/uianimation/main.c +++ b/dlls/uianimation/main.c @@ -597,6 +597,225 @@ HRESULT animation_transition_create( IUnknown *outer, REFIID iid, void **obj ) return hr; }
+/*********************************************************************** + * IUITransitionLibrary + */ +struct tr_library +{ + IUIAnimationTransitionLibrary IUIAnimationTransitionLibrary_iface; + LONG ref; +}; + +struct tr_library *impl_from_IUIAnimationTransitionLibrary( IUIAnimationTransitionLibrary *iface ) +{ + return CONTAINING_RECORD( iface, struct tr_library, IUIAnimationTransitionLibrary_iface ); +} + +static HRESULT WINAPI WINAPI tr_library_QueryInterface( IUIAnimationTransitionLibrary *iface, REFIID iid, void **obj ) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IUIAnimationTransitionLibrary )) + { + IUIAnimationTransitionLibrary_AddRef( iface ); + *obj = iface; + return S_OK; + } + + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI tr_library_AddRef( IUIAnimationTransitionLibrary *iface ) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); + + TRACE( "(%p) ref = %u\n", This, ref ); + return ref; +} + +static ULONG WINAPI tr_library_Release( IUIAnimationTransitionLibrary *iface ) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE( "(%p) ref = %u\n", This, ref ); + + if (!ref) + heap_free( This ); + + return ref; +} + +static HRESULT WINAPI tr_library_CreateInstantaneousTransition(IUIAnimationTransitionLibrary *iface, + double finalValue, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + struct animation_transition *tr = heap_alloc( sizeof(*tr) ); + HRESULT hr; + + FIXME( "stub (%p)->( )\n", This ); + + if (!tr) return E_OUTOFMEMORY; + tr->IUIAnimationTransition_iface.lpVtbl = &animation_transition_vtbl; + tr->ref = 1; + + hr = animation_transition_QueryInterface( &tr->IUIAnimationTransition_iface, &IID_IUIAnimationTransition, (void **)transition ); + + IUIAnimationTransition_Release( &tr->IUIAnimationTransition_iface ); + return hr; +} + +static HRESULT WINAPI tr_library_CreateConstantTransition(IUIAnimationTransitionLibrary *iface, + double duration, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateDiscreteTransition(IUIAnimationTransitionLibrary *iface, + double delay, double finalValue, double hold, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateLinearTransition(IUIAnimationTransitionLibrary *iface, + double duration, double finalValue, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + struct animation_transition *tr = heap_alloc( sizeof(*tr) ); + HRESULT hr; + + FIXME( "stub (%p)->( )\n", This ); + + if (!tr) return E_OUTOFMEMORY; + tr->IUIAnimationTransition_iface.lpVtbl = &animation_transition_vtbl; + tr->ref = 1; + + hr = animation_transition_QueryInterface( &tr->IUIAnimationTransition_iface, &IID_IUIAnimationTransition, (void **)transition ); + + IUIAnimationTransition_Release( &tr->IUIAnimationTransition_iface ); + return hr; +} + +static HRESULT WINAPI tr_library_CreateLinearTransitionFromSpeed(IUIAnimationTransitionLibrary *iface, + double speed, double finalValue, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateSinusoidalTransitionFromVelocity(IUIAnimationTransitionLibrary *iface, + double duration, double period, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateSinusoidalTransitionFromRange(IUIAnimationTransitionLibrary *iface, + double duration, double minimumValue, double maximumValue, double period, + UI_ANIMATION_SLOPE slope, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateAccelerateDecelerateTransition(IUIAnimationTransitionLibrary *iface, + double duration, double finalValue, double accelerationRatio, double decelerationRatio, + IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateReversalTransition(IUIAnimationTransitionLibrary *iface, double duration, + IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateCubicTransition(IUIAnimationTransitionLibrary *iface, double duration, + double finalValue, double finalVelocity, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI tr_library_CreateSmoothStopTransition(IUIAnimationTransitionLibrary *iface, double maximumDuration, double finalValue, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + struct animation_transition *tr = heap_alloc( sizeof(*tr) ); + HRESULT hr; + + FIXME( "stub (%p)->( )\n", This ); + + if (!tr) return E_OUTOFMEMORY; + tr->IUIAnimationTransition_iface.lpVtbl = &animation_transition_vtbl; + tr->ref = 1; + + hr = animation_transition_QueryInterface( &tr->IUIAnimationTransition_iface, &IID_IUIAnimationTransition, (void **)transition ); + + IUIAnimationTransition_Release( &tr->IUIAnimationTransition_iface ); + return hr; +} + +static HRESULT WINAPI tr_library_CreateParabolicTransitionFromAcceleration(IUIAnimationTransitionLibrary *iface, + double finalValue, double finalVelocity, double acceleration, IUIAnimationTransition **transition) +{ + struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +const struct IUIAnimationTransitionLibraryVtbl tr_library_vtbl = +{ + tr_library_QueryInterface, + tr_library_AddRef, + tr_library_Release, + tr_library_CreateInstantaneousTransition, + tr_library_CreateConstantTransition, + tr_library_CreateDiscreteTransition, + tr_library_CreateLinearTransition, + tr_library_CreateLinearTransitionFromSpeed, + tr_library_CreateSinusoidalTransitionFromVelocity, + tr_library_CreateSinusoidalTransitionFromRange, + tr_library_CreateAccelerateDecelerateTransition, + tr_library_CreateReversalTransition, + tr_library_CreateCubicTransition, + tr_library_CreateSmoothStopTransition, + tr_library_CreateParabolicTransitionFromAcceleration, +}; + +HRESULT tr_library_create( IUnknown *outer, REFIID iid, void **obj ) +{ + struct tr_library *This = heap_alloc( sizeof(*This) ); + HRESULT hr; + + if (!This) return E_OUTOFMEMORY; + This->IUIAnimationTransitionLibrary_iface.lpVtbl = &tr_library_vtbl; + This->ref = 1; + + hr = IUIAnimationTransitionLibrary_QueryInterface( &This->IUIAnimationTransitionLibrary_iface, iid, obj ); + + IUIAnimationTransitionLibrary_Release( &This->IUIAnimationTransitionLibrary_iface ); + return hr; +} + BOOL WINAPI DllMain( HINSTANCE dll, DWORD reason, LPVOID reserved ) { TRACE("(%p %d %p)\n", dll, reason, reserved);