jscript: Store the necessary function and variable info in the TypeInfo.
[wine.git] / dlls / uianimation / main.c
blobc0c7367e092a907cf3894131f72a1943c445f98f
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_WINE_PREATTACH:
48 return FALSE; /* prefer native version */
49 case DLL_PROCESS_ATTACH:
50 hinstance = dll;
51 DisableThreadLibraryCalls( dll );
52 break;
54 return TRUE;
57 struct class_factory
59 IClassFactory IClassFactory_iface;
60 HRESULT (*create_instance)(IUnknown *, REFIID, void **);
63 static inline struct class_factory *impl_from_IClassFactory( IClassFactory *iface )
65 return CONTAINING_RECORD( iface, struct class_factory, IClassFactory_iface );
68 static HRESULT WINAPI class_factory_QueryInterface( IClassFactory *iface, REFIID iid, void **obj )
70 if (IsEqualIID( iid, &IID_IUnknown ) ||
71 IsEqualIID( iid, &IID_IClassFactory ))
73 IClassFactory_AddRef( iface );
74 *obj = iface;
75 return S_OK;
78 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
79 *obj = NULL;
80 return E_NOINTERFACE;
83 static ULONG WINAPI class_factory_AddRef( IClassFactory *iface )
85 return 2;
88 static ULONG WINAPI class_factory_Release( IClassFactory *iface )
90 return 1;
93 static HRESULT WINAPI class_factory_CreateInstance( IClassFactory *iface,
94 IUnknown *outer, REFIID iid,
95 void **obj )
97 struct class_factory *This = impl_from_IClassFactory( iface );
99 TRACE( "%p %s %p\n", outer, debugstr_guid( iid ), obj );
101 *obj = NULL;
102 return This->create_instance( outer, iid, obj );
105 static HRESULT WINAPI class_factory_LockServer( IClassFactory *iface,
106 BOOL lock )
108 FIXME( "%d: stub!\n", lock );
109 return S_OK;
112 static const struct IClassFactoryVtbl class_factory_vtbl =
114 class_factory_QueryInterface,
115 class_factory_AddRef,
116 class_factory_Release,
117 class_factory_CreateInstance,
118 class_factory_LockServer
121 /***********************************************************************
122 * IUIAnimationStoryboard
124 struct animation_storyboard
126 IUIAnimationStoryboard IUIAnimationStoryboard_iface;
127 LONG ref;
130 struct animation_storyboard *impl_from_IUIAnimationStoryboard( IUIAnimationStoryboard *iface )
132 return CONTAINING_RECORD( iface, struct animation_storyboard, IUIAnimationStoryboard_iface );
135 static HRESULT WINAPI animation_storyboard_QueryInterface( IUIAnimationStoryboard *iface,
136 REFIID iid, void **obj )
138 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
140 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
142 if (IsEqualIID( iid, &IID_IUnknown ) ||
143 IsEqualIID( iid, &IID_IUIAnimationStoryboard ))
145 IUIAnimationStoryboard_AddRef( iface );
146 *obj = iface;
147 return S_OK;
150 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
151 *obj = NULL;
152 return E_NOINTERFACE;
155 static ULONG WINAPI animation_storyboard_AddRef( IUIAnimationStoryboard *iface )
157 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
158 ULONG ref = InterlockedIncrement( &This->ref );
160 TRACE( "(%p) ref = %u\n", This, ref );
161 return ref;
164 static ULONG WINAPI animation_storyboard_Release( IUIAnimationStoryboard *iface )
166 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
167 ULONG ref = InterlockedDecrement(&This->ref);
169 TRACE( "(%p) ref = %u\n", This, ref );
171 if (!ref)
172 heap_free( This );
174 return ref;
177 static HRESULT WINAPI animation_storyboard_AddTransition (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable,
178 IUIAnimationTransition *transition)
180 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
181 FIXME( "stub (%p)->( )\n", This );
182 return S_OK;
185 static HRESULT WINAPI animation_storyboard_AddKeyframeAtOffset (IUIAnimationStoryboard *iface, UI_ANIMATION_KEYFRAME existingframe,
186 UI_ANIMATION_SECONDS offset, UI_ANIMATION_KEYFRAME *keyframe)
188 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
189 FIXME( "stub (%p)->( )\n", This );
190 return E_NOTIMPL;
193 static HRESULT WINAPI animation_storyboard_AddKeyframeAfterTransition (IUIAnimationStoryboard *iface,IUIAnimationTransition *transition,
194 UI_ANIMATION_KEYFRAME *keyframe)
196 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
197 FIXME( "stub (%p)->( )\n", This );
198 return S_OK;
201 static HRESULT WINAPI animation_storyboard_AddTransitionAtKeyframe (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable,
202 IUIAnimationTransition *transition, UI_ANIMATION_KEYFRAME start_key)
204 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
205 FIXME( "stub (%p)->( )\n", This );
206 return E_NOTIMPL;
209 static HRESULT WINAPI animation_storyboard_AddTransitionBetweenKeyframes (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable,
210 IUIAnimationTransition *transition, UI_ANIMATION_KEYFRAME start_key, UI_ANIMATION_KEYFRAME end_key)
212 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
213 FIXME( "stub (%p)->( )\n", This );
214 return E_NOTIMPL;
217 static HRESULT WINAPI animation_storyboard_RepeatBetweenKeyframes (IUIAnimationStoryboard *iface, UI_ANIMATION_KEYFRAME start_key,
218 UI_ANIMATION_KEYFRAME end_key, INT32 count)
220 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
221 FIXME( "stub (%p)->( )\n", This );
222 return S_OK;
225 static HRESULT WINAPI animation_storyboard_HoldVariable (IUIAnimationStoryboard *iface, IUIAnimationVariable *variable)
227 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
228 FIXME( "stub (%p)->( )\n", This );
229 return E_NOTIMPL;
232 static HRESULT WINAPI animation_storyboard_SetLongestAcceptableDelay (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS delay)
234 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
235 FIXME( "stub (%p)->( )\n", This );
236 return E_NOTIMPL;
239 static HRESULT WINAPI animation_storyboard_Schedule (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS now,
240 UI_ANIMATION_SCHEDULING_RESULT *result)
242 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
243 FIXME( "stub (%p)->( )\n", This );
244 return 0;
247 static HRESULT WINAPI animation_storyboard_Conclude (IUIAnimationStoryboard *iface)
249 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
250 FIXME( "stub (%p)->( )\n", This );
251 return E_NOTIMPL;
254 static HRESULT WINAPI animation_storyboard_Finish (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS deadline)
256 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
257 FIXME( "stub (%p)->( )\n", This );
258 return E_NOTIMPL;
261 static HRESULT WINAPI animation_storyboard_Abandon (IUIAnimationStoryboard *iface)
263 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
264 FIXME( "stub (%p)->( )\n", This );
265 return E_NOTIMPL;
268 static HRESULT WINAPI animation_storyboard_SetTag(IUIAnimationStoryboard *iface, IUnknown *object, UINT32 id)
270 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
271 FIXME( "stub (%p)->( )\n", This );
272 return E_NOTIMPL;
275 static HRESULT WINAPI animation_storyboard_GetTag (IUIAnimationStoryboard *iface, IUnknown **object, UINT32 *id)
277 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
278 FIXME( "stub (%p)->( )\n", This );
279 return E_NOTIMPL;
282 static HRESULT WINAPI animation_storyboard_GetStatus (IUIAnimationStoryboard *iface, UI_ANIMATION_STORYBOARD_STATUS *status)
284 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
285 FIXME( "stub (%p)->( )\n", This );
286 return E_NOTIMPL;
289 static HRESULT WINAPI animation_storyboard_GetElapsedTime (IUIAnimationStoryboard *iface, UI_ANIMATION_SECONDS *elapsed)
291 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
292 FIXME( "stub (%p)->( )\n", This );
293 return E_NOTIMPL;
296 static HRESULT WINAPI animation_storyboard_SetStoryboardEventHandler (IUIAnimationStoryboard *iface, IUIAnimationStoryboardEventHandler *handler)
298 struct animation_storyboard *This = impl_from_IUIAnimationStoryboard( iface );
299 FIXME( "stub (%p)->( )\n", This );
300 return S_OK;
303 const struct IUIAnimationStoryboardVtbl animation_storyboard_vtbl =
305 animation_storyboard_QueryInterface,
306 animation_storyboard_AddRef,
307 animation_storyboard_Release,
308 animation_storyboard_AddTransition,
309 animation_storyboard_AddKeyframeAtOffset,
310 animation_storyboard_AddKeyframeAfterTransition,
311 animation_storyboard_AddTransitionAtKeyframe,
312 animation_storyboard_AddTransitionBetweenKeyframes,
313 animation_storyboard_RepeatBetweenKeyframes,
314 animation_storyboard_HoldVariable,
315 animation_storyboard_SetLongestAcceptableDelay,
316 animation_storyboard_Schedule ,
317 animation_storyboard_Conclude ,
318 animation_storyboard_Finish ,
319 animation_storyboard_Abandon,
320 animation_storyboard_SetTag,
321 animation_storyboard_GetTag ,
322 animation_storyboard_GetStatus ,
323 animation_storyboard_GetElapsedTime,
324 animation_storyboard_SetStoryboardEventHandler
327 static HRESULT animation_storyboard_create( IUIAnimationStoryboard **obj )
329 struct animation_storyboard *This = heap_alloc( sizeof(*This) );
331 if (!This) return E_OUTOFMEMORY;
332 This->IUIAnimationStoryboard_iface.lpVtbl = &animation_storyboard_vtbl;
333 This->ref = 1;
335 *obj = &This->IUIAnimationStoryboard_iface;
337 return S_OK;
340 /***********************************************************************
341 * IUIAnimationVariable
343 struct animation_var
345 IUIAnimationVariable IUIAnimationVariable_iface;
346 LONG ref;
347 DOUBLE initial;
350 struct animation_var *impl_from_IUIAnimationVariable( IUIAnimationVariable *iface )
352 return CONTAINING_RECORD( iface, struct animation_var, IUIAnimationVariable_iface );
355 static HRESULT WINAPI animation_var_QueryInterface( IUIAnimationVariable *iface,
356 REFIID iid, void **obj )
358 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
360 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
362 if (IsEqualIID( iid, &IID_IUnknown ) ||
363 IsEqualIID( iid, &IID_IUIAnimationVariable ))
365 IUIAnimationVariable_AddRef( iface );
366 *obj = iface;
367 return S_OK;
370 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
371 *obj = NULL;
372 return E_NOINTERFACE;
375 static ULONG WINAPI animation_var_AddRef( IUIAnimationVariable *iface )
377 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
378 ULONG ref = InterlockedIncrement( &This->ref );
380 TRACE( "(%p) ref = %u\n", This, ref );
381 return ref;
384 static ULONG WINAPI animation_var_Release( IUIAnimationVariable *iface )
386 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
387 ULONG ref = InterlockedDecrement(&This->ref);
389 TRACE( "(%p) ref = %u\n", This, ref );
391 if (!ref)
392 heap_free( This );
394 return ref;
397 static HRESULT WINAPI animation_var_GetValue ( IUIAnimationVariable *iface, DOUBLE *value)
399 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
400 FIXME( "stub (%p)->( )\n", This);
401 return E_NOTIMPL;
404 static HRESULT WINAPI animation_var_GetFinalValue ( IUIAnimationVariable *iface, DOUBLE *value)
406 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
407 FIXME( "stub (%p)->( )\n", This );
408 return E_NOTIMPL;
411 static HRESULT WINAPI animation_var_GetPreviousValue ( IUIAnimationVariable *iface, DOUBLE *value)
413 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
414 FIXME( "stub (%p)->( )\n", This );
415 return E_NOTIMPL;
418 static HRESULT WINAPI animation_var_GetIntegerValue ( IUIAnimationVariable *iface, INT32 *value)
420 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
421 FIXME( "stub (%p)->( )\n", This );
422 return E_NOTIMPL;
425 static HRESULT WINAPI animation_var_GetFinalIntegerValue ( IUIAnimationVariable *iface, INT32 *value)
427 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
428 FIXME( "stub (%p)->( )\n", This );
429 return E_NOTIMPL;
432 static HRESULT WINAPI animation_var_GetPreviousIntegerValue ( IUIAnimationVariable *iface, INT32 *value)
434 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
435 FIXME( "stub (%p)->( )\n", This );
436 return E_NOTIMPL;
439 static HRESULT WINAPI animation_var_GetCurrentStoryboard ( IUIAnimationVariable *iface, IUIAnimationStoryboard **storyboard)
441 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
442 FIXME( "stub (%p)->( )\n", This );
443 return E_NOTIMPL;
446 static HRESULT WINAPI animation_var_SetLowerBound ( IUIAnimationVariable *iface, DOUBLE bound)
448 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
449 FIXME( "stub (%p)->( )\n", This );
450 return E_NOTIMPL;
453 static HRESULT WINAPI animation_var_SetUpperBound ( IUIAnimationVariable *iface, DOUBLE bound)
455 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
456 FIXME( "stub (%p)->( )\n", This );
457 return E_NOTIMPL;
460 static HRESULT WINAPI animation_var_SetRoundingMode ( IUIAnimationVariable *iface,UI_ANIMATION_ROUNDING_MODE mode)
462 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
463 FIXME( "stub (%p)->( )\n", This );
464 return S_OK;
467 static HRESULT WINAPI animation_var_SetTag ( IUIAnimationVariable *iface, IUnknown *object, UINT32 id)
469 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
470 FIXME( "stub (%p)->( )\n", This );
471 return E_NOTIMPL;
474 static HRESULT WINAPI animation_var_GetTag ( IUIAnimationVariable *iface, IUnknown **object, UINT32 *id)
476 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
477 FIXME( "stub (%p)->( )\n", This );
478 return E_NOTIMPL;
481 static HRESULT WINAPI animation_var_SetVariableChangeHandler ( IUIAnimationVariable *iface, IUIAnimationVariableChangeHandler *handler)
483 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
484 FIXME( "stub (%p)->( )\n", This );
485 return S_OK;
488 static HRESULT WINAPI animation_var_SetVariableIntegerChangeHandler ( IUIAnimationVariable *iface,
489 IUIAnimationVariableIntegerChangeHandler *handler)
491 struct animation_var *This = impl_from_IUIAnimationVariable( iface );
492 FIXME( "stub (%p)->( )\n", This );
493 return S_OK;
496 const struct IUIAnimationVariableVtbl animation_var_vtbl =
498 animation_var_QueryInterface,
499 animation_var_AddRef,
500 animation_var_Release,
501 animation_var_GetValue,
502 animation_var_GetFinalValue,
503 animation_var_GetPreviousValue,
504 animation_var_GetIntegerValue,
505 animation_var_GetFinalIntegerValue,
506 animation_var_GetPreviousIntegerValue,
507 animation_var_GetCurrentStoryboard,
508 animation_var_SetLowerBound,
509 animation_var_SetUpperBound,
510 animation_var_SetRoundingMode,
511 animation_var_SetTag,
512 animation_var_GetTag,
513 animation_var_SetVariableChangeHandler,
514 animation_var_SetVariableIntegerChangeHandler,
517 static HRESULT animation_var_create(DOUBLE initial, IUIAnimationVariable **obj )
519 struct animation_var *This = heap_alloc( sizeof(*This) );
521 if (!This) return E_OUTOFMEMORY;
522 This->IUIAnimationVariable_iface.lpVtbl = &animation_var_vtbl;
523 This->ref = 1;
524 This->initial = initial;
526 *obj = &This->IUIAnimationVariable_iface;
528 return S_OK;
531 /***********************************************************************
532 * IUIAnimationManager
534 struct manager
536 IUIAnimationManager IUIAnimationManager_iface;
537 LONG ref;
540 struct manager *impl_from_IUIAnimationManager( IUIAnimationManager *iface )
542 return CONTAINING_RECORD( iface, struct manager, IUIAnimationManager_iface );
545 static HRESULT WINAPI manager_QueryInterface( IUIAnimationManager *iface, REFIID iid, void **obj )
547 struct manager *This = impl_from_IUIAnimationManager( iface );
549 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
551 if (IsEqualIID( iid, &IID_IUnknown ) ||
552 IsEqualIID( iid, &IID_IUIAnimationManager ))
554 IUIAnimationManager_AddRef( iface );
555 *obj = iface;
556 return S_OK;
559 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
560 *obj = NULL;
561 return E_NOINTERFACE;
564 static ULONG WINAPI manager_AddRef( IUIAnimationManager *iface )
566 struct manager *This = impl_from_IUIAnimationManager( iface );
567 ULONG ref = InterlockedIncrement( &This->ref );
569 TRACE( "(%p) ref = %u\n", This, ref );
570 return ref;
573 static ULONG WINAPI manager_Release( IUIAnimationManager *iface )
575 struct manager *This = impl_from_IUIAnimationManager( iface );
576 ULONG ref = InterlockedDecrement(&This->ref);
578 TRACE( "(%p) ref = %u\n", This, ref );
580 if (!ref)
582 heap_free( This );
585 return ref;
588 static HRESULT WINAPI manager_CreateAnimationVariable( IUIAnimationManager *iface, DOUBLE initial_value, IUIAnimationVariable **variable )
590 struct manager *This = impl_from_IUIAnimationManager( iface );
591 TRACE( "(%p)->(%f, %p)\n", This, initial_value, variable );
592 return animation_var_create(initial_value, variable);
595 static HRESULT WINAPI manager_ScheduleTransition( IUIAnimationManager *iface, IUIAnimationVariable *variable, IUIAnimationTransition *transition, UI_ANIMATION_SECONDS current_time )
597 struct manager *This = impl_from_IUIAnimationManager( iface );
598 FIXME( "stub (%p)->(%p, %p)\n", This, variable, transition );
599 return E_NOTIMPL;
602 static HRESULT WINAPI manager_CreateStoryboard( IUIAnimationManager *iface, IUIAnimationStoryboard **storyboard )
604 struct manager *This = impl_from_IUIAnimationManager( iface );
605 TRACE( "(%p)->(%p)\n", This, storyboard );
606 return animation_storyboard_create(storyboard);
609 static HRESULT WINAPI manager_FinishAllStoryboards( IUIAnimationManager *iface, UI_ANIMATION_SECONDS max_time )
611 struct manager *This = impl_from_IUIAnimationManager( iface );
612 FIXME( "stub (%p)->(%f)\n", This, max_time );
613 return E_NOTIMPL;
616 static HRESULT WINAPI manager_AbandonAllStoryboards( IUIAnimationManager *iface )
618 struct manager *This = impl_from_IUIAnimationManager( iface );
619 FIXME( "stub (%p)->()\n", This );
620 return E_NOTIMPL;
623 static HRESULT WINAPI manager_Update( IUIAnimationManager *iface, UI_ANIMATION_SECONDS cur_time, UI_ANIMATION_UPDATE_RESULT *update_result )
625 struct manager *This = impl_from_IUIAnimationManager( iface );
626 FIXME( "stub (%p)->(%f, %p)\n", This, cur_time, update_result );
627 if (update_result)
628 *update_result = UI_ANIMATION_UPDATE_VARIABLES_CHANGED;
629 return S_OK;
632 static HRESULT WINAPI manager_GetVariableFromTag( IUIAnimationManager *iface, IUnknown *object, UINT32 id, IUIAnimationVariable **variable )
634 struct manager *This = impl_from_IUIAnimationManager( iface );
635 FIXME( "stub (%p)->(%p, %p)\n", This, object, variable );
636 return E_NOTIMPL;
639 static HRESULT WINAPI manager_GetStoryboardFromTag( IUIAnimationManager *iface, IUnknown *object, UINT32 id, IUIAnimationStoryboard **storyboard )
641 struct manager *This = impl_from_IUIAnimationManager( iface );
642 FIXME( "stub (%p)->(%p, %d, %p)\n", This, object, id, storyboard );
643 return E_NOTIMPL;
646 static HRESULT WINAPI manager_GetStatus( IUIAnimationManager *iface, UI_ANIMATION_MANAGER_STATUS *status )
648 struct manager *This = impl_from_IUIAnimationManager( iface );
649 FIXME( "stub (%p)->(%p)\n", This, status );
650 return E_NOTIMPL;
653 static HRESULT WINAPI manager_SetAnimationMode( IUIAnimationManager *iface, UI_ANIMATION_MODE mode )
655 struct manager *This = impl_from_IUIAnimationManager( iface );
656 FIXME( "stub (%p)->(%d)\n", This, mode );
657 return S_OK;
660 static HRESULT WINAPI manager_Pause( IUIAnimationManager *iface )
662 struct manager *This = impl_from_IUIAnimationManager( iface );
663 FIXME( "stub (%p)->()\n", This );
664 return E_NOTIMPL;
667 static HRESULT WINAPI manager_Resume( IUIAnimationManager *iface )
669 struct manager *This = impl_from_IUIAnimationManager( iface );
670 FIXME( "stub (%p)->()\n", This );
671 return E_NOTIMPL;
674 static HRESULT WINAPI manager_SetManagerEventHandler( IUIAnimationManager *iface, IUIAnimationManagerEventHandler *handler )
676 struct manager *This = impl_from_IUIAnimationManager( iface );
677 FIXME( "stub (%p)->(%p)\n", This, handler );
678 return S_OK;
681 static HRESULT WINAPI manager_SetCancelPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison )
683 struct manager *This = impl_from_IUIAnimationManager( iface );
684 FIXME( "stub (%p)->(%p)\n", This, comparison );
685 return E_NOTIMPL;
688 static HRESULT WINAPI manager_SetTrimPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison )
690 struct manager *This = impl_from_IUIAnimationManager( iface );
691 FIXME( "stub (%p)->(%p)\n", This, comparison );
692 return E_NOTIMPL;
695 static HRESULT WINAPI manager_SetCompressPriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison)
697 struct manager *This = impl_from_IUIAnimationManager( iface );
698 FIXME( "stub (%p)->(%p)\n", This, comparison );
699 return E_NOTIMPL;
702 static HRESULT WINAPI manager_SetConcludePriorityComparison( IUIAnimationManager *iface, IUIAnimationPriorityComparison *comparison )
704 struct manager *This = impl_from_IUIAnimationManager( iface );
705 FIXME( "stub (%p)->(%p)\n", This, comparison );
706 return E_NOTIMPL;
709 static HRESULT WINAPI manager_SetDefaultLongestAcceptableDelay( IUIAnimationManager *iface, UI_ANIMATION_SECONDS delay )
711 struct manager *This = impl_from_IUIAnimationManager( iface );
712 FIXME( "stub (%p)->(%f)\n", This, delay );
713 return E_NOTIMPL;
716 static HRESULT WINAPI manager_Shutdown( IUIAnimationManager *iface )
718 struct manager *This = impl_from_IUIAnimationManager( iface );
719 FIXME( "stub (%p)->()\n", This );
720 return E_NOTIMPL;
723 const struct IUIAnimationManagerVtbl manager_vtbl =
725 manager_QueryInterface,
726 manager_AddRef,
727 manager_Release,
728 manager_CreateAnimationVariable,
729 manager_ScheduleTransition,
730 manager_CreateStoryboard,
731 manager_FinishAllStoryboards,
732 manager_AbandonAllStoryboards,
733 manager_Update,
734 manager_GetVariableFromTag,
735 manager_GetStoryboardFromTag,
736 manager_GetStatus,
737 manager_SetAnimationMode,
738 manager_Pause,
739 manager_Resume,
740 manager_SetManagerEventHandler,
741 manager_SetCancelPriorityComparison,
742 manager_SetTrimPriorityComparison,
743 manager_SetCompressPriorityComparison,
744 manager_SetConcludePriorityComparison,
745 manager_SetDefaultLongestAcceptableDelay,
746 manager_Shutdown
749 static HRESULT manager_create( IUnknown *outer, REFIID iid, void **obj )
751 struct manager *This = heap_alloc( sizeof(*This) );
752 HRESULT hr;
754 if (!This) return E_OUTOFMEMORY;
755 This->IUIAnimationManager_iface.lpVtbl = &manager_vtbl;
756 This->ref = 1;
758 hr = IUIAnimationManager_QueryInterface( &This->IUIAnimationManager_iface, iid, obj );
760 IUIAnimationManager_Release( &This->IUIAnimationManager_iface );
761 return hr;
764 /***********************************************************************
765 * IUIAnimationTimer
767 struct timer
769 IUIAnimationTimer IUIAnimationTimer_iface;
770 LONG ref;
773 struct timer *impl_from_IUIAnimationTimer( IUIAnimationTimer *iface )
775 return CONTAINING_RECORD( iface, struct timer, IUIAnimationTimer_iface );
778 static HRESULT WINAPI timer_QueryInterface( IUIAnimationTimer *iface, REFIID iid, void **obj )
780 struct timer *This = impl_from_IUIAnimationTimer( iface );
782 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
784 if (IsEqualIID( iid, &IID_IUnknown ) ||
785 IsEqualIID( iid, &IID_IUIAnimationTimer ))
787 IUIAnimationTimer_AddRef( iface );
788 *obj = iface;
789 return S_OK;
792 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
793 *obj = NULL;
794 return E_NOINTERFACE;
797 static ULONG WINAPI timer_AddRef( IUIAnimationTimer *iface )
799 struct timer *This = impl_from_IUIAnimationTimer( iface );
800 ULONG ref = InterlockedIncrement( &This->ref );
802 TRACE( "(%p) ref = %u\n", This, ref );
803 return ref;
806 static ULONG WINAPI timer_Release( IUIAnimationTimer *iface )
808 struct timer *This = impl_from_IUIAnimationTimer( iface );
809 ULONG ref = InterlockedDecrement(&This->ref);
811 TRACE( "(%p) ref = %u\n", This, ref );
813 if (!ref)
814 heap_free( This );
816 return ref;
819 static HRESULT WINAPI timer_SetTimerUpdateHandler (IUIAnimationTimer *iface,
820 IUIAnimationTimerUpdateHandler *update_handler,
821 UI_ANIMATION_IDLE_BEHAVIOR idle_behaviour)
823 struct timer *This = impl_from_IUIAnimationTimer( iface );
824 FIXME( "stub (%p)->(%p, %d)\n", This, update_handler, idle_behaviour );
825 return E_NOTIMPL;
828 static HRESULT WINAPI timer_SetTimerEventHandler (IUIAnimationTimer *iface,
829 IUIAnimationTimerEventHandler *handler)
831 struct timer *This = impl_from_IUIAnimationTimer( iface );
832 FIXME( "stub (%p)->()\n", This );
833 return S_OK;
836 static HRESULT WINAPI timer_Enable (IUIAnimationTimer *iface)
838 struct timer *This = impl_from_IUIAnimationTimer( iface );
839 FIXME( "stub (%p)->()\n", This );
840 return S_OK;
843 static HRESULT WINAPI timer_Disable (IUIAnimationTimer *iface)
845 struct timer *This = impl_from_IUIAnimationTimer( iface );
846 FIXME( "stub (%p)->()\n", This );
847 return E_NOTIMPL;
850 static HRESULT WINAPI timer_IsEnabled (IUIAnimationTimer *iface)
852 struct timer *This = impl_from_IUIAnimationTimer( iface );
853 FIXME( "stub (%p)->()\n", This );
854 return E_NOTIMPL;
857 static HRESULT WINAPI timer_GetTime (IUIAnimationTimer *iface, UI_ANIMATION_SECONDS *seconds)
859 struct timer *This = impl_from_IUIAnimationTimer( iface );
860 FIXME( "stub (%p)->(%p)\n", This, seconds );
861 return S_OK;
864 static HRESULT WINAPI timer_SetFrameRateThreshold (IUIAnimationTimer *iface, UINT32 frames_per_sec)
866 struct timer *This = impl_from_IUIAnimationTimer( iface );
867 FIXME( "stub (%p)->(%d)\n", This, frames_per_sec );
868 return E_NOTIMPL;
871 const struct IUIAnimationTimerVtbl timer_vtbl =
873 timer_QueryInterface,
874 timer_AddRef,
875 timer_Release,
876 timer_SetTimerUpdateHandler,
877 timer_SetTimerEventHandler,
878 timer_Enable,
879 timer_Disable,
880 timer_IsEnabled,
881 timer_GetTime,
882 timer_SetFrameRateThreshold,
885 static HRESULT timer_create( IUnknown *outer, REFIID iid, void **obj )
887 struct timer *This = heap_alloc( sizeof(*This) );
888 HRESULT hr;
890 if (!This)
891 return E_OUTOFMEMORY;
892 This->IUIAnimationTimer_iface.lpVtbl = &timer_vtbl;
893 This->ref = 1;
895 hr = IUIAnimationTimer_QueryInterface( &This->IUIAnimationTimer_iface, iid, obj );
897 IUIAnimationTimer_Release( &This->IUIAnimationTimer_iface );
898 return hr;
901 /***********************************************************************
902 * IUIAnimationTransitionFactory
904 struct tr_factory
906 IUIAnimationTransitionFactory IUIAnimationTransitionFactory_iface;
907 LONG ref;
910 struct tr_factory *impl_from_IUIAnimationTransitionFactory( IUIAnimationTransitionFactory *iface )
912 return CONTAINING_RECORD( iface, struct tr_factory, IUIAnimationTransitionFactory_iface );
915 static HRESULT WINAPI tr_factory_QueryInterface( IUIAnimationTransitionFactory *iface, REFIID iid, void **obj )
917 struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface );
919 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
921 if (IsEqualIID( iid, &IID_IUnknown ) ||
922 IsEqualIID( iid, &IID_IUIAnimationTransitionFactory ))
924 IUIAnimationTransitionFactory_AddRef( iface );
925 *obj = iface;
926 return S_OK;
929 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
930 *obj = NULL;
931 return E_NOINTERFACE;
934 static ULONG WINAPI tr_factory_AddRef( IUIAnimationTransitionFactory *iface )
936 struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface );
937 ULONG ref = InterlockedIncrement( &This->ref );
939 TRACE( "(%p) ref = %u\n", This, ref );
940 return ref;
943 static ULONG WINAPI tr_factory_Release( IUIAnimationTransitionFactory *iface )
945 struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface );
946 ULONG ref = InterlockedDecrement(&This->ref);
948 TRACE( "(%p) ref = %u\n", This, ref );
950 if (!ref)
951 heap_free( This );
953 return ref;
956 static HRESULT WINAPI tr_factory_CreateTransition(IUIAnimationTransitionFactory *iface,
957 IUIAnimationInterpolator *interpolator, IUIAnimationTransition **transition)
959 struct tr_factory *This = impl_from_IUIAnimationTransitionFactory( iface );
960 FIXME( "stub (%p)->(%p, %p)\n", This, interpolator, transition );
961 return E_NOTIMPL;
964 const struct IUIAnimationTransitionFactoryVtbl tr_factory_vtbl =
966 tr_factory_QueryInterface,
967 tr_factory_AddRef,
968 tr_factory_Release,
969 tr_factory_CreateTransition
972 static HRESULT transition_create( IUnknown *outer, REFIID iid, void **obj )
974 struct tr_factory *This = heap_alloc( sizeof(*This) );
975 HRESULT hr;
977 if (!This) return E_OUTOFMEMORY;
978 This->IUIAnimationTransitionFactory_iface.lpVtbl = &tr_factory_vtbl;
979 This->ref = 1;
981 hr = IUIAnimationTransitionFactory_QueryInterface( &This->IUIAnimationTransitionFactory_iface, iid, obj );
983 IUIAnimationTransitionFactory_Release( &This->IUIAnimationTransitionFactory_iface );
984 return hr;
987 /***********************************************************************
988 * IUITransitionLibrary
990 struct tr_library
992 IUIAnimationTransitionLibrary IUIAnimationTransitionLibrary_iface;
993 LONG ref;
996 struct tr_library *impl_from_IUIAnimationTransitionLibrary( IUIAnimationTransitionLibrary *iface )
998 return CONTAINING_RECORD( iface, struct tr_library, IUIAnimationTransitionLibrary_iface );
1001 static HRESULT WINAPI tr_library_QueryInterface( IUIAnimationTransitionLibrary *iface,
1002 REFIID iid, void **obj )
1004 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1006 TRACE( "(%p)->(%s %p)\n", This, debugstr_guid( iid ), obj );
1008 if (IsEqualIID( iid, &IID_IUnknown ) ||
1009 IsEqualIID( iid, &IID_IUIAnimationTransitionLibrary ))
1011 IUIAnimationTransitionLibrary_AddRef( iface );
1012 *obj = iface;
1013 return S_OK;
1016 FIXME( "interface %s not implemented\n", debugstr_guid( iid ) );
1017 *obj = NULL;
1018 return E_NOINTERFACE;
1021 static ULONG WINAPI tr_library_AddRef( IUIAnimationTransitionLibrary *iface )
1023 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1024 ULONG ref = InterlockedIncrement( &This->ref );
1026 TRACE( "(%p) ref = %u\n", This, ref );
1027 return ref;
1030 static ULONG WINAPI tr_library_Release( IUIAnimationTransitionLibrary *iface )
1032 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1033 ULONG ref = InterlockedDecrement(&This->ref);
1035 TRACE( "(%p) ref = %u\n", This, ref );
1037 if (!ref)
1038 heap_free( This );
1040 return ref;
1043 static HRESULT WINAPI tr_library_CreateInstantaneousTransition(IUIAnimationTransitionLibrary *iface,
1044 double finalValue, IUIAnimationTransition **transition)
1046 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1047 FIXME( "stub (%p)->(%f, %p)\n", This, finalValue, transition );
1048 return E_NOTIMPL;
1051 static HRESULT WINAPI tr_library_CreateConstantTransition(IUIAnimationTransitionLibrary *iface,
1052 double duration, IUIAnimationTransition **transition)
1054 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1055 FIXME( "stub (%p)->(%f, %p)\n", This, duration, transition );
1056 return E_NOTIMPL;
1059 static HRESULT WINAPI tr_library_CreateDiscreteTransition(IUIAnimationTransitionLibrary *iface,
1060 double delay, double finalValue, double hold, IUIAnimationTransition **transition)
1062 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1063 FIXME( "stub (%p)->( )\n", This );
1064 return E_NOTIMPL;
1067 static HRESULT WINAPI tr_library_CreateLinearTransition(IUIAnimationTransitionLibrary *iface,
1068 double duration, double finalValue, IUIAnimationTransition **transition)
1070 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1071 FIXME( "stub (%p)->(%f, %f, %p)\n", This, duration, finalValue, transition );
1072 return E_NOTIMPL;
1075 static HRESULT WINAPI tr_library_CreateLinearTransitionFromSpeed(IUIAnimationTransitionLibrary *iface,
1076 double speed, double finalValue, IUIAnimationTransition **transition)
1078 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1079 FIXME( "stub (%p)->(%f, %f, %p)\n", This, speed, finalValue, transition );
1080 return E_NOTIMPL;
1083 static HRESULT WINAPI tr_library_CreateSinusoidalTransitionFromVelocity(IUIAnimationTransitionLibrary *iface,
1084 double duration, double period, IUIAnimationTransition **transition)
1086 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1087 FIXME( "stub (%p)->(%f, %f, %p)\n", This, duration, period, transition );
1088 return E_NOTIMPL;
1091 static HRESULT WINAPI tr_library_CreateSinusoidalTransitionFromRange(IUIAnimationTransitionLibrary *iface,
1092 double duration, double minimumValue, double maximumValue, double period,
1093 UI_ANIMATION_SLOPE slope, IUIAnimationTransition **transition)
1095 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1096 FIXME( "stub (%p)->(%f, %f, %f, %f, %d, %p)\n", This, duration, minimumValue, maximumValue, period, slope, transition );
1097 return E_NOTIMPL;
1100 static HRESULT WINAPI tr_library_CreateAccelerateDecelerateTransition(IUIAnimationTransitionLibrary *iface,
1101 double duration, double finalValue, double accelerationRatio, double decelerationRatio,
1102 IUIAnimationTransition **transition)
1104 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1105 FIXME( "stub (%p)->(%f, %f, %f, %f, %p)\n", This, duration, finalValue, accelerationRatio, decelerationRatio, transition );
1106 return E_NOTIMPL;
1109 static HRESULT WINAPI tr_library_CreateReversalTransition(IUIAnimationTransitionLibrary *iface, double duration,
1110 IUIAnimationTransition **transition)
1112 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1113 FIXME( "stub (%p)->(%f, %p)\n", This, duration, transition );
1114 return E_NOTIMPL;
1117 static HRESULT WINAPI tr_library_CreateCubicTransition(IUIAnimationTransitionLibrary *iface, double duration,
1118 double finalValue, double finalVelocity, IUIAnimationTransition **transition)
1120 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1121 FIXME( "stub (%p)->(%f, %f, %f, %p)\n", This, duration, finalValue, finalVelocity, transition );
1122 return E_NOTIMPL;
1125 static HRESULT WINAPI tr_library_CreateSmoothStopTransition(IUIAnimationTransitionLibrary *iface,
1126 double maximumDuration, double finalValue, IUIAnimationTransition **transition)
1128 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1129 FIXME( "stub (%p)->(%f, %f, %p)\n", This, maximumDuration, finalValue, transition );
1130 return E_NOTIMPL;
1133 static HRESULT WINAPI tr_library_CreateParabolicTransitionFromAcceleration(IUIAnimationTransitionLibrary *iface,
1134 double finalValue, double finalVelocity, double acceleration, IUIAnimationTransition **transition)
1136 struct tr_library *This = impl_from_IUIAnimationTransitionLibrary( iface );
1137 FIXME( "stub (%p)->( )\n", This );
1138 return E_NOTIMPL;
1141 const struct IUIAnimationTransitionLibraryVtbl tr_library_vtbl =
1143 tr_library_QueryInterface,
1144 tr_library_AddRef,
1145 tr_library_Release,
1146 tr_library_CreateInstantaneousTransition,
1147 tr_library_CreateConstantTransition,
1148 tr_library_CreateDiscreteTransition,
1149 tr_library_CreateLinearTransition,
1150 tr_library_CreateLinearTransitionFromSpeed,
1151 tr_library_CreateSinusoidalTransitionFromVelocity,
1152 tr_library_CreateSinusoidalTransitionFromRange,
1153 tr_library_CreateAccelerateDecelerateTransition,
1154 tr_library_CreateReversalTransition,
1155 tr_library_CreateCubicTransition,
1156 tr_library_CreateSmoothStopTransition,
1157 tr_library_CreateParabolicTransitionFromAcceleration,
1160 static HRESULT library_create( IUnknown *outer, REFIID iid, void **obj )
1162 struct tr_library *This = heap_alloc( sizeof(*This) );
1163 HRESULT hr;
1165 if (!This) return E_OUTOFMEMORY;
1166 This->IUIAnimationTransitionLibrary_iface.lpVtbl = &tr_library_vtbl;
1167 This->ref = 1;
1169 hr = IUIAnimationTransitionLibrary_QueryInterface( &This->IUIAnimationTransitionLibrary_iface, iid, obj );
1171 IUIAnimationTransitionLibrary_Release( &This->IUIAnimationTransitionLibrary_iface );
1172 return hr;
1175 static struct class_factory manager_cf = { { &class_factory_vtbl }, manager_create };
1176 static struct class_factory timer_cf = { { &class_factory_vtbl }, timer_create };
1177 static struct class_factory transition_cf = { { &class_factory_vtbl }, transition_create };
1178 static struct class_factory library_cf = { { &class_factory_vtbl }, library_create };
1180 /******************************************************************
1181 * DllGetClassObject
1183 HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **obj )
1185 IClassFactory *cf = NULL;
1187 TRACE( "(%s %s %p)\n", debugstr_guid( clsid ), debugstr_guid( iid ), obj );
1189 if (IsEqualCLSID( clsid, &CLSID_UIAnimationManager ))
1190 cf = &manager_cf.IClassFactory_iface;
1191 else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTimer ))
1192 cf = &timer_cf.IClassFactory_iface;
1193 else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTransitionFactory ))
1194 cf = &transition_cf.IClassFactory_iface;
1195 else if (IsEqualCLSID( clsid, &CLSID_UIAnimationTransitionLibrary ))
1196 cf = &library_cf.IClassFactory_iface;
1198 if (!cf)
1199 return CLASS_E_CLASSNOTAVAILABLE;
1201 return IClassFactory_QueryInterface( cf, iid, obj );
1204 /******************************************************************
1205 * DllCanUnloadNow
1207 HRESULT WINAPI DllCanUnloadNow( void )
1209 TRACE( "()\n" );
1210 return S_FALSE;
1213 /***********************************************************************
1214 * DllRegisterServer
1216 HRESULT WINAPI DllRegisterServer( void )
1218 return __wine_register_resources( hinstance );
1221 /***********************************************************************
1222 * DllUnregisterServer
1224 HRESULT WINAPI DllUnregisterServer( void )
1226 return __wine_unregister_resources( hinstance );