From e95f5c6de6b725baabf59a4767c722b4589bd7cc Mon Sep 17 00:00:00 2001 From: Louis Lenders Date: Thu, 7 Jun 2018 11:51:01 +0200 Subject: [PATCH] uianimation: Add stub dll Reordered code to stop the need of forwards declare. Removed private header. Split into multiple changes. Signed-off-by: Louis Lenders --- configure | 2 + configure.ac | 1 + dlls/uianimation/Makefile.in | 7 + dlls/uianimation/main.c | 959 +++++++++++++++++++++++++++++++ dlls/uianimation/uianimation.spec | 4 + dlls/uianimation/uianimation_typelib.idl | 23 + 6 files changed, 996 insertions(+) create mode 100644 dlls/uianimation/Makefile.in create mode 100644 dlls/uianimation/main.c create mode 100644 dlls/uianimation/uianimation.spec create mode 100644 dlls/uianimation/uianimation_typelib.idl diff --git a/configure b/configure index dd1d347..bb4025c 100755 --- a/configure +++ b/configure @@ -1547,6 +1547,7 @@ enable_traffic enable_twain_32 enable_tzres enable_ucrtbase +enable_uianimation enable_uiautomationcore enable_uiribbon enable_unicows @@ -19983,6 +19984,7 @@ wine_fn_config_makefile dlls/typelib.dll16 enable_win16 wine_fn_config_makefile dlls/tzres enable_tzres wine_fn_config_makefile dlls/ucrtbase enable_ucrtbase wine_fn_config_makefile dlls/ucrtbase/tests enable_tests +wine_fn_config_makefile dlls/uianimation enable_uianimation wine_fn_config_makefile dlls/uiautomationcore enable_uiautomationcore wine_fn_config_makefile dlls/uiribbon enable_uiribbon wine_fn_config_makefile dlls/unicows enable_unicows diff --git a/configure.ac b/configure.ac index 119c4ce..584a2d7 100644 --- a/configure.ac +++ b/configure.ac @@ -3722,6 +3722,7 @@ WINE_CONFIG_MAKEFILE(dlls/typelib.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/tzres) WINE_CONFIG_MAKEFILE(dlls/ucrtbase) WINE_CONFIG_MAKEFILE(dlls/ucrtbase/tests) +WINE_CONFIG_MAKEFILE(dlls/uianimation) WINE_CONFIG_MAKEFILE(dlls/uiautomationcore) WINE_CONFIG_MAKEFILE(dlls/uiribbon) WINE_CONFIG_MAKEFILE(dlls/unicows) diff --git a/dlls/uianimation/Makefile.in b/dlls/uianimation/Makefile.in new file mode 100644 index 0000000..bc303b3 --- /dev/null +++ b/dlls/uianimation/Makefile.in @@ -0,0 +1,7 @@ +MODULE = uianimation.dll +IMPORTS = uuid ole32 + +C_SRCS = \ + main.c +IDL_SRCS = \ + uianimation_typelib.idl diff --git a/dlls/uianimation/main.c b/dlls/uianimation/main.c new file mode 100644 index 0000000..6101827 --- /dev/null +++ b/dlls/uianimation/main.c @@ -0,0 +1,959 @@ +/* + * Uianimation main file. + * + * Copyright (C) 2018 Louis Lenders + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" +#include "rpcproxy.h" +#include "oaidl.h" +#include "ocidl.h" + +#include "initguid.h" +#include "uianimation.h" + +#include "wine/heap.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(uianimation); + +static HINSTANCE hinstance; + +struct class_factory +{ + IClassFactory IClassFactory_iface; + HRESULT (*create_instance)(IUnknown *, REFIID, void **); +}; + +static inline struct class_factory *impl_from_IClassFactory( IClassFactory *iface ) +{ + return CONTAINING_RECORD( iface, struct class_factory, IClassFactory_iface ); +} + +static HRESULT WINAPI class_factory_QueryInterface( IClassFactory *iface, + REFIID iid, void **obj ) +{ + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IClassFactory )) + { + IClassFactory_AddRef( iface ); + *obj = iface; + return S_OK; + } + + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI class_factory_AddRef( IClassFactory *iface ) +{ + return 2; +} + +static ULONG WINAPI class_factory_Release( IClassFactory *iface ) +{ + return 1; +} + +static HRESULT WINAPI class_factory_CreateInstance( IClassFactory *iface, + IUnknown *outer, REFIID iid, + void **obj ) +{ + struct class_factory *This = impl_from_IClassFactory( iface ); + + TRACE( "%p %s %p\n", outer, debugstr_guid( iid ), obj ); + + *obj = NULL; + return This->create_instance( outer, iid, obj ); +} + +static HRESULT WINAPI class_factory_LockServer( IClassFactory *iface, + BOOL lock ) +{ + FIXME( "%d: stub!\n", lock ); + return S_OK; +} + +static const struct IClassFactoryVtbl class_factory_vtbl = +{ + class_factory_QueryInterface, + class_factory_AddRef, + class_factory_Release, + class_factory_CreateInstance, + class_factory_LockServer +}; + +/*********************************************************************** + * IUIAnimationManager + */ +struct manager +{ + IUIAnimationManager IUIAnimationManager_iface; + LONG ref; +}; + +struct manager *impl_from_IUIAnimationManager( IUIAnimationManager *iface ) +{ + return CONTAINING_RECORD( iface, struct manager, IUIAnimationManager_iface ); +} + +static HRESULT WINAPI manager_QueryInterface( IUIAnimationManager *iface, REFIID iid, void **obj ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IUIAnimationManager )) + { + IUIAnimationManager_AddRef( iface ); + *obj = iface; + return S_OK; + } + + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI manager_AddRef( IUIAnimationManager *iface ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); + + TRACE( "(%p) ref = %u\n", This, ref ); + return ref; +} + +static ULONG WINAPI manager_Release( IUIAnimationManager *iface ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE( "(%p) ref = %u\n", This, ref ); + + if (!ref) + { + heap_free( This ); + } + + return ref; +} + +static HRESULT WINAPI manager_CreateAnimationVariable( IUIAnimationManager *iface, DOUBLE initial_value, IUIAnimationVariable **variable ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_ScheduleTransition( IUIAnimationManager *iface, IUIAnimationVariable *variable, IUIAnimationTransition *transition, UI_ANIMATION_SECONDS current_time ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_CreateStoryboard( IUIAnimationManager *iface, IUIAnimationStoryboard **storyboard ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_FinishAllStoryboards( IUIAnimationManager *iface, UI_ANIMATION_SECONDS max_time ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_AbandonAllStoryboards( IUIAnimationManager *iface ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_Update( IUIAnimationManager *iface, UI_ANIMATION_SECONDS cur_time, UI_ANIMATION_UPDATE_RESULT *update_result ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + *update_result=UI_ANIMATION_UPDATE_VARIABLES_CHANGED; + return S_OK; +} + +static HRESULT WINAPI manager_GetVariableFromTag( IUIAnimationManager *iface, IUnknown *object, UINT32 id, IUIAnimationVariable **variable ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_GetStoryboardFromTag( IUIAnimationManager *iface, IUnknown *object, UINT32 id, IUIAnimationStoryboard **storyboard ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_GetStatus( IUIAnimationManager *iface, UI_ANIMATION_MANAGER_STATUS *status ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_SetAnimationMode( IUIAnimationManager *iface, UI_ANIMATION_MODE mode ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return S_OK; +} + +static HRESULT WINAPI manager_Pause( IUIAnimationManager *iface ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_Resume( IUIAnimationManager *iface ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_SetManagerEventHandler( IUIAnimationManager *iface, IUIAnimationManagerEventHandler *handler ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return S_OK; +} + +static HRESULT WINAPI manager_SetCancelPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_SetTrimPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_SetCompressPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_SetConcludePriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_SetDefaultLongestAcceptableDelay( IUIAnimationManager *iface, UI_ANIMATION_SECONDS delay ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI manager_Shutdown( IUIAnimationManager *iface ) +{ + struct manager *This = impl_from_IUIAnimationManager( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +const struct IUIAnimationManagerVtbl manager_vtbl = +{ + manager_QueryInterface, + manager_AddRef, + manager_Release, + manager_CreateAnimationVariable, + manager_ScheduleTransition, + manager_CreateStoryboard, + manager_FinishAllStoryboards, + manager_AbandonAllStoryboards, + manager_Update, + manager_GetVariableFromTag, + manager_GetStoryboardFromTag, + manager_GetStatus, + manager_SetAnimationMode, + manager_Pause, + manager_Resume, + manager_SetManagerEventHandler, + manager_SetCancelPriorityComparison, + manager_SetTrimPriorityComparison, + manager_SetCompressPriorityComparison, + manager_SetConcludePriorityComparison, + manager_SetDefaultLongestAcceptableDelay, + manager_Shutdown +}; + +HRESULT manager_create( IUnknown *outer, REFIID iid, void **obj ) +{ + struct manager *This = heap_alloc( sizeof(*This) ); + HRESULT hr; + + if (!This) return E_OUTOFMEMORY; + This->IUIAnimationManager_iface.lpVtbl = &manager_vtbl; + This->ref = 1; + + hr = IUIAnimationManager_QueryInterface( &This->IUIAnimationManager_iface, iid, obj ); + + IUIAnimationManager_Release( &This->IUIAnimationManager_iface ); + return hr; +} + +/*********************************************************************** + * IUIAnimationTimer + */ +struct timer +{ + IUIAnimationTimer IUIAnimationTimer_iface; + LONG ref; +}; + +struct timer *impl_from_IUIAnimationTimer( IUIAnimationTimer *iface ) +{ + return CONTAINING_RECORD( iface, struct timer, IUIAnimationTimer_iface ); +} + +static HRESULT WINAPI timer_QueryInterface( IUIAnimationTimer *iface, + REFIID iid, void **obj ) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IUIAnimationTimer )) + { + IUIAnimationTimer_AddRef( iface ); + *obj = iface; + return S_OK; + } + + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI timer_AddRef( IUIAnimationTimer *iface ) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); + + TRACE( "(%p) ref = %u\n", This, ref ); + return ref; +} + +static ULONG WINAPI timer_Release( IUIAnimationTimer *iface ) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE( "(%p) ref = %u\n", This, ref ); + + if (!ref) + heap_free( This ); + + return ref; +} + +static HRESULT WINAPI timer_SetTimerUpdateHandler (IUIAnimationTimer *iface, + IUIAnimationTimerUpdateHandler *update_handler, + UI_ANIMATION_IDLE_BEHAVIOR idle_behaviour) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + + static HRESULT WINAPI timer_SetTimerEventHandler (IUIAnimationTimer *iface, + IUIAnimationTimerEventHandler *handler) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->( )\n", This ); + return S_OK; +} + +static HRESULT WINAPI timer_Enable (IUIAnimationTimer *iface) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->( )\n", This ); + return S_OK; +} + +static HRESULT WINAPI timer_Disable (IUIAnimationTimer *iface) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI timer_IsEnabled (IUIAnimationTimer *iface) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI timer_GetTime (IUIAnimationTimer *iface,UI_ANIMATION_SECONDS *seconds) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->( )\n", This ); + return S_OK; +} + +static HRESULT WINAPI timer_SetFrameRateThreshold (IUIAnimationTimer *iface,UINT32 frames_per_sec) +{ + struct timer *This = impl_from_IUIAnimationTimer( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +const struct IUIAnimationTimerVtbl timer_vtbl = +{ + timer_QueryInterface, + timer_AddRef, + timer_Release, + timer_SetTimerUpdateHandler, + timer_SetTimerEventHandler, + timer_Enable, + timer_Disable, + timer_IsEnabled, + timer_GetTime, + timer_SetFrameRateThreshold, +}; + +HRESULT timer_create( IUnknown *outer, REFIID iid, void **obj ) +{ + struct timer *This = heap_alloc( sizeof(*This) ); + HRESULT hr; + + if (!This) return E_OUTOFMEMORY; + This->IUIAnimationTimer_iface.lpVtbl = &timer_vtbl; + This->ref = 1; + + hr = IUIAnimationTimer_QueryInterface( &This->IUIAnimationTimer_iface, iid, obj ); + + IUIAnimationTimer_Release( &This->IUIAnimationTimer_iface ); + return hr; +} + +/*********************************************************************** + * IUIAnimationTransitionFactory + */ +struct tr_factory +{ + IUIAnimationTransitionFactory IUIAnimationTransitionFactory_iface; + LONG ref; +}; + +struct tr_factory *impl_from_IUIAnimationTransitionFactory( IUIAnimationTransitionFactory *iface ) +{ + return CONTAINING_RECORD( iface, struct tr_factory, IUIAnimationTransitionFactory_iface ); +} + +static HRESULT WINAPI tr_factory_QueryInterface( IUIAnimationTransitionFactory *iface, + REFIID iid, void **obj ) +{ + struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IUIAnimationTransitionFactory )) + { + IUIAnimationTransitionFactory_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_factory_AddRef( IUIAnimationTransitionFactory *iface ) +{ + struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); + + TRACE( "(%p) ref = %u\n", This, ref ); + return ref; +} + +static ULONG WINAPI tr_factory_Release( IUIAnimationTransitionFactory *iface ) +{ + struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface ); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE( "(%p) ref = %u\n", This, ref ); + + if (!ref) + heap_free( This ); + + return ref; +} + + static HRESULT WINAPI tr_factory_CreateTransition(IUIAnimationTransitionFactory *iface, + IUIAnimationInterpolator *interpolator, IUIAnimationTransition **transition) +{ + struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +const struct IUIAnimationTransitionFactoryVtbl tr_factory_vtbl = +{ + tr_factory_QueryInterface, + tr_factory_AddRef, + tr_factory_Release, + tr_factory_CreateTransition +}; + +HRESULT tr_factory_create( IUnknown *outer, REFIID iid, void **obj ) +{ + struct tr_factory *This = heap_alloc( sizeof(*This) ); + HRESULT hr; + + if (!This) return E_OUTOFMEMORY; + This->IUIAnimationTransitionFactory_iface.lpVtbl = &tr_factory_vtbl; + This->ref = 1; + + hr = IUIAnimationTransitionFactory_QueryInterface( &This->IUIAnimationTransitionFactory_iface, iid, obj ); + + IUIAnimationTransitionFactory_Release( &This->IUIAnimationTransitionFactory_iface ); + return hr; +} + +/*********************************************************************** + * IUIAnimationTransition + */ +struct animation_transition +{ + IUIAnimationTransition IUIAnimationTransition_iface; + LONG ref; +}; + +struct animation_transition *impl_from_IUIAnimationTransition( IUIAnimationTransition *iface ) +{ + return CONTAINING_RECORD( iface, struct animation_transition, IUIAnimationTransition_iface ); +} + +static HRESULT WINAPI WINAPI animation_transition_QueryInterface( IUIAnimationTransition *iface, + REFIID iid, void **obj ) +{ + struct animation_transition *This = impl_from_IUIAnimationTransition( iface ); + + TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj ); + + if (IsEqualIID( iid, &IID_IUnknown ) || + IsEqualIID( iid, &IID_IUIAnimationTransition )) + { + IUIAnimationTransition_AddRef( iface ); + *obj = iface; + return S_OK; + } + + FIXME( "interface %s not implemented\n", debugstr_guid( iid ) ); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI animation_transition_AddRef( IUIAnimationTransition *iface ) +{ + struct animation_transition *This = impl_from_IUIAnimationTransition( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); + + TRACE( "(%p) ref = %u\n", This, ref ); + return ref; +} + +static ULONG WINAPI animation_transition_Release( IUIAnimationTransition *iface ) +{ + struct animation_transition *This = impl_from_IUIAnimationTransition( iface ); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE( "(%p) ref = %u\n", This, ref ); + + if (!ref) + heap_free( This ); + + return ref; +} + +static HRESULT WINAPI animation_transition_SetInitialValue ( IUIAnimationTransition *iface, DOUBLE value) +{ + struct animation_transition *This = impl_from_IUIAnimationTransition( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_transition_SetInitialVelocity (IUIAnimationTransition *iface,DOUBLE velocity) +{ + struct animation_transition *This = impl_from_IUIAnimationTransition( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_transition_IsDurationKnown (IUIAnimationTransition *iface) +{ + struct animation_transition *This = impl_from_IUIAnimationTransition( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +static HRESULT WINAPI animation_transition_GetDuration (IUIAnimationTransition *iface, UI_ANIMATION_SECONDS *duration) +{ + struct animation_transition *This = impl_from_IUIAnimationTransition( iface ); + FIXME( "stub (%p)->( )\n", This ); + return E_NOTIMPL; +} + +const struct IUIAnimationTransitionVtbl animation_transition_vtbl = +{ + animation_transition_QueryInterface, + animation_transition_AddRef, + animation_transition_Release, + animation_transition_SetInitialValue, + animation_transition_SetInitialVelocity, + animation_transition_IsDurationKnown, + animation_transition_GetDuration +}; + +HRESULT animation_transition_create( IUnknown *outer, REFIID iid, void **obj ) +{ + struct animation_transition *This = heap_alloc( sizeof(*This) ); + HRESULT hr; + + if (!This) return E_OUTOFMEMORY; + This->IUIAnimationTransition_iface.lpVtbl = &animation_transition_vtbl; + This->ref = 1; + + hr = IUIAnimationTransition_QueryInterface( &This->IUIAnimationTransition_iface, iid, obj ); + + IUIAnimationTransition_Release( &This->IUIAnimationTransition_iface ); + 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; +} + + +static struct class_factory manager_cf = { { &class_factory_vtbl }, manager_create }; +static struct class_factory timer_cf = { { &class_factory_vtbl }, timer_create }; +static struct class_factory tr_factory_cf = { { &class_factory_vtbl }, tr_factory_create }; +static struct class_factory tr_library_cf = { { &class_factory_vtbl }, tr_library_create }; + +/****************************************************************** + * DllGetClassObject + */ +HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **obj ) +{ + IClassFactory *cf = NULL; + + TRACE( "(%s %s %p)\n", debugstr_guid( clsid ), debugstr_guid( iid ), obj ); + + if (IsEqualCLSID( clsid, &CLSID_UIAnimationManager )) + cf = &manager_cf.IClassFactory_iface; + else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTimer )) + cf = &timer_cf.IClassFactory_iface; + else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTransitionFactory )) + cf = &tr_factory_cf.IClassFactory_iface; + else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTransitionLibrary )) + cf = &tr_library_cf.IClassFactory_iface; + if (!cf) return CLASS_E_CLASSNOTAVAILABLE; + + return IClassFactory_QueryInterface( cf, iid, obj ); +} + +BOOL WINAPI DllMain( HINSTANCE dll, DWORD reason, LPVOID reserved ) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + hinstance = dll; + DisableThreadLibraryCalls( dll ); + break; + } + return TRUE; +} + +/****************************************************************** + * DllCanUnloadNow + */ +HRESULT WINAPI DllCanUnloadNow( void ) +{ + TRACE( "()\n" ); + return S_FALSE; +} + + +/*********************************************************************** + * DllRegisterServer + */ +HRESULT WINAPI DllRegisterServer( void ) +{ + return __wine_register_resources( hinstance ); +} + +/*********************************************************************** + * DllUnregisterServer + */ +HRESULT WINAPI DllUnregisterServer( void ) +{ + return __wine_unregister_resources( hinstance ); +} diff --git a/dlls/uianimation/uianimation.spec b/dlls/uianimation/uianimation.spec new file mode 100644 index 0000000..b16365d --- /dev/null +++ b/dlls/uianimation/uianimation.spec @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/dlls/uianimation/uianimation_typelib.idl b/dlls/uianimation/uianimation_typelib.idl new file mode 100644 index 0000000..9066c09 --- /dev/null +++ b/dlls/uianimation/uianimation_typelib.idl @@ -0,0 +1,23 @@ +/* + * UiAnimation typelib. + * + * Copyright (C) 2018 Louis Lenders + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep regtypelib + +#include "uianimation.idl" -- 1.9.1