kernel32/tests/pipe: Enable compilation with long types.
[wine.git] / dlls / uianimation / main.c
blobc338d83697813a868009e2295854f54f3e8b67b4
1 /*
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
20 #define COBJMACROS
22 #include <stdarg.h>
24 #include "windef.h"
25 #include "winbase.h"
26 #include "objbase.h"
27 #include "rpcproxy.h"
28 #include "oaidl.h"
29 #include "ocidl.h"
31 #include "initguid.h"
32 #include "uianimation.h"
34 #include "wine/heap.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(uianimation);
39 struct class_factory
41 IClassFactory IClassFactory_iface;
42 HRESULT (*create_instance)(IUnknown *, REFIID, void **);
45 static inline struct class_factory *impl_from_IClassFactory( IClassFactory *iface )
47 return CONTAINING_RECORD( iface, struct class_factory, IClassFactory_iface );
50 static HRESULT WINAPI class_factory_QueryInterface( IClassFactory *iface, REFIID iid, void **obj )
52 if (IsEqualIID( iid, &IID_IUnknown ) ||
53 IsEqualIID( iid, &IID_IClassFactory ))
55 IClassFactory_AddRef( iface );
56 *obj = iface;
57 return S_OK;
60 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
61 *obj = NULL;
62 return E_NOINTERFACE;
65 static ULONG WINAPI class_factory_AddRef( IClassFactory *iface )
67 return 2;
70 static ULONG WINAPI class_factory_Release( IClassFactory *iface )
72 return 1;
75 static HRESULT WINAPI class_factory_CreateInstance( IClassFactory *iface,
76 IUnknown *outer, REFIID iid,
77 void **obj )
79 struct class_factory *This = impl_from_IClassFactory( iface );
81 TRACE( "%p %s %p\n", outer, debugstr_guid( iid ), obj );
83 *obj = NULL;
84 return This->create_instance( outer, iid, obj );
87 static HRESULT WINAPI class_factory_LockServer( IClassFactory *iface,
88 BOOL lock )
90 FIXME( "%d: stub!\n", lock );
91 return S_OK;
94 static const struct IClassFactoryVtbl class_factory_vtbl =
96 class_factory_QueryInterface,
97 class_factory_AddRef,
98 class_factory_Release,
99 class_factory_CreateInstance,
100 class_factory_LockServer
103 /***********************************************************************
104 * IUIAnimationStoryboard
106 struct animation_storyboard
108 IUIAnimationStoryboard IUIAnimationStoryboard_iface;
109 LONG ref;
112 struct animation_storyboard *impl_from_IUIAnimationStoryboard( IUIAnimationStoryboard *iface )
114 return CONTAINING_RECORD( iface, struct animation_storyboard, IUIAnimationStoryboard_iface );
117 static HRESULT WINAPI animation_storyboard_QueryInterface( IUIAnimationStoryboard *iface,
118 REFIID iid, void **obj )
120 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
122 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
124 if (IsEqualIID( iid, &IID_IUnknown ) ||
125 IsEqualIID( iid, &IID_IUIAnimationStoryboard ))
127 IUIAnimationStoryboard_AddRef( iface );
128 *obj = iface;
129 return S_OK;
132 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
133 *obj = NULL;
134 return E_NOINTERFACE;
137 static ULONG WINAPI animation_storyboard_AddRef( IUIAnimationStoryboard *iface )
139 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
140 ULONG ref = InterlockedIncrement( &This->ref );
142 TRACE( "(%p) ref = %lu\n", This, ref );
143 return ref;
146 static ULONG WINAPI animation_storyboard_Release( IUIAnimationStoryboard *iface )
148 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
149 ULONG ref = InterlockedDecrement(&This->ref);
151 TRACE( "(%p) ref = %lu\n", This, ref );
153 if (!ref)
154 heap_free( This );
156 return ref;
159 static HRESULT WINAPI animation_storyboard_AddTransition (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable,
160 IUIAnimationTransition *transition)
162 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
163 FIXME( "stub (%p)->( )\n", This );
164 return S_OK;
167 static HRESULT WINAPI animation_storyboard_AddKeyframeAtOffset (IUIAnimationStoryboard *iface, UI_ANIMATION_KEYFRAME existingframe,
168 UI_ANIMATION_SECONDS offset, UI_ANIMATION_KEYFRAME *keyframe)
170 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
171 FIXME( "stub (%p)->( )\n", This );
172 return E_NOTIMPL;
175 static HRESULT WINAPI animation_storyboard_AddKeyframeAfterTransition (IUIAnimationStoryboard *iface,IUIAnimationTransition *transition,
176 UI_ANIMATION_KEYFRAME *keyframe)
178 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
179 FIXME( "stub (%p)->( )\n", This );
180 return S_OK;
183 static HRESULT WINAPI animation_storyboard_AddTransitionAtKeyframe (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable,
184 IUIAnimationTransition *transition, UI_ANIMATION_KEYFRAME start_key)
186 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
187 FIXME( "stub (%p)->( )\n", This );
188 return E_NOTIMPL;
191 static HRESULT WINAPI animation_storyboard_AddTransitionBetweenKeyframes (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable,
192 IUIAnimationTransition *transition, UI_ANIMATION_KEYFRAME start_key, UI_ANIMATION_KEYFRAME end_key)
194 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
195 FIXME( "stub (%p)->( )\n", This );
196 return E_NOTIMPL;
199 static HRESULT WINAPI animation_storyboard_RepeatBetweenKeyframes (IUIAnimationStoryboard *iface, UI_ANIMATION_KEYFRAME start_key,
200 UI_ANIMATION_KEYFRAME end_key, INT32 count)
202 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
203 FIXME( "stub (%p)->( )\n", This );
204 return S_OK;
207 static HRESULT WINAPI animation_storyboard_HoldVariable (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable)
209 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
210 FIXME( "stub (%p)->( )\n", This );
211 return E_NOTIMPL;
214 static HRESULT WINAPI animation_storyboard_SetLongestAcceptableDelay (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS delay)
216 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
217 FIXME( "stub (%p)->( )\n", This );
218 return E_NOTIMPL;
221 static HRESULT WINAPI animation_storyboard_Schedule (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS now,
222 UI_ANIMATION_SCHEDULING_RESULT *result)
224 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
225 FIXME( "stub (%p)->( )\n", This );
226 return 0;
229 static HRESULT WINAPI animation_storyboard_Conclude (IUIAnimationStoryboard *iface)
231 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
232 FIXME( "stub (%p)->( )\n", This );
233 return E_NOTIMPL;
236 static HRESULT WINAPI animation_storyboard_Finish (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS deadline)
238 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
239 FIXME( "stub (%p)->( )\n", This );
240 return E_NOTIMPL;
243 static HRESULT WINAPI animation_storyboard_Abandon (IUIAnimationStoryboard *iface)
245 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
246 FIXME( "stub (%p)->( )\n", This );
247 return E_NOTIMPL;
250 static HRESULT WINAPI animation_storyboard_SetTag(IUIAnimationStoryboard *iface, IUnknown *object, UINT32 id)
252 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
253 FIXME( "stub (%p)->( )\n", This );
254 return E_NOTIMPL;
257 static HRESULT WINAPI animation_storyboard_GetTag (IUIAnimationStoryboard *iface, IUnknown **object, UINT32 *id)
259 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
260 FIXME( "stub (%p)->( )\n", This );
261 return E_NOTIMPL;
264 static HRESULT WINAPI animation_storyboard_GetStatus (IUIAnimationStoryboard *iface, UI_ANIMATION_STORYBOARD_STATUS *status)
266 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
267 FIXME( "stub (%p)->( )\n", This );
268 return E_NOTIMPL;
271 static HRESULT WINAPI animation_storyboard_GetElapsedTime (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS *elapsed)
273 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
274 FIXME( "stub (%p)->( )\n", This );
275 return E_NOTIMPL;
278 static HRESULT WINAPI animation_storyboard_SetStoryboardEventHandler (IUIAnimationStoryboard *iface, IUIAnimationStoryboardEventHandler *handler)
280 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
281 FIXME( "stub (%p)->( )\n", This );
282 return S_OK;
285 const struct IUIAnimationStoryboardVtbl animation_storyboard_vtbl =
287 animation_storyboard_QueryInterface,
288 animation_storyboard_AddRef,
289 animation_storyboard_Release,
290 animation_storyboard_AddTransition,
291 animation_storyboard_AddKeyframeAtOffset,
292 animation_storyboard_AddKeyframeAfterTransition,
293 animation_storyboard_AddTransitionAtKeyframe,
294 animation_storyboard_AddTransitionBetweenKeyframes,
295 animation_storyboard_RepeatBetweenKeyframes,
296 animation_storyboard_HoldVariable,
297 animation_storyboard_SetLongestAcceptableDelay,
298 animation_storyboard_Schedule ,
299 animation_storyboard_Conclude ,
300 animation_storyboard_Finish ,
301 animation_storyboard_Abandon,
302 animation_storyboard_SetTag,
303 animation_storyboard_GetTag ,
304 animation_storyboard_GetStatus ,
305 animation_storyboard_GetElapsedTime,
306 animation_storyboard_SetStoryboardEventHandler
309 static HRESULT animation_storyboard_create( IUIAnimationStoryboard **obj )
311 struct animation_storyboard *This = heap_alloc( sizeof(*This) );
313 if (!This) return E_OUTOFMEMORY;
314 This->IUIAnimationStoryboard_iface.lpVtbl = &animation_storyboard_vtbl;
315 This->ref = 1;
317 *obj = &This->IUIAnimationStoryboard_iface;
319 return S_OK;
322 /***********************************************************************
323 * IUIAnimationVariable
325 struct animation_var
327 IUIAnimationVariable IUIAnimationVariable_iface;
328 LONG ref;
329 DOUBLE initial;
332 struct animation_var *impl_from_IUIAnimationVariable( IUIAnimationVariable *iface )
334 return CONTAINING_RECORD( iface, struct animation_var, IUIAnimationVariable_iface );
337 static HRESULT WINAPI animation_var_QueryInterface( IUIAnimationVariable *iface,
338 REFIID iid, void **obj )
340 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
342 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
344 if (IsEqualIID( iid, &IID_IUnknown ) ||
345 IsEqualIID( iid, &IID_IUIAnimationVariable ))
347 IUIAnimationVariable_AddRef( iface );
348 *obj = iface;
349 return S_OK;
352 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
353 *obj = NULL;
354 return E_NOINTERFACE;
357 static ULONG WINAPI animation_var_AddRef( IUIAnimationVariable *iface )
359 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
360 ULONG ref = InterlockedIncrement( &This->ref );
362 TRACE( "(%p) ref = %lu\n", This, ref );
363 return ref;
366 static ULONG WINAPI animation_var_Release( IUIAnimationVariable *iface )
368 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
369 ULONG ref = InterlockedDecrement(&This->ref);
371 TRACE( "(%p) ref = %lu\n", This, ref );
373 if (!ref)
374 heap_free( This );
376 return ref;
379 static HRESULT WINAPI animation_var_GetValue ( IUIAnimationVariable *iface, DOUBLE *value)
381 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
382 FIXME( "stub (%p)->( )\n", This);
383 return E_NOTIMPL;
386 static HRESULT WINAPI animation_var_GetFinalValue ( IUIAnimationVariable *iface, DOUBLE *value)
388 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
389 FIXME( "stub (%p)->( )\n", This );
390 return E_NOTIMPL;
393 static HRESULT WINAPI animation_var_GetPreviousValue ( IUIAnimationVariable *iface, DOUBLE *value)
395 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
396 FIXME( "stub (%p)->( )\n", This );
397 return E_NOTIMPL;
400 static HRESULT WINAPI animation_var_GetIntegerValue ( IUIAnimationVariable *iface, INT32 *value)
402 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
403 FIXME( "stub (%p)->( )\n", This );
404 return E_NOTIMPL;
407 static HRESULT WINAPI animation_var_GetFinalIntegerValue ( IUIAnimationVariable *iface, INT32 *value)
409 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
410 FIXME( "stub (%p)->( )\n", This );
411 return E_NOTIMPL;
414 static HRESULT WINAPI animation_var_GetPreviousIntegerValue ( IUIAnimationVariable *iface, INT32 *value)
416 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
417 FIXME( "stub (%p)->( )\n", This );
418 return E_NOTIMPL;
421 static HRESULT WINAPI animation_var_GetCurrentStoryboard ( IUIAnimationVariable *iface, IUIAnimationStoryboard **storyboard)
423 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
424 FIXME( "stub (%p)->( )\n", This );
425 return E_NOTIMPL;
428 static HRESULT WINAPI animation_var_SetLowerBound ( IUIAnimationVariable *iface, DOUBLE bound)
430 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
431 FIXME( "stub (%p)->( )\n", This );
432 return E_NOTIMPL;
435 static HRESULT WINAPI animation_var_SetUpperBound ( IUIAnimationVariable *iface, DOUBLE bound)
437 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
438 FIXME( "stub (%p)->( )\n", This );
439 return E_NOTIMPL;
442 static HRESULT WINAPI animation_var_SetRoundingMode ( IUIAnimationVariable *iface,UI_ANIMATION_ROUNDING_MODE mode)
444 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
445 FIXME( "stub (%p)->( )\n", This );
446 return S_OK;
449 static HRESULT WINAPI animation_var_SetTag ( IUIAnimationVariable *iface, IUnknown *object, UINT32 id)
451 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
452 FIXME( "stub (%p)->( )\n", This );
453 return E_NOTIMPL;
456 static HRESULT WINAPI animation_var_GetTag ( IUIAnimationVariable *iface, IUnknown **object, UINT32 *id)
458 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
459 FIXME( "stub (%p)->( )\n", This );
460 return E_NOTIMPL;
463 static HRESULT WINAPI animation_var_SetVariableChangeHandler ( IUIAnimationVariable *iface, IUIAnimationVariableChangeHandler *handler)
465 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
466 FIXME( "stub (%p)->( )\n", This );
467 return S_OK;
470 static HRESULT WINAPI animation_var_SetVariableIntegerChangeHandler ( IUIAnimationVariable *iface,
471 IUIAnimationVariableIntegerChangeHandler *handler)
473 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
474 FIXME( "stub (%p)->( )\n", This );
475 return S_OK;
478 const struct IUIAnimationVariableVtbl animation_var_vtbl =
480 animation_var_QueryInterface,
481 animation_var_AddRef,
482 animation_var_Release,
483 animation_var_GetValue,
484 animation_var_GetFinalValue,
485 animation_var_GetPreviousValue,
486 animation_var_GetIntegerValue,
487 animation_var_GetFinalIntegerValue,
488 animation_var_GetPreviousIntegerValue,
489 animation_var_GetCurrentStoryboard,
490 animation_var_SetLowerBound,
491 animation_var_SetUpperBound,
492 animation_var_SetRoundingMode,
493 animation_var_SetTag,
494 animation_var_GetTag,
495 animation_var_SetVariableChangeHandler,
496 animation_var_SetVariableIntegerChangeHandler,
499 static HRESULT animation_var_create(DOUBLE initial, IUIAnimationVariable **obj )
501 struct animation_var *This = heap_alloc( sizeof(*This) );
503 if (!This) return E_OUTOFMEMORY;
504 This->IUIAnimationVariable_iface.lpVtbl = &animation_var_vtbl;
505 This->ref = 1;
506 This->initial = initial;
508 *obj = &This->IUIAnimationVariable_iface;
510 return S_OK;
513 /***********************************************************************
514 * IUIAnimationManager
516 struct manager
518 IUIAnimationManager IUIAnimationManager_iface;
519 LONG ref;
522 struct manager *impl_from_IUIAnimationManager( IUIAnimationManager *iface )
524 return CONTAINING_RECORD( iface, struct manager, IUIAnimationManager_iface );
527 static HRESULT WINAPI manager_QueryInterface( IUIAnimationManager *iface, REFIID iid, void **obj )
529 struct manager *This = impl_from_IUIAnimationManager( iface );
531 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
533 if (IsEqualIID( iid, &IID_IUnknown ) ||
534 IsEqualIID( iid, &IID_IUIAnimationManager ))
536 IUIAnimationManager_AddRef( iface );
537 *obj = iface;
538 return S_OK;
541 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
542 *obj = NULL;
543 return E_NOINTERFACE;
546 static ULONG WINAPI manager_AddRef( IUIAnimationManager *iface )
548 struct manager *This = impl_from_IUIAnimationManager( iface );
549 ULONG ref = InterlockedIncrement( &This->ref );
551 TRACE( "(%p) ref = %lu\n", This, ref );
552 return ref;
555 static ULONG WINAPI manager_Release( IUIAnimationManager *iface )
557 struct manager *This = impl_from_IUIAnimationManager( iface );
558 ULONG ref = InterlockedDecrement(&This->ref);
560 TRACE( "(%p) ref = %lu\n", This, ref );
562 if (!ref)
564 heap_free( This );
567 return ref;
570 static HRESULT WINAPI manager_CreateAnimationVariable( IUIAnimationManager *iface, DOUBLE initial_value, IUIAnimationVariable **variable )
572 struct manager *This = impl_from_IUIAnimationManager( iface );
573 TRACE( "(%p)->(%f, %p)\n", This, initial_value, variable );
574 return animation_var_create(initial_value, variable);
577 static HRESULT WINAPI manager_ScheduleTransition( IUIAnimationManager *iface, IUIAnimationVariable *variable, IUIAnimationTransition *transition, UI_ANIMATION_SECONDS current_time )
579 struct manager *This = impl_from_IUIAnimationManager( iface );
580 FIXME( "stub (%p)->(%p, %p)\n", This, variable, transition );
581 return E_NOTIMPL;
584 static HRESULT WINAPI manager_CreateStoryboard( IUIAnimationManager *iface, IUIAnimationStoryboard **storyboard )
586 struct manager *This = impl_from_IUIAnimationManager( iface );
587 TRACE( "(%p)->(%p)\n", This, storyboard );
588 return animation_storyboard_create(storyboard);
591 static HRESULT WINAPI manager_FinishAllStoryboards( IUIAnimationManager *iface, UI_ANIMATION_SECONDS max_time )
593 struct manager *This = impl_from_IUIAnimationManager( iface );
594 FIXME( "stub (%p)->(%f)\n", This, max_time );
595 return E_NOTIMPL;
598 static HRESULT WINAPI manager_AbandonAllStoryboards( IUIAnimationManager *iface )
600 struct manager *This = impl_from_IUIAnimationManager( iface );
601 FIXME( "stub (%p)->()\n", This );
602 return E_NOTIMPL;
605 static HRESULT WINAPI manager_Update( IUIAnimationManager *iface, UI_ANIMATION_SECONDS cur_time, UI_ANIMATION_UPDATE_RESULT *update_result )
607 struct manager *This = impl_from_IUIAnimationManager( iface );
608 FIXME( "stub (%p)->(%f, %p)\n", This, cur_time, update_result );
609 if (update_result)
610 *update_result = UI_ANIMATION_UPDATE_VARIABLES_CHANGED;
611 return S_OK;
614 static HRESULT WINAPI manager_GetVariableFromTag( IUIAnimationManager *iface, IUnknown *object, UINT32 id, IUIAnimationVariable **variable )
616 struct manager *This = impl_from_IUIAnimationManager( iface );
617 FIXME( "stub (%p)->(%p, %p)\n", This, object, variable );
618 return E_NOTIMPL;
621 static HRESULT WINAPI manager_GetStoryboardFromTag( IUIAnimationManager *iface, IUnknown *object, UINT32 id, IUIAnimationStoryboard **storyboard )
623 struct manager *This = impl_from_IUIAnimationManager( iface );
624 FIXME( "stub (%p)->(%p, %d, %p)\n", This, object, id, storyboard );
625 return E_NOTIMPL;
628 static HRESULT WINAPI manager_GetStatus( IUIAnimationManager *iface, UI_ANIMATION_MANAGER_STATUS *status )
630 struct manager *This = impl_from_IUIAnimationManager( iface );
631 FIXME( "stub (%p)->(%p)\n", This, status );
632 return E_NOTIMPL;
635 static HRESULT WINAPI manager_SetAnimationMode( IUIAnimationManager *iface, UI_ANIMATION_MODE mode )
637 struct manager *This = impl_from_IUIAnimationManager( iface );
638 FIXME( "stub (%p)->(%d)\n", This, mode );
639 return S_OK;
642 static HRESULT WINAPI manager_Pause( IUIAnimationManager *iface )
644 struct manager *This = impl_from_IUIAnimationManager( iface );
645 FIXME( "stub (%p)->()\n", This );
646 return E_NOTIMPL;
649 static HRESULT WINAPI manager_Resume( IUIAnimationManager *iface )
651 struct manager *This = impl_from_IUIAnimationManager( iface );
652 FIXME( "stub (%p)->()\n", This );
653 return E_NOTIMPL;
656 static HRESULT WINAPI manager_SetManagerEventHandler( IUIAnimationManager *iface, IUIAnimationManagerEventHandler *handler )
658 struct manager *This = impl_from_IUIAnimationManager( iface );
659 FIXME( "stub (%p)->(%p)\n", This, handler );
660 return S_OK;
663 static HRESULT WINAPI manager_SetCancelPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison )
665 struct manager *This = impl_from_IUIAnimationManager( iface );
666 FIXME( "stub (%p)->(%p)\n", This, comparison );
667 return E_NOTIMPL;
670 static HRESULT WINAPI manager_SetTrimPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison )
672 struct manager *This = impl_from_IUIAnimationManager( iface );
673 FIXME( "stub (%p)->(%p)\n", This, comparison );
674 return E_NOTIMPL;
677 static HRESULT WINAPI manager_SetCompressPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison)
679 struct manager *This = impl_from_IUIAnimationManager( iface );
680 FIXME( "stub (%p)->(%p)\n", This, comparison );
681 return E_NOTIMPL;
684 static HRESULT WINAPI manager_SetConcludePriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison )
686 struct manager *This = impl_from_IUIAnimationManager( iface );
687 FIXME( "stub (%p)->(%p)\n", This, comparison );
688 return E_NOTIMPL;
691 static HRESULT WINAPI manager_SetDefaultLongestAcceptableDelay( IUIAnimationManager *iface, UI_ANIMATION_SECONDS delay )
693 struct manager *This = impl_from_IUIAnimationManager( iface );
694 FIXME( "stub (%p)->(%f)\n", This, delay );
695 return E_NOTIMPL;
698 static HRESULT WINAPI manager_Shutdown( IUIAnimationManager *iface )
700 struct manager *This = impl_from_IUIAnimationManager( iface );
701 FIXME( "stub (%p)->()\n", This );
702 return E_NOTIMPL;
705 const struct IUIAnimationManagerVtbl manager_vtbl =
707 manager_QueryInterface,
708 manager_AddRef,
709 manager_Release,
710 manager_CreateAnimationVariable,
711 manager_ScheduleTransition,
712 manager_CreateStoryboard,
713 manager_FinishAllStoryboards,
714 manager_AbandonAllStoryboards,
715 manager_Update,
716 manager_GetVariableFromTag,
717 manager_GetStoryboardFromTag,
718 manager_GetStatus,
719 manager_SetAnimationMode,
720 manager_Pause,
721 manager_Resume,
722 manager_SetManagerEventHandler,
723 manager_SetCancelPriorityComparison,
724 manager_SetTrimPriorityComparison,
725 manager_SetCompressPriorityComparison,
726 manager_SetConcludePriorityComparison,
727 manager_SetDefaultLongestAcceptableDelay,
728 manager_Shutdown
731 static HRESULT manager_create( IUnknown *outer, REFIID iid, void **obj )
733 struct manager *This = heap_alloc( sizeof(*This) );
734 HRESULT hr;
736 if (!This) return E_OUTOFMEMORY;
737 This->IUIAnimationManager_iface.lpVtbl = &manager_vtbl;
738 This->ref = 1;
740 hr = IUIAnimationManager_QueryInterface( &This->IUIAnimationManager_iface, iid, obj );
742 IUIAnimationManager_Release( &This->IUIAnimationManager_iface );
743 return hr;
746 /***********************************************************************
747 * IUIAnimationTimer
749 struct timer
751 IUIAnimationTimer IUIAnimationTimer_iface;
752 LONG ref;
755 struct timer *impl_from_IUIAnimationTimer( IUIAnimationTimer *iface )
757 return CONTAINING_RECORD( iface, struct timer, IUIAnimationTimer_iface );
760 static HRESULT WINAPI timer_QueryInterface( IUIAnimationTimer *iface, REFIID iid, void **obj )
762 struct timer *This = impl_from_IUIAnimationTimer( iface );
764 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
766 if (IsEqualIID( iid, &IID_IUnknown ) ||
767 IsEqualIID( iid, &IID_IUIAnimationTimer ))
769 IUIAnimationTimer_AddRef( iface );
770 *obj = iface;
771 return S_OK;
774 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
775 *obj = NULL;
776 return E_NOINTERFACE;
779 static ULONG WINAPI timer_AddRef( IUIAnimationTimer *iface )
781 struct timer *This = impl_from_IUIAnimationTimer( iface );
782 ULONG ref = InterlockedIncrement( &This->ref );
784 TRACE( "(%p) ref = %lu\n", This, ref );
785 return ref;
788 static ULONG WINAPI timer_Release( IUIAnimationTimer *iface )
790 struct timer *This = impl_from_IUIAnimationTimer( iface );
791 ULONG ref = InterlockedDecrement(&This->ref);
793 TRACE( "(%p) ref = %lu\n", This, ref );
795 if (!ref)
796 heap_free( This );
798 return ref;
801 static HRESULT WINAPI timer_SetTimerUpdateHandler (IUIAnimationTimer *iface,
802 IUIAnimationTimerUpdateHandler *update_handler,
803 UI_ANIMATION_IDLE_BEHAVIOR idle_behaviour)
805 struct timer *This = impl_from_IUIAnimationTimer( iface );
806 FIXME( "stub (%p)->(%p, %d)\n", This, update_handler, idle_behaviour );
807 return E_NOTIMPL;
810 static HRESULT WINAPI timer_SetTimerEventHandler (IUIAnimationTimer *iface,
811 IUIAnimationTimerEventHandler *handler)
813 struct timer *This = impl_from_IUIAnimationTimer( iface );
814 FIXME( "stub (%p)->()\n", This );
815 return S_OK;
818 static HRESULT WINAPI timer_Enable (IUIAnimationTimer *iface)
820 struct timer *This = impl_from_IUIAnimationTimer( iface );
821 FIXME( "stub (%p)->()\n", This );
822 return S_OK;
825 static HRESULT WINAPI timer_Disable (IUIAnimationTimer *iface)
827 struct timer *This = impl_from_IUIAnimationTimer( iface );
828 FIXME( "stub (%p)->()\n", This );
829 return E_NOTIMPL;
832 static HRESULT WINAPI timer_IsEnabled (IUIAnimationTimer *iface)
834 struct timer *This = impl_from_IUIAnimationTimer( iface );
835 FIXME( "stub (%p)->()\n", This );
836 return E_NOTIMPL;
839 static HRESULT WINAPI timer_GetTime (IUIAnimationTimer *iface, UI_ANIMATION_SECONDS *seconds)
841 struct timer *This = impl_from_IUIAnimationTimer( iface );
842 FIXME( "stub (%p)->(%p)\n", This, seconds );
843 return S_OK;
846 static HRESULT WINAPI timer_SetFrameRateThreshold (IUIAnimationTimer *iface, UINT32 frames_per_sec)
848 struct timer *This = impl_from_IUIAnimationTimer( iface );
849 FIXME( "stub (%p)->(%d)\n", This, frames_per_sec );
850 return E_NOTIMPL;
853 const struct IUIAnimationTimerVtbl timer_vtbl =
855 timer_QueryInterface,
856 timer_AddRef,
857 timer_Release,
858 timer_SetTimerUpdateHandler,
859 timer_SetTimerEventHandler,
860 timer_Enable,
861 timer_Disable,
862 timer_IsEnabled,
863 timer_GetTime,
864 timer_SetFrameRateThreshold,
867 static HRESULT timer_create( IUnknown *outer, REFIID iid, void **obj )
869 struct timer *This = heap_alloc( sizeof(*This) );
870 HRESULT hr;
872 if (!This)
873 return E_OUTOFMEMORY;
874 This->IUIAnimationTimer_iface.lpVtbl = &timer_vtbl;
875 This->ref = 1;
877 hr = IUIAnimationTimer_QueryInterface( &This->IUIAnimationTimer_iface, iid, obj );
879 IUIAnimationTimer_Release( &This->IUIAnimationTimer_iface );
880 return hr;
883 /***********************************************************************
884 * IUIAnimationTransitionFactory
886 struct tr_factory
888 IUIAnimationTransitionFactory IUIAnimationTransitionFactory_iface;
889 LONG ref;
892 struct tr_factory *impl_from_IUIAnimationTransitionFactory( IUIAnimationTransitionFactory *iface )
894 return CONTAINING_RECORD( iface, struct tr_factory, IUIAnimationTransitionFactory_iface );
897 static HRESULT WINAPI tr_factory_QueryInterface( IUIAnimationTransitionFactory *iface, REFIID iid, void **obj )
899 struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface );
901 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
903 if (IsEqualIID( iid, &IID_IUnknown ) ||
904 IsEqualIID( iid, &IID_IUIAnimationTransitionFactory ))
906 IUIAnimationTransitionFactory_AddRef( iface );
907 *obj = iface;
908 return S_OK;
911 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
912 *obj = NULL;
913 return E_NOINTERFACE;
916 static ULONG WINAPI tr_factory_AddRef( IUIAnimationTransitionFactory *iface )
918 struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface );
919 ULONG ref = InterlockedIncrement( &This->ref );
921 TRACE( "(%p) ref = %lu\n", This, ref );
922 return ref;
925 static ULONG WINAPI tr_factory_Release( IUIAnimationTransitionFactory *iface )
927 struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface );
928 ULONG ref = InterlockedDecrement(&This->ref);
930 TRACE( "(%p) ref = %lu\n", This, ref );
932 if (!ref)
933 heap_free( This );
935 return ref;
938 static HRESULT WINAPI tr_factory_CreateTransition(IUIAnimationTransitionFactory *iface,
939 IUIAnimationInterpolator *interpolator, IUIAnimationTransition **transition)
941 struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface );
942 FIXME( "stub (%p)->(%p, %p)\n", This, interpolator, transition );
943 return E_NOTIMPL;
946 const struct IUIAnimationTransitionFactoryVtbl tr_factory_vtbl =
948 tr_factory_QueryInterface,
949 tr_factory_AddRef,
950 tr_factory_Release,
951 tr_factory_CreateTransition
954 static HRESULT transition_create( IUnknown *outer, REFIID iid, void **obj )
956 struct tr_factory *This = heap_alloc( sizeof(*This) );
957 HRESULT hr;
959 if (!This) return E_OUTOFMEMORY;
960 This->IUIAnimationTransitionFactory_iface.lpVtbl = &tr_factory_vtbl;
961 This->ref = 1;
963 hr = IUIAnimationTransitionFactory_QueryInterface( &This->IUIAnimationTransitionFactory_iface, iid, obj );
965 IUIAnimationTransitionFactory_Release( &This->IUIAnimationTransitionFactory_iface );
966 return hr;
969 /***********************************************************************
970 * IUITransitionLibrary
972 struct tr_library
974 IUIAnimationTransitionLibrary IUIAnimationTransitionLibrary_iface;
975 LONG ref;
978 struct tr_library *impl_from_IUIAnimationTransitionLibrary( IUIAnimationTransitionLibrary *iface )
980 return CONTAINING_RECORD( iface, struct tr_library, IUIAnimationTransitionLibrary_iface );
983 static HRESULT WINAPI tr_library_QueryInterface( IUIAnimationTransitionLibrary *iface,
984 REFIID iid, void **obj )
986 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
988 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
990 if (IsEqualIID( iid, &IID_IUnknown ) ||
991 IsEqualIID( iid, &IID_IUIAnimationTransitionLibrary ))
993 IUIAnimationTransitionLibrary_AddRef( iface );
994 *obj = iface;
995 return S_OK;
998 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
999 *obj = NULL;
1000 return E_NOINTERFACE;
1003 static ULONG WINAPI tr_library_AddRef( IUIAnimationTransitionLibrary *iface )
1005 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1006 ULONG ref = InterlockedIncrement( &This->ref );
1008 TRACE( "(%p) ref = %lu\n", This, ref );
1009 return ref;
1012 static ULONG WINAPI tr_library_Release( IUIAnimationTransitionLibrary *iface )
1014 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1015 ULONG ref = InterlockedDecrement(&This->ref);
1017 TRACE( "(%p) ref = %lu\n", This, ref );
1019 if (!ref)
1020 heap_free( This );
1022 return ref;
1025 static HRESULT WINAPI tr_library_CreateInstantaneousTransition(IUIAnimationTransitionLibrary *iface,
1026 double finalValue, IUIAnimationTransition **transition)
1028 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1029 FIXME( "stub (%p)->(%f, %p)\n", This, finalValue, transition );
1030 return E_NOTIMPL;
1033 static HRESULT WINAPI tr_library_CreateConstantTransition(IUIAnimationTransitionLibrary *iface,
1034 double duration, IUIAnimationTransition **transition)
1036 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1037 FIXME( "stub (%p)->(%f, %p)\n", This, duration, transition );
1038 return E_NOTIMPL;
1041 static HRESULT WINAPI tr_library_CreateDiscreteTransition(IUIAnimationTransitionLibrary *iface,
1042 double delay, double finalValue, double hold, IUIAnimationTransition **transition)
1044 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1045 FIXME( "stub (%p)->( )\n", This );
1046 return E_NOTIMPL;
1049 static HRESULT WINAPI tr_library_CreateLinearTransition(IUIAnimationTransitionLibrary *iface,
1050 double duration, double finalValue, IUIAnimationTransition **transition)
1052 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1053 FIXME( "stub (%p)->(%f, %f, %p)\n", This, duration, finalValue, transition );
1054 return E_NOTIMPL;
1057 static HRESULT WINAPI tr_library_CreateLinearTransitionFromSpeed(IUIAnimationTransitionLibrary *iface,
1058 double speed, double finalValue, IUIAnimationTransition **transition)
1060 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1061 FIXME( "stub (%p)->(%f, %f, %p)\n", This, speed, finalValue, transition );
1062 return E_NOTIMPL;
1065 static HRESULT WINAPI tr_library_CreateSinusoidalTransitionFromVelocity(IUIAnimationTransitionLibrary *iface,
1066 double duration, double period, IUIAnimationTransition **transition)
1068 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1069 FIXME( "stub (%p)->(%f, %f, %p)\n", This, duration, period, transition );
1070 return E_NOTIMPL;
1073 static HRESULT WINAPI tr_library_CreateSinusoidalTransitionFromRange(IUIAnimationTransitionLibrary *iface,
1074 double duration, double minimumValue, double maximumValue, double period,
1075 UI_ANIMATION_SLOPE slope, IUIAnimationTransition **transition)
1077 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1078 FIXME( "stub (%p)->(%f, %f, %f, %f, %d, %p)\n", This, duration, minimumValue, maximumValue, period, slope, transition );
1079 return E_NOTIMPL;
1082 static HRESULT WINAPI tr_library_CreateAccelerateDecelerateTransition(IUIAnimationTransitionLibrary *iface,
1083 double duration, double finalValue, double accelerationRatio, double decelerationRatio,
1084 IUIAnimationTransition **transition)
1086 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1087 FIXME( "stub (%p)->(%f, %f, %f, %f, %p)\n", This, duration, finalValue, accelerationRatio, decelerationRatio, transition );
1088 return E_NOTIMPL;
1091 static HRESULT WINAPI tr_library_CreateReversalTransition(IUIAnimationTransitionLibrary *iface, double duration,
1092 IUIAnimationTransition **transition)
1094 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1095 FIXME( "stub (%p)->(%f, %p)\n", This, duration, transition );
1096 return E_NOTIMPL;
1099 static HRESULT WINAPI tr_library_CreateCubicTransition(IUIAnimationTransitionLibrary *iface, double duration,
1100 double finalValue, double finalVelocity, IUIAnimationTransition **transition)
1102 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1103 FIXME( "stub (%p)->(%f, %f, %f, %p)\n", This, duration, finalValue, finalVelocity, transition );
1104 return E_NOTIMPL;
1107 static HRESULT WINAPI tr_library_CreateSmoothStopTransition(IUIAnimationTransitionLibrary *iface,
1108 double maximumDuration, double finalValue, IUIAnimationTransition **transition)
1110 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1111 FIXME( "stub (%p)->(%f, %f, %p)\n", This, maximumDuration, finalValue, transition );
1112 return E_NOTIMPL;
1115 static HRESULT WINAPI tr_library_CreateParabolicTransitionFromAcceleration(IUIAnimationTransitionLibrary *iface,
1116 double finalValue, double finalVelocity, double acceleration, IUIAnimationTransition **transition)
1118 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1119 FIXME( "stub (%p)->( )\n", This );
1120 return E_NOTIMPL;
1123 const struct IUIAnimationTransitionLibraryVtbl tr_library_vtbl =
1125 tr_library_QueryInterface,
1126 tr_library_AddRef,
1127 tr_library_Release,
1128 tr_library_CreateInstantaneousTransition,
1129 tr_library_CreateConstantTransition,
1130 tr_library_CreateDiscreteTransition,
1131 tr_library_CreateLinearTransition,
1132 tr_library_CreateLinearTransitionFromSpeed,
1133 tr_library_CreateSinusoidalTransitionFromVelocity,
1134 tr_library_CreateSinusoidalTransitionFromRange,
1135 tr_library_CreateAccelerateDecelerateTransition,
1136 tr_library_CreateReversalTransition,
1137 tr_library_CreateCubicTransition,
1138 tr_library_CreateSmoothStopTransition,
1139 tr_library_CreateParabolicTransitionFromAcceleration,
1142 static HRESULT library_create( IUnknown *outer, REFIID iid, void **obj )
1144 struct tr_library *This = heap_alloc( sizeof(*This) );
1145 HRESULT hr;
1147 if (!This) return E_OUTOFMEMORY;
1148 This->IUIAnimationTransitionLibrary_iface.lpVtbl = &tr_library_vtbl;
1149 This->ref = 1;
1151 hr = IUIAnimationTransitionLibrary_QueryInterface( &This->IUIAnimationTransitionLibrary_iface, iid, obj );
1153 IUIAnimationTransitionLibrary_Release( &This->IUIAnimationTransitionLibrary_iface );
1154 return hr;
1157 static struct class_factory manager_cf = { { &class_factory_vtbl }, manager_create };
1158 static struct class_factory timer_cf = { { &class_factory_vtbl }, timer_create };
1159 static struct class_factory transition_cf = { { &class_factory_vtbl }, transition_create };
1160 static struct class_factory library_cf = { { &class_factory_vtbl }, library_create };
1162 /******************************************************************
1163 * DllGetClassObject
1165 HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **obj )
1167 IClassFactory *cf = NULL;
1169 TRACE( "(%s %s %p)\n", debugstr_guid( clsid ), debugstr_guid( iid ), obj );
1171 if (IsEqualCLSID( clsid, &CLSID_UIAnimationManager ))
1172 cf = &manager_cf.IClassFactory_iface;
1173 else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTimer ))
1174 cf = &timer_cf.IClassFactory_iface;
1175 else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTransitionFactory ))
1176 cf = &transition_cf.IClassFactory_iface;
1177 else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTransitionLibrary ))
1178 cf = &library_cf.IClassFactory_iface;
1180 if (!cf)
1181 return CLASS_E_CLASSNOTAVAILABLE;
1183 return IClassFactory_QueryInterface( cf, iid, obj );