winedbg: Don't dereference possibly NULL thread pointer.
[wine/zf.git] / dlls / uianimation / main.c
blob412c31f5f015efedd32ce3177216e22e01f53e0d
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 static HINSTANCE hinstance;
41 BOOL WINAPI DllMain( HINSTANCE dll, DWORD reason, LPVOID reserved )
43 TRACE("(%p %d %p)\n", dll, reason, reserved);
45 switch (reason)
47 case DLL_PROCESS_ATTACH:
48 hinstance = dll;
49 DisableThreadLibraryCalls( dll );
50 break;
52 return TRUE;
55 struct class_factory
57 IClassFactory IClassFactory_iface;
58 HRESULT (*create_instance)(IUnknown *, REFIID, void **);
61 static inline struct class_factory *impl_from_IClassFactory( IClassFactory *iface )
63 return CONTAINING_RECORD( iface, struct class_factory, IClassFactory_iface );
66 static HRESULT WINAPI class_factory_QueryInterface( IClassFactory *iface, REFIID iid, void **obj )
68 if (IsEqualIID( iid, &IID_IUnknown ) ||
69 IsEqualIID( iid, &IID_IClassFactory ))
71 IClassFactory_AddRef( iface );
72 *obj = iface;
73 return S_OK;
76 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
77 *obj = NULL;
78 return E_NOINTERFACE;
81 static ULONG WINAPI class_factory_AddRef( IClassFactory *iface )
83 return 2;
86 static ULONG WINAPI class_factory_Release( IClassFactory *iface )
88 return 1;
91 static HRESULT WINAPI class_factory_CreateInstance( IClassFactory *iface,
92 IUnknown *outer, REFIID iid,
93 void **obj )
95 struct class_factory *This = impl_from_IClassFactory( iface );
97 TRACE( "%p %s %p\n", outer, debugstr_guid( iid ), obj );
99 *obj = NULL;
100 return This->create_instance( outer, iid, obj );
103 static HRESULT WINAPI class_factory_LockServer( IClassFactory *iface,
104 BOOL lock )
106 FIXME( "%d: stub!\n", lock );
107 return S_OK;
110 static const struct IClassFactoryVtbl class_factory_vtbl =
112 class_factory_QueryInterface,
113 class_factory_AddRef,
114 class_factory_Release,
115 class_factory_CreateInstance,
116 class_factory_LockServer
119 /***********************************************************************
120 * IUIAnimationStoryboard
122 struct animation_storyboard
124 IUIAnimationStoryboard IUIAnimationStoryboard_iface;
125 LONG ref;
128 struct animation_storyboard *impl_from_IUIAnimationStoryboard( IUIAnimationStoryboard *iface )
130 return CONTAINING_RECORD( iface, struct animation_storyboard, IUIAnimationStoryboard_iface );
133 static HRESULT WINAPI animation_storyboard_QueryInterface( IUIAnimationStoryboard *iface,
134 REFIID iid, void **obj )
136 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
138 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
140 if (IsEqualIID( iid, &IID_IUnknown ) ||
141 IsEqualIID( iid, &IID_IUIAnimationStoryboard ))
143 IUIAnimationStoryboard_AddRef( iface );
144 *obj = iface;
145 return S_OK;
148 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
149 *obj = NULL;
150 return E_NOINTERFACE;
153 static ULONG WINAPI animation_storyboard_AddRef( IUIAnimationStoryboard *iface )
155 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
156 ULONG ref = InterlockedIncrement( &This->ref );
158 TRACE( "(%p) ref = %u\n", This, ref );
159 return ref;
162 static ULONG WINAPI animation_storyboard_Release( IUIAnimationStoryboard *iface )
164 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
165 ULONG ref = InterlockedDecrement(&This->ref);
167 TRACE( "(%p) ref = %u\n", This, ref );
169 if (!ref)
170 heap_free( This );
172 return ref;
175 static HRESULT WINAPI animation_storyboard_AddTransition (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable,
176 IUIAnimationTransition *transition)
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_AddKeyframeAtOffset (IUIAnimationStoryboard *iface, UI_ANIMATION_KEYFRAME existingframe,
184 UI_ANIMATION_SECONDS offset, UI_ANIMATION_KEYFRAME *keyframe)
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_AddKeyframeAfterTransition (IUIAnimationStoryboard *iface,IUIAnimationTransition *transition,
192 UI_ANIMATION_KEYFRAME *keyframe)
194 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
195 FIXME( "stub (%p)->( )\n", This );
196 return S_OK;
199 static HRESULT WINAPI animation_storyboard_AddTransitionAtKeyframe (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable,
200 IUIAnimationTransition *transition, UI_ANIMATION_KEYFRAME start_key)
202 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
203 FIXME( "stub (%p)->( )\n", This );
204 return E_NOTIMPL;
207 static HRESULT WINAPI animation_storyboard_AddTransitionBetweenKeyframes (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable,
208 IUIAnimationTransition *transition, UI_ANIMATION_KEYFRAME start_key, UI_ANIMATION_KEYFRAME end_key)
210 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
211 FIXME( "stub (%p)->( )\n", This );
212 return E_NOTIMPL;
215 static HRESULT WINAPI animation_storyboard_RepeatBetweenKeyframes (IUIAnimationStoryboard *iface, UI_ANIMATION_KEYFRAME start_key,
216 UI_ANIMATION_KEYFRAME end_key, INT32 count)
218 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
219 FIXME( "stub (%p)->( )\n", This );
220 return S_OK;
223 static HRESULT WINAPI animation_storyboard_HoldVariable (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable)
225 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
226 FIXME( "stub (%p)->( )\n", This );
227 return E_NOTIMPL;
230 static HRESULT WINAPI animation_storyboard_SetLongestAcceptableDelay (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS delay)
232 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
233 FIXME( "stub (%p)->( )\n", This );
234 return E_NOTIMPL;
237 static HRESULT WINAPI animation_storyboard_Schedule (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS now,
238 UI_ANIMATION_SCHEDULING_RESULT *result)
240 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
241 FIXME( "stub (%p)->( )\n", This );
242 return 0;
245 static HRESULT WINAPI animation_storyboard_Conclude (IUIAnimationStoryboard *iface)
247 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
248 FIXME( "stub (%p)->( )\n", This );
249 return E_NOTIMPL;
252 static HRESULT WINAPI animation_storyboard_Finish (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS deadline)
254 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
255 FIXME( "stub (%p)->( )\n", This );
256 return E_NOTIMPL;
259 static HRESULT WINAPI animation_storyboard_Abandon (IUIAnimationStoryboard *iface)
261 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
262 FIXME( "stub (%p)->( )\n", This );
263 return E_NOTIMPL;
266 static HRESULT WINAPI animation_storyboard_SetTag(IUIAnimationStoryboard *iface, IUnknown *object, UINT32 id)
268 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
269 FIXME( "stub (%p)->( )\n", This );
270 return E_NOTIMPL;
273 static HRESULT WINAPI animation_storyboard_GetTag (IUIAnimationStoryboard *iface, IUnknown **object, UINT32 *id)
275 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
276 FIXME( "stub (%p)->( )\n", This );
277 return E_NOTIMPL;
280 static HRESULT WINAPI animation_storyboard_GetStatus (IUIAnimationStoryboard *iface, UI_ANIMATION_STORYBOARD_STATUS *status)
282 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
283 FIXME( "stub (%p)->( )\n", This );
284 return E_NOTIMPL;
287 static HRESULT WINAPI animation_storyboard_GetElapsedTime (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS *elapsed)
289 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
290 FIXME( "stub (%p)->( )\n", This );
291 return E_NOTIMPL;
294 static HRESULT WINAPI animation_storyboard_SetStoryboardEventHandler (IUIAnimationStoryboard *iface, IUIAnimationStoryboardEventHandler *handler)
296 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
297 FIXME( "stub (%p)->( )\n", This );
298 return S_OK;
301 const struct IUIAnimationStoryboardVtbl animation_storyboard_vtbl =
303 animation_storyboard_QueryInterface,
304 animation_storyboard_AddRef,
305 animation_storyboard_Release,
306 animation_storyboard_AddTransition,
307 animation_storyboard_AddKeyframeAtOffset,
308 animation_storyboard_AddKeyframeAfterTransition,
309 animation_storyboard_AddTransitionAtKeyframe,
310 animation_storyboard_AddTransitionBetweenKeyframes,
311 animation_storyboard_RepeatBetweenKeyframes,
312 animation_storyboard_HoldVariable,
313 animation_storyboard_SetLongestAcceptableDelay,
314 animation_storyboard_Schedule ,
315 animation_storyboard_Conclude ,
316 animation_storyboard_Finish ,
317 animation_storyboard_Abandon,
318 animation_storyboard_SetTag,
319 animation_storyboard_GetTag ,
320 animation_storyboard_GetStatus ,
321 animation_storyboard_GetElapsedTime,
322 animation_storyboard_SetStoryboardEventHandler
325 static HRESULT animation_storyboard_create( IUIAnimationStoryboard **obj )
327 struct animation_storyboard *This = heap_alloc( sizeof(*This) );
329 if (!This) return E_OUTOFMEMORY;
330 This->IUIAnimationStoryboard_iface.lpVtbl = &animation_storyboard_vtbl;
331 This->ref = 1;
333 *obj = &This->IUIAnimationStoryboard_iface;
335 return S_OK;
338 /***********************************************************************
339 * IUIAnimationVariable
341 struct animation_var
343 IUIAnimationVariable IUIAnimationVariable_iface;
344 LONG ref;
345 DOUBLE initial;
348 struct animation_var *impl_from_IUIAnimationVariable( IUIAnimationVariable *iface )
350 return CONTAINING_RECORD( iface, struct animation_var, IUIAnimationVariable_iface );
353 static HRESULT WINAPI animation_var_QueryInterface( IUIAnimationVariable *iface,
354 REFIID iid, void **obj )
356 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
358 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
360 if (IsEqualIID( iid, &IID_IUnknown ) ||
361 IsEqualIID( iid, &IID_IUIAnimationVariable ))
363 IUIAnimationVariable_AddRef( iface );
364 *obj = iface;
365 return S_OK;
368 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
369 *obj = NULL;
370 return E_NOINTERFACE;
373 static ULONG WINAPI animation_var_AddRef( IUIAnimationVariable *iface )
375 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
376 ULONG ref = InterlockedIncrement( &This->ref );
378 TRACE( "(%p) ref = %u\n", This, ref );
379 return ref;
382 static ULONG WINAPI animation_var_Release( IUIAnimationVariable *iface )
384 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
385 ULONG ref = InterlockedDecrement(&This->ref);
387 TRACE( "(%p) ref = %u\n", This, ref );
389 if (!ref)
390 heap_free( This );
392 return ref;
395 static HRESULT WINAPI animation_var_GetValue ( IUIAnimationVariable *iface, DOUBLE *value)
397 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
398 FIXME( "stub (%p)->( )\n", This);
399 return E_NOTIMPL;
402 static HRESULT WINAPI animation_var_GetFinalValue ( IUIAnimationVariable *iface, DOUBLE *value)
404 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
405 FIXME( "stub (%p)->( )\n", This );
406 return E_NOTIMPL;
409 static HRESULT WINAPI animation_var_GetPreviousValue ( IUIAnimationVariable *iface, DOUBLE *value)
411 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
412 FIXME( "stub (%p)->( )\n", This );
413 return E_NOTIMPL;
416 static HRESULT WINAPI animation_var_GetIntegerValue ( IUIAnimationVariable *iface, INT32 *value)
418 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
419 FIXME( "stub (%p)->( )\n", This );
420 return E_NOTIMPL;
423 static HRESULT WINAPI animation_var_GetFinalIntegerValue ( IUIAnimationVariable *iface, INT32 *value)
425 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
426 FIXME( "stub (%p)->( )\n", This );
427 return E_NOTIMPL;
430 static HRESULT WINAPI animation_var_GetPreviousIntegerValue ( IUIAnimationVariable *iface, INT32 *value)
432 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
433 FIXME( "stub (%p)->( )\n", This );
434 return E_NOTIMPL;
437 static HRESULT WINAPI animation_var_GetCurrentStoryboard ( IUIAnimationVariable *iface, IUIAnimationStoryboard **storyboard)
439 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
440 FIXME( "stub (%p)->( )\n", This );
441 return E_NOTIMPL;
444 static HRESULT WINAPI animation_var_SetLowerBound ( IUIAnimationVariable *iface, DOUBLE bound)
446 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
447 FIXME( "stub (%p)->( )\n", This );
448 return E_NOTIMPL;
451 static HRESULT WINAPI animation_var_SetUpperBound ( IUIAnimationVariable *iface, DOUBLE bound)
453 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
454 FIXME( "stub (%p)->( )\n", This );
455 return E_NOTIMPL;
458 static HRESULT WINAPI animation_var_SetRoundingMode ( IUIAnimationVariable *iface,UI_ANIMATION_ROUNDING_MODE mode)
460 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
461 FIXME( "stub (%p)->( )\n", This );
462 return S_OK;
465 static HRESULT WINAPI animation_var_SetTag ( IUIAnimationVariable *iface, IUnknown *object, UINT32 id)
467 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
468 FIXME( "stub (%p)->( )\n", This );
469 return E_NOTIMPL;
472 static HRESULT WINAPI animation_var_GetTag ( IUIAnimationVariable *iface, IUnknown **object, UINT32 *id)
474 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
475 FIXME( "stub (%p)->( )\n", This );
476 return E_NOTIMPL;
479 static HRESULT WINAPI animation_var_SetVariableChangeHandler ( IUIAnimationVariable *iface, IUIAnimationVariableChangeHandler *handler)
481 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
482 FIXME( "stub (%p)->( )\n", This );
483 return S_OK;
486 static HRESULT WINAPI animation_var_SetVariableIntegerChangeHandler ( IUIAnimationVariable *iface,
487 IUIAnimationVariableIntegerChangeHandler *handler)
489 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
490 FIXME( "stub (%p)->( )\n", This );
491 return S_OK;
494 const struct IUIAnimationVariableVtbl animation_var_vtbl =
496 animation_var_QueryInterface,
497 animation_var_AddRef,
498 animation_var_Release,
499 animation_var_GetValue,
500 animation_var_GetFinalValue,
501 animation_var_GetPreviousValue,
502 animation_var_GetIntegerValue,
503 animation_var_GetFinalIntegerValue,
504 animation_var_GetPreviousIntegerValue,
505 animation_var_GetCurrentStoryboard,
506 animation_var_SetLowerBound,
507 animation_var_SetUpperBound,
508 animation_var_SetRoundingMode,
509 animation_var_SetTag,
510 animation_var_GetTag,
511 animation_var_SetVariableChangeHandler,
512 animation_var_SetVariableIntegerChangeHandler,
515 static HRESULT animation_var_create(DOUBLE initial, IUIAnimationVariable **obj )
517 struct animation_var *This = heap_alloc( sizeof(*This) );
519 if (!This) return E_OUTOFMEMORY;
520 This->IUIAnimationVariable_iface.lpVtbl = &animation_var_vtbl;
521 This->ref = 1;
522 This->initial = initial;
524 *obj = &This->IUIAnimationVariable_iface;
526 return S_OK;
529 /***********************************************************************
530 * IUIAnimationManager
532 struct manager
534 IUIAnimationManager IUIAnimationManager_iface;
535 LONG ref;
538 struct manager *impl_from_IUIAnimationManager( IUIAnimationManager *iface )
540 return CONTAINING_RECORD( iface, struct manager, IUIAnimationManager_iface );
543 static HRESULT WINAPI manager_QueryInterface( IUIAnimationManager *iface, REFIID iid, void **obj )
545 struct manager *This = impl_from_IUIAnimationManager( iface );
547 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
549 if (IsEqualIID( iid, &IID_IUnknown ) ||
550 IsEqualIID( iid, &IID_IUIAnimationManager ))
552 IUIAnimationManager_AddRef( iface );
553 *obj = iface;
554 return S_OK;
557 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
558 *obj = NULL;
559 return E_NOINTERFACE;
562 static ULONG WINAPI manager_AddRef( IUIAnimationManager *iface )
564 struct manager *This = impl_from_IUIAnimationManager( iface );
565 ULONG ref = InterlockedIncrement( &This->ref );
567 TRACE( "(%p) ref = %u\n", This, ref );
568 return ref;
571 static ULONG WINAPI manager_Release( IUIAnimationManager *iface )
573 struct manager *This = impl_from_IUIAnimationManager( iface );
574 ULONG ref = InterlockedDecrement(&This->ref);
576 TRACE( "(%p) ref = %u\n", This, ref );
578 if (!ref)
580 heap_free( This );
583 return ref;
586 static HRESULT WINAPI manager_CreateAnimationVariable( IUIAnimationManager *iface, DOUBLE initial_value, IUIAnimationVariable **variable )
588 struct manager *This = impl_from_IUIAnimationManager( iface );
589 TRACE( "(%p)->(%f, %p)\n", This, initial_value, variable );
590 return animation_var_create(initial_value, variable);
593 static HRESULT WINAPI manager_ScheduleTransition( IUIAnimationManager *iface, IUIAnimationVariable *variable, IUIAnimationTransition *transition, UI_ANIMATION_SECONDS current_time )
595 struct manager *This = impl_from_IUIAnimationManager( iface );
596 FIXME( "stub (%p)->(%p, %p)\n", This, variable, transition );
597 return E_NOTIMPL;
600 static HRESULT WINAPI manager_CreateStoryboard( IUIAnimationManager *iface, IUIAnimationStoryboard **storyboard )
602 struct manager *This = impl_from_IUIAnimationManager( iface );
603 TRACE( "(%p)->(%p)\n", This, storyboard );
604 return animation_storyboard_create(storyboard);
607 static HRESULT WINAPI manager_FinishAllStoryboards( IUIAnimationManager *iface, UI_ANIMATION_SECONDS max_time )
609 struct manager *This = impl_from_IUIAnimationManager( iface );
610 FIXME( "stub (%p)->(%f)\n", This, max_time );
611 return E_NOTIMPL;
614 static HRESULT WINAPI manager_AbandonAllStoryboards( IUIAnimationManager *iface )
616 struct manager *This = impl_from_IUIAnimationManager( iface );
617 FIXME( "stub (%p)->()\n", This );
618 return E_NOTIMPL;
621 static HRESULT WINAPI manager_Update( IUIAnimationManager *iface, UI_ANIMATION_SECONDS cur_time, UI_ANIMATION_UPDATE_RESULT *update_result )
623 struct manager *This = impl_from_IUIAnimationManager( iface );
624 FIXME( "stub (%p)->(%f, %p)\n", This, cur_time, update_result );
625 if (update_result)
626 *update_result = UI_ANIMATION_UPDATE_VARIABLES_CHANGED;
627 return S_OK;
630 static HRESULT WINAPI manager_GetVariableFromTag( IUIAnimationManager *iface, IUnknown *object, UINT32 id, IUIAnimationVariable **variable )
632 struct manager *This = impl_from_IUIAnimationManager( iface );
633 FIXME( "stub (%p)->(%p, %p)\n", This, object, variable );
634 return E_NOTIMPL;
637 static HRESULT WINAPI manager_GetStoryboardFromTag( IUIAnimationManager *iface, IUnknown *object, UINT32 id, IUIAnimationStoryboard **storyboard )
639 struct manager *This = impl_from_IUIAnimationManager( iface );
640 FIXME( "stub (%p)->(%p, %d, %p)\n", This, object, id, storyboard );
641 return E_NOTIMPL;
644 static HRESULT WINAPI manager_GetStatus( IUIAnimationManager *iface, UI_ANIMATION_MANAGER_STATUS *status )
646 struct manager *This = impl_from_IUIAnimationManager( iface );
647 FIXME( "stub (%p)->(%p)\n", This, status );
648 return E_NOTIMPL;
651 static HRESULT WINAPI manager_SetAnimationMode( IUIAnimationManager *iface, UI_ANIMATION_MODE mode )
653 struct manager *This = impl_from_IUIAnimationManager( iface );
654 FIXME( "stub (%p)->(%d)\n", This, mode );
655 return S_OK;
658 static HRESULT WINAPI manager_Pause( IUIAnimationManager *iface )
660 struct manager *This = impl_from_IUIAnimationManager( iface );
661 FIXME( "stub (%p)->()\n", This );
662 return E_NOTIMPL;
665 static HRESULT WINAPI manager_Resume( IUIAnimationManager *iface )
667 struct manager *This = impl_from_IUIAnimationManager( iface );
668 FIXME( "stub (%p)->()\n", This );
669 return E_NOTIMPL;
672 static HRESULT WINAPI manager_SetManagerEventHandler( IUIAnimationManager *iface, IUIAnimationManagerEventHandler *handler )
674 struct manager *This = impl_from_IUIAnimationManager( iface );
675 FIXME( "stub (%p)->(%p)\n", This, handler );
676 return S_OK;
679 static HRESULT WINAPI manager_SetCancelPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison )
681 struct manager *This = impl_from_IUIAnimationManager( iface );
682 FIXME( "stub (%p)->(%p)\n", This, comparison );
683 return E_NOTIMPL;
686 static HRESULT WINAPI manager_SetTrimPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison )
688 struct manager *This = impl_from_IUIAnimationManager( iface );
689 FIXME( "stub (%p)->(%p)\n", This, comparison );
690 return E_NOTIMPL;
693 static HRESULT WINAPI manager_SetCompressPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison)
695 struct manager *This = impl_from_IUIAnimationManager( iface );
696 FIXME( "stub (%p)->(%p)\n", This, comparison );
697 return E_NOTIMPL;
700 static HRESULT WINAPI manager_SetConcludePriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison )
702 struct manager *This = impl_from_IUIAnimationManager( iface );
703 FIXME( "stub (%p)->(%p)\n", This, comparison );
704 return E_NOTIMPL;
707 static HRESULT WINAPI manager_SetDefaultLongestAcceptableDelay( IUIAnimationManager *iface, UI_ANIMATION_SECONDS delay )
709 struct manager *This = impl_from_IUIAnimationManager( iface );
710 FIXME( "stub (%p)->(%f)\n", This, delay );
711 return E_NOTIMPL;
714 static HRESULT WINAPI manager_Shutdown( IUIAnimationManager *iface )
716 struct manager *This = impl_from_IUIAnimationManager( iface );
717 FIXME( "stub (%p)->()\n", This );
718 return E_NOTIMPL;
721 const struct IUIAnimationManagerVtbl manager_vtbl =
723 manager_QueryInterface,
724 manager_AddRef,
725 manager_Release,
726 manager_CreateAnimationVariable,
727 manager_ScheduleTransition,
728 manager_CreateStoryboard,
729 manager_FinishAllStoryboards,
730 manager_AbandonAllStoryboards,
731 manager_Update,
732 manager_GetVariableFromTag,
733 manager_GetStoryboardFromTag,
734 manager_GetStatus,
735 manager_SetAnimationMode,
736 manager_Pause,
737 manager_Resume,
738 manager_SetManagerEventHandler,
739 manager_SetCancelPriorityComparison,
740 manager_SetTrimPriorityComparison,
741 manager_SetCompressPriorityComparison,
742 manager_SetConcludePriorityComparison,
743 manager_SetDefaultLongestAcceptableDelay,
744 manager_Shutdown
747 static HRESULT manager_create( IUnknown *outer, REFIID iid, void **obj )
749 struct manager *This = heap_alloc( sizeof(*This) );
750 HRESULT hr;
752 if (!This) return E_OUTOFMEMORY;
753 This->IUIAnimationManager_iface.lpVtbl = &manager_vtbl;
754 This->ref = 1;
756 hr = IUIAnimationManager_QueryInterface( &This->IUIAnimationManager_iface, iid, obj );
758 IUIAnimationManager_Release( &This->IUIAnimationManager_iface );
759 return hr;
762 /***********************************************************************
763 * IUIAnimationTimer
765 struct timer
767 IUIAnimationTimer IUIAnimationTimer_iface;
768 LONG ref;
771 struct timer *impl_from_IUIAnimationTimer( IUIAnimationTimer *iface )
773 return CONTAINING_RECORD( iface, struct timer, IUIAnimationTimer_iface );
776 static HRESULT WINAPI timer_QueryInterface( IUIAnimationTimer *iface, REFIID iid, void **obj )
778 struct timer *This = impl_from_IUIAnimationTimer( iface );
780 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
782 if (IsEqualIID( iid, &IID_IUnknown ) ||
783 IsEqualIID( iid, &IID_IUIAnimationTimer ))
785 IUIAnimationTimer_AddRef( iface );
786 *obj = iface;
787 return S_OK;
790 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
791 *obj = NULL;
792 return E_NOINTERFACE;
795 static ULONG WINAPI timer_AddRef( IUIAnimationTimer *iface )
797 struct timer *This = impl_from_IUIAnimationTimer( iface );
798 ULONG ref = InterlockedIncrement( &This->ref );
800 TRACE( "(%p) ref = %u\n", This, ref );
801 return ref;
804 static ULONG WINAPI timer_Release( IUIAnimationTimer *iface )
806 struct timer *This = impl_from_IUIAnimationTimer( iface );
807 ULONG ref = InterlockedDecrement(&This->ref);
809 TRACE( "(%p) ref = %u\n", This, ref );
811 if (!ref)
812 heap_free( This );
814 return ref;
817 static HRESULT WINAPI timer_SetTimerUpdateHandler (IUIAnimationTimer *iface,
818 IUIAnimationTimerUpdateHandler *update_handler,
819 UI_ANIMATION_IDLE_BEHAVIOR idle_behaviour)
821 struct timer *This = impl_from_IUIAnimationTimer( iface );
822 FIXME( "stub (%p)->(%p, %d)\n", This, update_handler, idle_behaviour );
823 return E_NOTIMPL;
826 static HRESULT WINAPI timer_SetTimerEventHandler (IUIAnimationTimer *iface,
827 IUIAnimationTimerEventHandler *handler)
829 struct timer *This = impl_from_IUIAnimationTimer( iface );
830 FIXME( "stub (%p)->()\n", This );
831 return S_OK;
834 static HRESULT WINAPI timer_Enable (IUIAnimationTimer *iface)
836 struct timer *This = impl_from_IUIAnimationTimer( iface );
837 FIXME( "stub (%p)->()\n", This );
838 return S_OK;
841 static HRESULT WINAPI timer_Disable (IUIAnimationTimer *iface)
843 struct timer *This = impl_from_IUIAnimationTimer( iface );
844 FIXME( "stub (%p)->()\n", This );
845 return E_NOTIMPL;
848 static HRESULT WINAPI timer_IsEnabled (IUIAnimationTimer *iface)
850 struct timer *This = impl_from_IUIAnimationTimer( iface );
851 FIXME( "stub (%p)->()\n", This );
852 return E_NOTIMPL;
855 static HRESULT WINAPI timer_GetTime (IUIAnimationTimer *iface, UI_ANIMATION_SECONDS *seconds)
857 struct timer *This = impl_from_IUIAnimationTimer( iface );
858 FIXME( "stub (%p)->(%p)\n", This, seconds );
859 return S_OK;
862 static HRESULT WINAPI timer_SetFrameRateThreshold (IUIAnimationTimer *iface, UINT32 frames_per_sec)
864 struct timer *This = impl_from_IUIAnimationTimer( iface );
865 FIXME( "stub (%p)->(%d)\n", This, frames_per_sec );
866 return E_NOTIMPL;
869 const struct IUIAnimationTimerVtbl timer_vtbl =
871 timer_QueryInterface,
872 timer_AddRef,
873 timer_Release,
874 timer_SetTimerUpdateHandler,
875 timer_SetTimerEventHandler,
876 timer_Enable,
877 timer_Disable,
878 timer_IsEnabled,
879 timer_GetTime,
880 timer_SetFrameRateThreshold,
883 static HRESULT timer_create( IUnknown *outer, REFIID iid, void **obj )
885 struct timer *This = heap_alloc( sizeof(*This) );
886 HRESULT hr;
888 if (!This)
889 return E_OUTOFMEMORY;
890 This->IUIAnimationTimer_iface.lpVtbl = &timer_vtbl;
891 This->ref = 1;
893 hr = IUIAnimationTimer_QueryInterface( &This->IUIAnimationTimer_iface, iid, obj );
895 IUIAnimationTimer_Release( &This->IUIAnimationTimer_iface );
896 return hr;
899 /***********************************************************************
900 * IUIAnimationTransitionFactory
902 struct tr_factory
904 IUIAnimationTransitionFactory IUIAnimationTransitionFactory_iface;
905 LONG ref;
908 struct tr_factory *impl_from_IUIAnimationTransitionFactory( IUIAnimationTransitionFactory *iface )
910 return CONTAINING_RECORD( iface, struct tr_factory, IUIAnimationTransitionFactory_iface );
913 static HRESULT WINAPI tr_factory_QueryInterface( IUIAnimationTransitionFactory *iface, REFIID iid, void **obj )
915 struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface );
917 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
919 if (IsEqualIID( iid, &IID_IUnknown ) ||
920 IsEqualIID( iid, &IID_IUIAnimationTransitionFactory ))
922 IUIAnimationTransitionFactory_AddRef( iface );
923 *obj = iface;
924 return S_OK;
927 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
928 *obj = NULL;
929 return E_NOINTERFACE;
932 static ULONG WINAPI tr_factory_AddRef( IUIAnimationTransitionFactory *iface )
934 struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface );
935 ULONG ref = InterlockedIncrement( &This->ref );
937 TRACE( "(%p) ref = %u\n", This, ref );
938 return ref;
941 static ULONG WINAPI tr_factory_Release( IUIAnimationTransitionFactory *iface )
943 struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface );
944 ULONG ref = InterlockedDecrement(&This->ref);
946 TRACE( "(%p) ref = %u\n", This, ref );
948 if (!ref)
949 heap_free( This );
951 return ref;
954 static HRESULT WINAPI tr_factory_CreateTransition(IUIAnimationTransitionFactory *iface,
955 IUIAnimationInterpolator *interpolator, IUIAnimationTransition **transition)
957 struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface );
958 FIXME( "stub (%p)->(%p, %p)\n", This, interpolator, transition );
959 return E_NOTIMPL;
962 const struct IUIAnimationTransitionFactoryVtbl tr_factory_vtbl =
964 tr_factory_QueryInterface,
965 tr_factory_AddRef,
966 tr_factory_Release,
967 tr_factory_CreateTransition
970 static HRESULT transition_create( IUnknown *outer, REFIID iid, void **obj )
972 struct tr_factory *This = heap_alloc( sizeof(*This) );
973 HRESULT hr;
975 if (!This) return E_OUTOFMEMORY;
976 This->IUIAnimationTransitionFactory_iface.lpVtbl = &tr_factory_vtbl;
977 This->ref = 1;
979 hr = IUIAnimationTransitionFactory_QueryInterface( &This->IUIAnimationTransitionFactory_iface, iid, obj );
981 IUIAnimationTransitionFactory_Release( &This->IUIAnimationTransitionFactory_iface );
982 return hr;
985 /***********************************************************************
986 * IUITransitionLibrary
988 struct tr_library
990 IUIAnimationTransitionLibrary IUIAnimationTransitionLibrary_iface;
991 LONG ref;
994 struct tr_library *impl_from_IUIAnimationTransitionLibrary( IUIAnimationTransitionLibrary *iface )
996 return CONTAINING_RECORD( iface, struct tr_library, IUIAnimationTransitionLibrary_iface );
999 static HRESULT WINAPI tr_library_QueryInterface( IUIAnimationTransitionLibrary *iface,
1000 REFIID iid, void **obj )
1002 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1004 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
1006 if (IsEqualIID( iid, &IID_IUnknown ) ||
1007 IsEqualIID( iid, &IID_IUIAnimationTransitionLibrary ))
1009 IUIAnimationTransitionLibrary_AddRef( iface );
1010 *obj = iface;
1011 return S_OK;
1014 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
1015 *obj = NULL;
1016 return E_NOINTERFACE;
1019 static ULONG WINAPI tr_library_AddRef( IUIAnimationTransitionLibrary *iface )
1021 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1022 ULONG ref = InterlockedIncrement( &This->ref );
1024 TRACE( "(%p) ref = %u\n", This, ref );
1025 return ref;
1028 static ULONG WINAPI tr_library_Release( IUIAnimationTransitionLibrary *iface )
1030 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1031 ULONG ref = InterlockedDecrement(&This->ref);
1033 TRACE( "(%p) ref = %u\n", This, ref );
1035 if (!ref)
1036 heap_free( This );
1038 return ref;
1041 static HRESULT WINAPI tr_library_CreateInstantaneousTransition(IUIAnimationTransitionLibrary *iface,
1042 double finalValue, IUIAnimationTransition **transition)
1044 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1045 FIXME( "stub (%p)->(%f, %p)\n", This, finalValue, transition );
1046 return E_NOTIMPL;
1049 static HRESULT WINAPI tr_library_CreateConstantTransition(IUIAnimationTransitionLibrary *iface,
1050 double duration, IUIAnimationTransition **transition)
1052 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1053 FIXME( "stub (%p)->(%f, %p)\n", This, duration, transition );
1054 return E_NOTIMPL;
1057 static HRESULT WINAPI tr_library_CreateDiscreteTransition(IUIAnimationTransitionLibrary *iface,
1058 double delay, double finalValue, double hold, IUIAnimationTransition **transition)
1060 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1061 FIXME( "stub (%p)->( )\n", This );
1062 return E_NOTIMPL;
1065 static HRESULT WINAPI tr_library_CreateLinearTransition(IUIAnimationTransitionLibrary *iface,
1066 double duration, double finalValue, IUIAnimationTransition **transition)
1068 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1069 FIXME( "stub (%p)->(%f, %f, %p)\n", This, duration, finalValue, transition );
1070 return E_NOTIMPL;
1073 static HRESULT WINAPI tr_library_CreateLinearTransitionFromSpeed(IUIAnimationTransitionLibrary *iface,
1074 double speed, double finalValue, IUIAnimationTransition **transition)
1076 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1077 FIXME( "stub (%p)->(%f, %f, %p)\n", This, speed, finalValue, transition );
1078 return E_NOTIMPL;
1081 static HRESULT WINAPI tr_library_CreateSinusoidalTransitionFromVelocity(IUIAnimationTransitionLibrary *iface,
1082 double duration, double period, IUIAnimationTransition **transition)
1084 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1085 FIXME( "stub (%p)->(%f, %f, %p)\n", This, duration, period, transition );
1086 return E_NOTIMPL;
1089 static HRESULT WINAPI tr_library_CreateSinusoidalTransitionFromRange(IUIAnimationTransitionLibrary *iface,
1090 double duration, double minimumValue, double maximumValue, double period,
1091 UI_ANIMATION_SLOPE slope, IUIAnimationTransition **transition)
1093 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1094 FIXME( "stub (%p)->(%f, %f, %f, %f, %d, %p)\n", This, duration, minimumValue, maximumValue, period, slope, transition );
1095 return E_NOTIMPL;
1098 static HRESULT WINAPI tr_library_CreateAccelerateDecelerateTransition(IUIAnimationTransitionLibrary *iface,
1099 double duration, double finalValue, double accelerationRatio, double decelerationRatio,
1100 IUIAnimationTransition **transition)
1102 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1103 FIXME( "stub (%p)->(%f, %f, %f, %f, %p)\n", This, duration, finalValue, accelerationRatio, decelerationRatio, transition );
1104 return E_NOTIMPL;
1107 static HRESULT WINAPI tr_library_CreateReversalTransition(IUIAnimationTransitionLibrary *iface, double duration,
1108 IUIAnimationTransition **transition)
1110 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1111 FIXME( "stub (%p)->(%f, %p)\n", This, duration, transition );
1112 return E_NOTIMPL;
1115 static HRESULT WINAPI tr_library_CreateCubicTransition(IUIAnimationTransitionLibrary *iface, double duration,
1116 double finalValue, double finalVelocity, IUIAnimationTransition **transition)
1118 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1119 FIXME( "stub (%p)->(%f, %f, %f, %p)\n", This, duration, finalValue, finalVelocity, transition );
1120 return E_NOTIMPL;
1123 static HRESULT WINAPI tr_library_CreateSmoothStopTransition(IUIAnimationTransitionLibrary *iface,
1124 double maximumDuration, double finalValue, IUIAnimationTransition **transition)
1126 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1127 FIXME( "stub (%p)->(%f, %f, %p)\n", This, maximumDuration, finalValue, transition );
1128 return E_NOTIMPL;
1131 static HRESULT WINAPI tr_library_CreateParabolicTransitionFromAcceleration(IUIAnimationTransitionLibrary *iface,
1132 double finalValue, double finalVelocity, double acceleration, IUIAnimationTransition **transition)
1134 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1135 FIXME( "stub (%p)->( )\n", This );
1136 return E_NOTIMPL;
1139 const struct IUIAnimationTransitionLibraryVtbl tr_library_vtbl =
1141 tr_library_QueryInterface,
1142 tr_library_AddRef,
1143 tr_library_Release,
1144 tr_library_CreateInstantaneousTransition,
1145 tr_library_CreateConstantTransition,
1146 tr_library_CreateDiscreteTransition,
1147 tr_library_CreateLinearTransition,
1148 tr_library_CreateLinearTransitionFromSpeed,
1149 tr_library_CreateSinusoidalTransitionFromVelocity,
1150 tr_library_CreateSinusoidalTransitionFromRange,
1151 tr_library_CreateAccelerateDecelerateTransition,
1152 tr_library_CreateReversalTransition,
1153 tr_library_CreateCubicTransition,
1154 tr_library_CreateSmoothStopTransition,
1155 tr_library_CreateParabolicTransitionFromAcceleration,
1158 static HRESULT library_create( IUnknown *outer, REFIID iid, void **obj )
1160 struct tr_library *This = heap_alloc( sizeof(*This) );
1161 HRESULT hr;
1163 if (!This) return E_OUTOFMEMORY;
1164 This->IUIAnimationTransitionLibrary_iface.lpVtbl = &tr_library_vtbl;
1165 This->ref = 1;
1167 hr = IUIAnimationTransitionLibrary_QueryInterface( &This->IUIAnimationTransitionLibrary_iface, iid, obj );
1169 IUIAnimationTransitionLibrary_Release( &This->IUIAnimationTransitionLibrary_iface );
1170 return hr;
1173 static struct class_factory manager_cf = { { &class_factory_vtbl }, manager_create };
1174 static struct class_factory timer_cf = { { &class_factory_vtbl }, timer_create };
1175 static struct class_factory transition_cf = { { &class_factory_vtbl }, transition_create };
1176 static struct class_factory library_cf = { { &class_factory_vtbl }, library_create };
1178 /******************************************************************
1179 * DllGetClassObject
1181 HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **obj )
1183 IClassFactory *cf = NULL;
1185 TRACE( "(%s %s %p)\n", debugstr_guid( clsid ), debugstr_guid( iid ), obj );
1187 if (IsEqualCLSID( clsid, &CLSID_UIAnimationManager ))
1188 cf = &manager_cf.IClassFactory_iface;
1189 else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTimer ))
1190 cf = &timer_cf.IClassFactory_iface;
1191 else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTransitionFactory ))
1192 cf = &transition_cf.IClassFactory_iface;
1193 else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTransitionLibrary ))
1194 cf = &library_cf.IClassFactory_iface;
1196 if (!cf)
1197 return CLASS_E_CLASSNOTAVAILABLE;
1199 return IClassFactory_QueryInterface( cf, iid, obj );
1202 /******************************************************************
1203 * DllCanUnloadNow
1205 HRESULT WINAPI DllCanUnloadNow( void )
1207 TRACE( "()\n" );
1208 return S_FALSE;
1211 /***********************************************************************
1212 * DllRegisterServer
1214 HRESULT WINAPI DllRegisterServer( void )
1216 return __wine_register_resources( hinstance );
1219 /***********************************************************************
1220 * DllUnregisterServer
1222 HRESULT WINAPI DllUnregisterServer( void )
1224 return __wine_unregister_resources( hinstance );