2 * Uianimation main file.
4 * Copyright (C) 2018 Louis Lenders
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
32 #include "uianimation.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(uianimation
);
40 IClassFactory IClassFactory_iface
;
41 HRESULT (*create_instance
)(IUnknown
*, REFIID
, void **);
44 static inline struct class_factory
*impl_from_IClassFactory( IClassFactory
*iface
)
46 return CONTAINING_RECORD( iface
, struct class_factory
, IClassFactory_iface
);
49 static HRESULT WINAPI
class_factory_QueryInterface( IClassFactory
*iface
, REFIID iid
, void **obj
)
51 if (IsEqualIID( iid
, &IID_IUnknown
) ||
52 IsEqualIID( iid
, &IID_IClassFactory
))
54 IClassFactory_AddRef( iface
);
59 FIXME( "interface %s not implemented\n", debugstr_guid( iid
) );
64 static ULONG WINAPI
class_factory_AddRef( IClassFactory
*iface
)
69 static ULONG WINAPI
class_factory_Release( IClassFactory
*iface
)
74 static HRESULT WINAPI
class_factory_CreateInstance( IClassFactory
*iface
,
75 IUnknown
*outer
, REFIID iid
,
78 struct class_factory
*This
= impl_from_IClassFactory( iface
);
80 TRACE( "%p %s %p\n", outer
, debugstr_guid( iid
), obj
);
83 return This
->create_instance( outer
, iid
, obj
);
86 static HRESULT WINAPI
class_factory_LockServer( IClassFactory
*iface
,
89 FIXME( "%d: stub!\n", lock
);
93 static const struct IClassFactoryVtbl class_factory_vtbl
=
95 class_factory_QueryInterface
,
97 class_factory_Release
,
98 class_factory_CreateInstance
,
99 class_factory_LockServer
102 /***********************************************************************
103 * IUIAnimationStoryboard
105 struct animation_storyboard
107 IUIAnimationStoryboard IUIAnimationStoryboard_iface
;
111 struct animation_storyboard
*impl_from_IUIAnimationStoryboard( IUIAnimationStoryboard
*iface
)
113 return CONTAINING_RECORD( iface
, struct animation_storyboard
, IUIAnimationStoryboard_iface
);
116 static HRESULT WINAPI
animation_storyboard_QueryInterface( IUIAnimationStoryboard
*iface
,
117 REFIID iid
, void **obj
)
119 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
121 TRACE( "(%p)->(%s %p)\n", This
, debugstr_guid( iid
), obj
);
123 if (IsEqualIID( iid
, &IID_IUnknown
) ||
124 IsEqualIID( iid
, &IID_IUIAnimationStoryboard
))
126 IUIAnimationStoryboard_AddRef( iface
);
131 FIXME( "interface %s not implemented\n", debugstr_guid( iid
) );
133 return E_NOINTERFACE
;
136 static ULONG WINAPI
animation_storyboard_AddRef( IUIAnimationStoryboard
*iface
)
138 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
139 ULONG ref
= InterlockedIncrement( &This
->ref
);
141 TRACE( "(%p) ref = %lu\n", This
, ref
);
145 static ULONG WINAPI
animation_storyboard_Release( IUIAnimationStoryboard
*iface
)
147 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
148 ULONG ref
= InterlockedDecrement(&This
->ref
);
150 TRACE( "(%p) ref = %lu\n", This
, ref
);
158 static HRESULT WINAPI
animation_storyboard_AddTransition (IUIAnimationStoryboard
*iface
, IUIAnimationVariable
*variable
,
159 IUIAnimationTransition
*transition
)
161 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
162 FIXME( "stub (%p)->( )\n", This
);
166 static HRESULT WINAPI
animation_storyboard_AddKeyframeAtOffset (IUIAnimationStoryboard
*iface
, UI_ANIMATION_KEYFRAME existingframe
,
167 UI_ANIMATION_SECONDS offset
, UI_ANIMATION_KEYFRAME
*keyframe
)
169 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
170 FIXME( "stub (%p)->( )\n", This
);
174 static HRESULT WINAPI
animation_storyboard_AddKeyframeAfterTransition (IUIAnimationStoryboard
*iface
,IUIAnimationTransition
*transition
,
175 UI_ANIMATION_KEYFRAME
*keyframe
)
177 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
178 FIXME( "stub (%p)->( )\n", This
);
182 static HRESULT WINAPI
animation_storyboard_AddTransitionAtKeyframe (IUIAnimationStoryboard
*iface
, IUIAnimationVariable
*variable
,
183 IUIAnimationTransition
*transition
, UI_ANIMATION_KEYFRAME start_key
)
185 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
186 FIXME( "stub (%p)->( )\n", This
);
190 static HRESULT WINAPI
animation_storyboard_AddTransitionBetweenKeyframes (IUIAnimationStoryboard
*iface
, IUIAnimationVariable
*variable
,
191 IUIAnimationTransition
*transition
, UI_ANIMATION_KEYFRAME start_key
, UI_ANIMATION_KEYFRAME end_key
)
193 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
194 FIXME( "stub (%p)->( )\n", This
);
198 static HRESULT WINAPI
animation_storyboard_RepeatBetweenKeyframes (IUIAnimationStoryboard
*iface
, UI_ANIMATION_KEYFRAME start_key
,
199 UI_ANIMATION_KEYFRAME end_key
, INT32 count
)
201 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
202 FIXME( "stub (%p)->( )\n", This
);
206 static HRESULT WINAPI
animation_storyboard_HoldVariable (IUIAnimationStoryboard
*iface
, IUIAnimationVariable
*variable
)
208 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
209 FIXME( "stub (%p)->( )\n", This
);
213 static HRESULT WINAPI
animation_storyboard_SetLongestAcceptableDelay (IUIAnimationStoryboard
*iface
, UI_ANIMATION_SECONDS delay
)
215 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
216 FIXME( "stub (%p)->( )\n", This
);
220 static HRESULT WINAPI
animation_storyboard_Schedule (IUIAnimationStoryboard
*iface
, UI_ANIMATION_SECONDS now
,
221 UI_ANIMATION_SCHEDULING_RESULT
*result
)
223 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
224 FIXME( "stub (%p)->( )\n", This
);
228 static HRESULT WINAPI
animation_storyboard_Conclude (IUIAnimationStoryboard
*iface
)
230 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
231 FIXME( "stub (%p)->( )\n", This
);
235 static HRESULT WINAPI
animation_storyboard_Finish (IUIAnimationStoryboard
*iface
, UI_ANIMATION_SECONDS deadline
)
237 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
238 FIXME( "stub (%p)->( )\n", This
);
242 static HRESULT WINAPI
animation_storyboard_Abandon (IUIAnimationStoryboard
*iface
)
244 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
245 FIXME( "stub (%p)->( )\n", This
);
249 static HRESULT WINAPI
animation_storyboard_SetTag(IUIAnimationStoryboard
*iface
, IUnknown
*object
, UINT32 id
)
251 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
252 FIXME( "stub (%p)->( )\n", This
);
256 static HRESULT WINAPI
animation_storyboard_GetTag (IUIAnimationStoryboard
*iface
, IUnknown
**object
, UINT32
*id
)
258 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
259 FIXME( "stub (%p)->( )\n", This
);
263 static HRESULT WINAPI
animation_storyboard_GetStatus (IUIAnimationStoryboard
*iface
, UI_ANIMATION_STORYBOARD_STATUS
*status
)
265 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
266 FIXME( "stub (%p)->( )\n", This
);
270 static HRESULT WINAPI
animation_storyboard_GetElapsedTime (IUIAnimationStoryboard
*iface
, UI_ANIMATION_SECONDS
*elapsed
)
272 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
273 FIXME( "stub (%p)->( )\n", This
);
277 static HRESULT WINAPI
animation_storyboard_SetStoryboardEventHandler (IUIAnimationStoryboard
*iface
, IUIAnimationStoryboardEventHandler
*handler
)
279 struct animation_storyboard
*This
= impl_from_IUIAnimationStoryboard( iface
);
280 FIXME( "stub (%p)->( )\n", This
);
284 const struct IUIAnimationStoryboardVtbl animation_storyboard_vtbl
=
286 animation_storyboard_QueryInterface
,
287 animation_storyboard_AddRef
,
288 animation_storyboard_Release
,
289 animation_storyboard_AddTransition
,
290 animation_storyboard_AddKeyframeAtOffset
,
291 animation_storyboard_AddKeyframeAfterTransition
,
292 animation_storyboard_AddTransitionAtKeyframe
,
293 animation_storyboard_AddTransitionBetweenKeyframes
,
294 animation_storyboard_RepeatBetweenKeyframes
,
295 animation_storyboard_HoldVariable
,
296 animation_storyboard_SetLongestAcceptableDelay
,
297 animation_storyboard_Schedule
,
298 animation_storyboard_Conclude
,
299 animation_storyboard_Finish
,
300 animation_storyboard_Abandon
,
301 animation_storyboard_SetTag
,
302 animation_storyboard_GetTag
,
303 animation_storyboard_GetStatus
,
304 animation_storyboard_GetElapsedTime
,
305 animation_storyboard_SetStoryboardEventHandler
308 static HRESULT
animation_storyboard_create( IUIAnimationStoryboard
**obj
)
310 struct animation_storyboard
*This
= malloc( sizeof(*This
) );
312 if (!This
) return E_OUTOFMEMORY
;
313 This
->IUIAnimationStoryboard_iface
.lpVtbl
= &animation_storyboard_vtbl
;
316 *obj
= &This
->IUIAnimationStoryboard_iface
;
321 /***********************************************************************
322 * IUIAnimationVariable
326 IUIAnimationVariable IUIAnimationVariable_iface
;
331 struct animation_var
*impl_from_IUIAnimationVariable( IUIAnimationVariable
*iface
)
333 return CONTAINING_RECORD( iface
, struct animation_var
, IUIAnimationVariable_iface
);
336 static HRESULT WINAPI
animation_var_QueryInterface( IUIAnimationVariable
*iface
,
337 REFIID iid
, void **obj
)
339 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
341 TRACE( "(%p)->(%s %p)\n", This
, debugstr_guid( iid
), obj
);
343 if (IsEqualIID( iid
, &IID_IUnknown
) ||
344 IsEqualIID( iid
, &IID_IUIAnimationVariable
))
346 IUIAnimationVariable_AddRef( iface
);
351 FIXME( "interface %s not implemented\n", debugstr_guid( iid
) );
353 return E_NOINTERFACE
;
356 static ULONG WINAPI
animation_var_AddRef( IUIAnimationVariable
*iface
)
358 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
359 ULONG ref
= InterlockedIncrement( &This
->ref
);
361 TRACE( "(%p) ref = %lu\n", This
, ref
);
365 static ULONG WINAPI
animation_var_Release( IUIAnimationVariable
*iface
)
367 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
368 ULONG ref
= InterlockedDecrement(&This
->ref
);
370 TRACE( "(%p) ref = %lu\n", This
, ref
);
378 static HRESULT WINAPI
animation_var_GetValue ( IUIAnimationVariable
*iface
, DOUBLE
*value
)
380 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
381 FIXME( "stub (%p)->( )\n", This
);
385 static HRESULT WINAPI
animation_var_GetFinalValue ( IUIAnimationVariable
*iface
, DOUBLE
*value
)
387 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
388 FIXME( "stub (%p)->( )\n", This
);
392 static HRESULT WINAPI
animation_var_GetPreviousValue ( IUIAnimationVariable
*iface
, DOUBLE
*value
)
394 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
395 FIXME( "stub (%p)->( )\n", This
);
399 static HRESULT WINAPI
animation_var_GetIntegerValue ( IUIAnimationVariable
*iface
, INT32
*value
)
401 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
402 FIXME( "stub (%p)->( )\n", This
);
406 static HRESULT WINAPI
animation_var_GetFinalIntegerValue ( IUIAnimationVariable
*iface
, INT32
*value
)
408 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
409 FIXME( "stub (%p)->( )\n", This
);
413 static HRESULT WINAPI
animation_var_GetPreviousIntegerValue ( IUIAnimationVariable
*iface
, INT32
*value
)
415 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
416 FIXME( "stub (%p)->( )\n", This
);
420 static HRESULT WINAPI
animation_var_GetCurrentStoryboard ( IUIAnimationVariable
*iface
, IUIAnimationStoryboard
**storyboard
)
422 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
423 FIXME( "stub (%p)->( )\n", This
);
427 static HRESULT WINAPI
animation_var_SetLowerBound ( IUIAnimationVariable
*iface
, DOUBLE bound
)
429 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
430 FIXME( "stub (%p)->( )\n", This
);
434 static HRESULT WINAPI
animation_var_SetUpperBound ( IUIAnimationVariable
*iface
, DOUBLE bound
)
436 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
437 FIXME( "stub (%p)->( )\n", This
);
441 static HRESULT WINAPI
animation_var_SetRoundingMode ( IUIAnimationVariable
*iface
,UI_ANIMATION_ROUNDING_MODE mode
)
443 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
444 FIXME( "stub (%p)->( )\n", This
);
448 static HRESULT WINAPI
animation_var_SetTag ( IUIAnimationVariable
*iface
, IUnknown
*object
, UINT32 id
)
450 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
451 FIXME( "stub (%p)->( )\n", This
);
455 static HRESULT WINAPI
animation_var_GetTag ( IUIAnimationVariable
*iface
, IUnknown
**object
, UINT32
*id
)
457 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
458 FIXME( "stub (%p)->( )\n", This
);
462 static HRESULT WINAPI
animation_var_SetVariableChangeHandler ( IUIAnimationVariable
*iface
, IUIAnimationVariableChangeHandler
*handler
)
464 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
465 FIXME( "stub (%p)->( )\n", This
);
469 static HRESULT WINAPI
animation_var_SetVariableIntegerChangeHandler ( IUIAnimationVariable
*iface
,
470 IUIAnimationVariableIntegerChangeHandler
*handler
)
472 struct animation_var
*This
= impl_from_IUIAnimationVariable( iface
);
473 FIXME( "stub (%p)->( )\n", This
);
477 const struct IUIAnimationVariableVtbl animation_var_vtbl
=
479 animation_var_QueryInterface
,
480 animation_var_AddRef
,
481 animation_var_Release
,
482 animation_var_GetValue
,
483 animation_var_GetFinalValue
,
484 animation_var_GetPreviousValue
,
485 animation_var_GetIntegerValue
,
486 animation_var_GetFinalIntegerValue
,
487 animation_var_GetPreviousIntegerValue
,
488 animation_var_GetCurrentStoryboard
,
489 animation_var_SetLowerBound
,
490 animation_var_SetUpperBound
,
491 animation_var_SetRoundingMode
,
492 animation_var_SetTag
,
493 animation_var_GetTag
,
494 animation_var_SetVariableChangeHandler
,
495 animation_var_SetVariableIntegerChangeHandler
,
498 static HRESULT
animation_var_create(DOUBLE initial
, IUIAnimationVariable
**obj
)
500 struct animation_var
*This
= malloc( sizeof(*This
) );
502 if (!This
) return E_OUTOFMEMORY
;
503 This
->IUIAnimationVariable_iface
.lpVtbl
= &animation_var_vtbl
;
505 This
->initial
= initial
;
507 *obj
= &This
->IUIAnimationVariable_iface
;
512 /***********************************************************************
513 * IUIAnimationManager
517 IUIAnimationManager IUIAnimationManager_iface
;
521 struct manager
*impl_from_IUIAnimationManager( IUIAnimationManager
*iface
)
523 return CONTAINING_RECORD( iface
, struct manager
, IUIAnimationManager_iface
);
526 static HRESULT WINAPI
manager_QueryInterface( IUIAnimationManager
*iface
, REFIID iid
, void **obj
)
528 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
530 TRACE( "(%p)->(%s %p)\n", This
, debugstr_guid( iid
), obj
);
532 if (IsEqualIID( iid
, &IID_IUnknown
) ||
533 IsEqualIID( iid
, &IID_IUIAnimationManager
))
535 IUIAnimationManager_AddRef( iface
);
540 FIXME( "interface %s not implemented\n", debugstr_guid( iid
) );
542 return E_NOINTERFACE
;
545 static ULONG WINAPI
manager_AddRef( IUIAnimationManager
*iface
)
547 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
548 ULONG ref
= InterlockedIncrement( &This
->ref
);
550 TRACE( "(%p) ref = %lu\n", This
, ref
);
554 static ULONG WINAPI
manager_Release( IUIAnimationManager
*iface
)
556 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
557 ULONG ref
= InterlockedDecrement(&This
->ref
);
559 TRACE( "(%p) ref = %lu\n", This
, ref
);
569 static HRESULT WINAPI
manager_CreateAnimationVariable( IUIAnimationManager
*iface
, DOUBLE initial_value
, IUIAnimationVariable
**variable
)
571 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
572 TRACE( "(%p)->(%f, %p)\n", This
, initial_value
, variable
);
573 return animation_var_create(initial_value
, variable
);
576 static HRESULT WINAPI
manager_ScheduleTransition( IUIAnimationManager
*iface
, IUIAnimationVariable
*variable
, IUIAnimationTransition
*transition
, UI_ANIMATION_SECONDS current_time
)
578 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
579 FIXME( "stub (%p)->(%p, %p)\n", This
, variable
, transition
);
583 static HRESULT WINAPI
manager_CreateStoryboard( IUIAnimationManager
*iface
, IUIAnimationStoryboard
**storyboard
)
585 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
586 TRACE( "(%p)->(%p)\n", This
, storyboard
);
587 return animation_storyboard_create(storyboard
);
590 static HRESULT WINAPI
manager_FinishAllStoryboards( IUIAnimationManager
*iface
, UI_ANIMATION_SECONDS max_time
)
592 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
593 FIXME( "stub (%p)->(%f)\n", This
, max_time
);
597 static HRESULT WINAPI
manager_AbandonAllStoryboards( IUIAnimationManager
*iface
)
599 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
600 FIXME( "stub (%p)->()\n", This
);
604 static HRESULT WINAPI
manager_Update( IUIAnimationManager
*iface
, UI_ANIMATION_SECONDS cur_time
, UI_ANIMATION_UPDATE_RESULT
*update_result
)
606 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
607 FIXME( "stub (%p)->(%f, %p)\n", This
, cur_time
, update_result
);
609 *update_result
= UI_ANIMATION_UPDATE_VARIABLES_CHANGED
;
613 static HRESULT WINAPI
manager_GetVariableFromTag( IUIAnimationManager
*iface
, IUnknown
*object
, UINT32 id
, IUIAnimationVariable
**variable
)
615 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
616 FIXME( "stub (%p)->(%p, %p)\n", This
, object
, variable
);
620 static HRESULT WINAPI
manager_GetStoryboardFromTag( IUIAnimationManager
*iface
, IUnknown
*object
, UINT32 id
, IUIAnimationStoryboard
**storyboard
)
622 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
623 FIXME( "stub (%p)->(%p, %d, %p)\n", This
, object
, id
, storyboard
);
627 static HRESULT WINAPI
manager_GetStatus( IUIAnimationManager
*iface
, UI_ANIMATION_MANAGER_STATUS
*status
)
629 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
630 FIXME( "stub (%p)->(%p)\n", This
, status
);
634 static HRESULT WINAPI
manager_SetAnimationMode( IUIAnimationManager
*iface
, UI_ANIMATION_MODE mode
)
636 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
637 FIXME( "stub (%p)->(%d)\n", This
, mode
);
641 static HRESULT WINAPI
manager_Pause( IUIAnimationManager
*iface
)
643 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
644 FIXME( "stub (%p)->()\n", This
);
648 static HRESULT WINAPI
manager_Resume( IUIAnimationManager
*iface
)
650 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
651 FIXME( "stub (%p)->()\n", This
);
655 static HRESULT WINAPI
manager_SetManagerEventHandler( IUIAnimationManager
*iface
, IUIAnimationManagerEventHandler
*handler
)
657 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
658 FIXME( "stub (%p)->(%p)\n", This
, handler
);
662 static HRESULT WINAPI
manager_SetCancelPriorityComparison( IUIAnimationManager
*iface
, IUIAnimationPriorityComparison
*comparison
)
664 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
665 FIXME( "stub (%p)->(%p)\n", This
, comparison
);
669 static HRESULT WINAPI
manager_SetTrimPriorityComparison( IUIAnimationManager
*iface
, IUIAnimationPriorityComparison
*comparison
)
671 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
672 FIXME( "stub (%p)->(%p)\n", This
, comparison
);
676 static HRESULT WINAPI
manager_SetCompressPriorityComparison( IUIAnimationManager
*iface
, IUIAnimationPriorityComparison
*comparison
)
678 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
679 FIXME( "stub (%p)->(%p)\n", This
, comparison
);
683 static HRESULT WINAPI
manager_SetConcludePriorityComparison( IUIAnimationManager
*iface
, IUIAnimationPriorityComparison
*comparison
)
685 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
686 FIXME( "stub (%p)->(%p)\n", This
, comparison
);
690 static HRESULT WINAPI
manager_SetDefaultLongestAcceptableDelay( IUIAnimationManager
*iface
, UI_ANIMATION_SECONDS delay
)
692 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
693 FIXME( "stub (%p)->(%f)\n", This
, delay
);
697 static HRESULT WINAPI
manager_Shutdown( IUIAnimationManager
*iface
)
699 struct manager
*This
= impl_from_IUIAnimationManager( iface
);
700 FIXME( "stub (%p)->()\n", This
);
704 const struct IUIAnimationManagerVtbl manager_vtbl
=
706 manager_QueryInterface
,
709 manager_CreateAnimationVariable
,
710 manager_ScheduleTransition
,
711 manager_CreateStoryboard
,
712 manager_FinishAllStoryboards
,
713 manager_AbandonAllStoryboards
,
715 manager_GetVariableFromTag
,
716 manager_GetStoryboardFromTag
,
718 manager_SetAnimationMode
,
721 manager_SetManagerEventHandler
,
722 manager_SetCancelPriorityComparison
,
723 manager_SetTrimPriorityComparison
,
724 manager_SetCompressPriorityComparison
,
725 manager_SetConcludePriorityComparison
,
726 manager_SetDefaultLongestAcceptableDelay
,
730 static HRESULT
manager_create( IUnknown
*outer
, REFIID iid
, void **obj
)
732 struct manager
*This
= malloc( sizeof(*This
) );
735 if (!This
) return E_OUTOFMEMORY
;
736 This
->IUIAnimationManager_iface
.lpVtbl
= &manager_vtbl
;
739 hr
= IUIAnimationManager_QueryInterface( &This
->IUIAnimationManager_iface
, iid
, obj
);
741 IUIAnimationManager_Release( &This
->IUIAnimationManager_iface
);
745 /***********************************************************************
750 IUIAnimationTimer IUIAnimationTimer_iface
;
754 struct timer
*impl_from_IUIAnimationTimer( IUIAnimationTimer
*iface
)
756 return CONTAINING_RECORD( iface
, struct timer
, IUIAnimationTimer_iface
);
759 static HRESULT WINAPI
timer_QueryInterface( IUIAnimationTimer
*iface
, REFIID iid
, void **obj
)
761 struct timer
*This
= impl_from_IUIAnimationTimer( iface
);
763 TRACE( "(%p)->(%s %p)\n", This
, debugstr_guid( iid
), obj
);
765 if (IsEqualIID( iid
, &IID_IUnknown
) ||
766 IsEqualIID( iid
, &IID_IUIAnimationTimer
))
768 IUIAnimationTimer_AddRef( iface
);
773 FIXME( "interface %s not implemented\n", debugstr_guid( iid
) );
775 return E_NOINTERFACE
;
778 static ULONG WINAPI
timer_AddRef( IUIAnimationTimer
*iface
)
780 struct timer
*This
= impl_from_IUIAnimationTimer( iface
);
781 ULONG ref
= InterlockedIncrement( &This
->ref
);
783 TRACE( "(%p) ref = %lu\n", This
, ref
);
787 static ULONG WINAPI
timer_Release( IUIAnimationTimer
*iface
)
789 struct timer
*This
= impl_from_IUIAnimationTimer( iface
);
790 ULONG ref
= InterlockedDecrement(&This
->ref
);
792 TRACE( "(%p) ref = %lu\n", This
, ref
);
800 static HRESULT WINAPI
timer_SetTimerUpdateHandler (IUIAnimationTimer
*iface
,
801 IUIAnimationTimerUpdateHandler
*update_handler
,
802 UI_ANIMATION_IDLE_BEHAVIOR idle_behaviour
)
804 struct timer
*This
= impl_from_IUIAnimationTimer( iface
);
805 FIXME( "stub (%p)->(%p, %d)\n", This
, update_handler
, idle_behaviour
);
809 static HRESULT WINAPI
timer_SetTimerEventHandler (IUIAnimationTimer
*iface
,
810 IUIAnimationTimerEventHandler
*handler
)
812 struct timer
*This
= impl_from_IUIAnimationTimer( iface
);
813 FIXME( "stub (%p)->()\n", This
);
817 static HRESULT WINAPI
timer_Enable (IUIAnimationTimer
*iface
)
819 struct timer
*This
= impl_from_IUIAnimationTimer( iface
);
820 FIXME( "stub (%p)->()\n", This
);
824 static HRESULT WINAPI
timer_Disable (IUIAnimationTimer
*iface
)
826 struct timer
*This
= impl_from_IUIAnimationTimer( iface
);
827 FIXME( "stub (%p)->()\n", This
);
831 static HRESULT WINAPI
timer_IsEnabled (IUIAnimationTimer
*iface
)
833 struct timer
*This
= impl_from_IUIAnimationTimer( iface
);
834 FIXME( "stub (%p)->()\n", This
);
838 static HRESULT WINAPI
timer_GetTime (IUIAnimationTimer
*iface
, UI_ANIMATION_SECONDS
*seconds
)
840 struct timer
*This
= impl_from_IUIAnimationTimer( iface
);
841 FIXME( "stub (%p)->(%p)\n", This
, seconds
);
845 static HRESULT WINAPI
timer_SetFrameRateThreshold (IUIAnimationTimer
*iface
, UINT32 frames_per_sec
)
847 struct timer
*This
= impl_from_IUIAnimationTimer( iface
);
848 FIXME( "stub (%p)->(%d)\n", This
, frames_per_sec
);
852 const struct IUIAnimationTimerVtbl timer_vtbl
=
854 timer_QueryInterface
,
857 timer_SetTimerUpdateHandler
,
858 timer_SetTimerEventHandler
,
863 timer_SetFrameRateThreshold
,
866 static HRESULT
timer_create( IUnknown
*outer
, REFIID iid
, void **obj
)
868 struct timer
*This
= malloc( sizeof(*This
) );
872 return E_OUTOFMEMORY
;
873 This
->IUIAnimationTimer_iface
.lpVtbl
= &timer_vtbl
;
876 hr
= IUIAnimationTimer_QueryInterface( &This
->IUIAnimationTimer_iface
, iid
, obj
);
878 IUIAnimationTimer_Release( &This
->IUIAnimationTimer_iface
);
882 /***********************************************************************
883 * IUIAnimationTransitionFactory
887 IUIAnimationTransitionFactory IUIAnimationTransitionFactory_iface
;
891 struct tr_factory
*impl_from_IUIAnimationTransitionFactory( IUIAnimationTransitionFactory
*iface
)
893 return CONTAINING_RECORD( iface
, struct tr_factory
, IUIAnimationTransitionFactory_iface
);
896 static HRESULT WINAPI
tr_factory_QueryInterface( IUIAnimationTransitionFactory
*iface
, REFIID iid
, void **obj
)
898 struct tr_factory
*This
= impl_from_IUIAnimationTransitionFactory( iface
);
900 TRACE( "(%p)->(%s %p)\n", This
, debugstr_guid( iid
), obj
);
902 if (IsEqualIID( iid
, &IID_IUnknown
) ||
903 IsEqualIID( iid
, &IID_IUIAnimationTransitionFactory
))
905 IUIAnimationTransitionFactory_AddRef( iface
);
910 FIXME( "interface %s not implemented\n", debugstr_guid( iid
) );
912 return E_NOINTERFACE
;
915 static ULONG WINAPI
tr_factory_AddRef( IUIAnimationTransitionFactory
*iface
)
917 struct tr_factory
*This
= impl_from_IUIAnimationTransitionFactory( iface
);
918 ULONG ref
= InterlockedIncrement( &This
->ref
);
920 TRACE( "(%p) ref = %lu\n", This
, ref
);
924 static ULONG WINAPI
tr_factory_Release( IUIAnimationTransitionFactory
*iface
)
926 struct tr_factory
*This
= impl_from_IUIAnimationTransitionFactory( iface
);
927 ULONG ref
= InterlockedDecrement(&This
->ref
);
929 TRACE( "(%p) ref = %lu\n", This
, ref
);
937 static HRESULT WINAPI
tr_factory_CreateTransition(IUIAnimationTransitionFactory
*iface
,
938 IUIAnimationInterpolator
*interpolator
, IUIAnimationTransition
**transition
)
940 struct tr_factory
*This
= impl_from_IUIAnimationTransitionFactory( iface
);
941 FIXME( "stub (%p)->(%p, %p)\n", This
, interpolator
, transition
);
945 const struct IUIAnimationTransitionFactoryVtbl tr_factory_vtbl
=
947 tr_factory_QueryInterface
,
950 tr_factory_CreateTransition
953 static HRESULT
transition_create( IUnknown
*outer
, REFIID iid
, void **obj
)
955 struct tr_factory
*This
= malloc( sizeof(*This
) );
958 if (!This
) return E_OUTOFMEMORY
;
959 This
->IUIAnimationTransitionFactory_iface
.lpVtbl
= &tr_factory_vtbl
;
962 hr
= IUIAnimationTransitionFactory_QueryInterface( &This
->IUIAnimationTransitionFactory_iface
, iid
, obj
);
964 IUIAnimationTransitionFactory_Release( &This
->IUIAnimationTransitionFactory_iface
);
968 /***********************************************************************
969 * IUITransitionLibrary
973 IUIAnimationTransitionLibrary IUIAnimationTransitionLibrary_iface
;
977 struct tr_library
*impl_from_IUIAnimationTransitionLibrary( IUIAnimationTransitionLibrary
*iface
)
979 return CONTAINING_RECORD( iface
, struct tr_library
, IUIAnimationTransitionLibrary_iface
);
982 static HRESULT WINAPI
tr_library_QueryInterface( IUIAnimationTransitionLibrary
*iface
,
983 REFIID iid
, void **obj
)
985 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
987 TRACE( "(%p)->(%s %p)\n", This
, debugstr_guid( iid
), obj
);
989 if (IsEqualIID( iid
, &IID_IUnknown
) ||
990 IsEqualIID( iid
, &IID_IUIAnimationTransitionLibrary
))
992 IUIAnimationTransitionLibrary_AddRef( iface
);
997 FIXME( "interface %s not implemented\n", debugstr_guid( iid
) );
999 return E_NOINTERFACE
;
1002 static ULONG WINAPI
tr_library_AddRef( IUIAnimationTransitionLibrary
*iface
)
1004 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1005 ULONG ref
= InterlockedIncrement( &This
->ref
);
1007 TRACE( "(%p) ref = %lu\n", This
, ref
);
1011 static ULONG WINAPI
tr_library_Release( IUIAnimationTransitionLibrary
*iface
)
1013 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1014 ULONG ref
= InterlockedDecrement(&This
->ref
);
1016 TRACE( "(%p) ref = %lu\n", This
, ref
);
1024 static HRESULT WINAPI
tr_library_CreateInstantaneousTransition(IUIAnimationTransitionLibrary
*iface
,
1025 double finalValue
, IUIAnimationTransition
**transition
)
1027 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1028 FIXME( "stub (%p)->(%f, %p)\n", This
, finalValue
, transition
);
1032 static HRESULT WINAPI
tr_library_CreateConstantTransition(IUIAnimationTransitionLibrary
*iface
,
1033 double duration
, IUIAnimationTransition
**transition
)
1035 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1036 FIXME( "stub (%p)->(%f, %p)\n", This
, duration
, transition
);
1040 static HRESULT WINAPI
tr_library_CreateDiscreteTransition(IUIAnimationTransitionLibrary
*iface
,
1041 double delay
, double finalValue
, double hold
, IUIAnimationTransition
**transition
)
1043 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1044 FIXME( "stub (%p)->( )\n", This
);
1048 static HRESULT WINAPI
tr_library_CreateLinearTransition(IUIAnimationTransitionLibrary
*iface
,
1049 double duration
, double finalValue
, IUIAnimationTransition
**transition
)
1051 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1052 FIXME( "stub (%p)->(%f, %f, %p)\n", This
, duration
, finalValue
, transition
);
1056 static HRESULT WINAPI
tr_library_CreateLinearTransitionFromSpeed(IUIAnimationTransitionLibrary
*iface
,
1057 double speed
, double finalValue
, IUIAnimationTransition
**transition
)
1059 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1060 FIXME( "stub (%p)->(%f, %f, %p)\n", This
, speed
, finalValue
, transition
);
1064 static HRESULT WINAPI
tr_library_CreateSinusoidalTransitionFromVelocity(IUIAnimationTransitionLibrary
*iface
,
1065 double duration
, double period
, IUIAnimationTransition
**transition
)
1067 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1068 FIXME( "stub (%p)->(%f, %f, %p)\n", This
, duration
, period
, transition
);
1072 static HRESULT WINAPI
tr_library_CreateSinusoidalTransitionFromRange(IUIAnimationTransitionLibrary
*iface
,
1073 double duration
, double minimumValue
, double maximumValue
, double period
,
1074 UI_ANIMATION_SLOPE slope
, IUIAnimationTransition
**transition
)
1076 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1077 FIXME( "stub (%p)->(%f, %f, %f, %f, %d, %p)\n", This
, duration
, minimumValue
, maximumValue
, period
, slope
, transition
);
1081 static HRESULT WINAPI
tr_library_CreateAccelerateDecelerateTransition(IUIAnimationTransitionLibrary
*iface
,
1082 double duration
, double finalValue
, double accelerationRatio
, double decelerationRatio
,
1083 IUIAnimationTransition
**transition
)
1085 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1086 FIXME( "stub (%p)->(%f, %f, %f, %f, %p)\n", This
, duration
, finalValue
, accelerationRatio
, decelerationRatio
, transition
);
1090 static HRESULT WINAPI
tr_library_CreateReversalTransition(IUIAnimationTransitionLibrary
*iface
, double duration
,
1091 IUIAnimationTransition
**transition
)
1093 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1094 FIXME( "stub (%p)->(%f, %p)\n", This
, duration
, transition
);
1098 static HRESULT WINAPI
tr_library_CreateCubicTransition(IUIAnimationTransitionLibrary
*iface
, double duration
,
1099 double finalValue
, double finalVelocity
, IUIAnimationTransition
**transition
)
1101 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1102 FIXME( "stub (%p)->(%f, %f, %f, %p)\n", This
, duration
, finalValue
, finalVelocity
, transition
);
1106 static HRESULT WINAPI
tr_library_CreateSmoothStopTransition(IUIAnimationTransitionLibrary
*iface
,
1107 double maximumDuration
, double finalValue
, IUIAnimationTransition
**transition
)
1109 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1110 FIXME( "stub (%p)->(%f, %f, %p)\n", This
, maximumDuration
, finalValue
, transition
);
1114 static HRESULT WINAPI
tr_library_CreateParabolicTransitionFromAcceleration(IUIAnimationTransitionLibrary
*iface
,
1115 double finalValue
, double finalVelocity
, double acceleration
, IUIAnimationTransition
**transition
)
1117 struct tr_library
*This
= impl_from_IUIAnimationTransitionLibrary( iface
);
1118 FIXME( "stub (%p)->( )\n", This
);
1122 const struct IUIAnimationTransitionLibraryVtbl tr_library_vtbl
=
1124 tr_library_QueryInterface
,
1127 tr_library_CreateInstantaneousTransition
,
1128 tr_library_CreateConstantTransition
,
1129 tr_library_CreateDiscreteTransition
,
1130 tr_library_CreateLinearTransition
,
1131 tr_library_CreateLinearTransitionFromSpeed
,
1132 tr_library_CreateSinusoidalTransitionFromVelocity
,
1133 tr_library_CreateSinusoidalTransitionFromRange
,
1134 tr_library_CreateAccelerateDecelerateTransition
,
1135 tr_library_CreateReversalTransition
,
1136 tr_library_CreateCubicTransition
,
1137 tr_library_CreateSmoothStopTransition
,
1138 tr_library_CreateParabolicTransitionFromAcceleration
,
1141 static HRESULT
library_create( IUnknown
*outer
, REFIID iid
, void **obj
)
1143 struct tr_library
*This
= malloc( sizeof(*This
) );
1146 if (!This
) return E_OUTOFMEMORY
;
1147 This
->IUIAnimationTransitionLibrary_iface
.lpVtbl
= &tr_library_vtbl
;
1150 hr
= IUIAnimationTransitionLibrary_QueryInterface( &This
->IUIAnimationTransitionLibrary_iface
, iid
, obj
);
1152 IUIAnimationTransitionLibrary_Release( &This
->IUIAnimationTransitionLibrary_iface
);
1156 static struct class_factory manager_cf
= { { &class_factory_vtbl
}, manager_create
};
1157 static struct class_factory timer_cf
= { { &class_factory_vtbl
}, timer_create
};
1158 static struct class_factory transition_cf
= { { &class_factory_vtbl
}, transition_create
};
1159 static struct class_factory library_cf
= { { &class_factory_vtbl
}, library_create
};
1161 /******************************************************************
1164 HRESULT WINAPI
DllGetClassObject( REFCLSID clsid
, REFIID iid
, void **obj
)
1166 IClassFactory
*cf
= NULL
;
1168 TRACE( "(%s %s %p)\n", debugstr_guid( clsid
), debugstr_guid( iid
), obj
);
1170 if (IsEqualCLSID( clsid
, &CLSID_UIAnimationManager
))
1171 cf
= &manager_cf
.IClassFactory_iface
;
1172 else if (IsEqualCLSID( clsid
, &CLSID_UIAnimationTimer
))
1173 cf
= &timer_cf
.IClassFactory_iface
;
1174 else if (IsEqualCLSID( clsid
, &CLSID_UIAnimationTransitionFactory
))
1175 cf
= &transition_cf
.IClassFactory_iface
;
1176 else if (IsEqualCLSID( clsid
, &CLSID_UIAnimationTransitionLibrary
))
1177 cf
= &library_cf
.IClassFactory_iface
;
1180 return CLASS_E_CLASSNOTAVAILABLE
;
1182 return IClassFactory_QueryInterface( cf
, iid
, obj
);