1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 
12 /**************************************************************************/
13 /**************************************************************************/
14 /**                                                                       */
15 /** GUIX Component                                                        */
16 /**                                                                       */
17 /**   Animation Management (Animation)                                    */
18 /**                                                                       */
19 /**************************************************************************/
20 /**************************************************************************/
21 
22 
23 /**************************************************************************/
24 /*                                                                        */
25 /*  COMPONENT DEFINITION                                   RELEASE        */
26 /*                                                                        */
27 /*    gx_animation.h                                      PORTABLE C      */
28 /*                                                           6.1.7        */
29 /*  AUTHOR                                                                */
30 /*                                                                        */
31 /*    Kenneth Maxwell, Microsoft Corporation                              */
32 /*                                                                        */
33 /*  DESCRIPTION                                                           */
34 /*                                                                        */
35 /*    This file defines the GUIX animation component, including all data  */
36 /*    types and external references.  It is assumed that gx_api.h and     */
37 /*    gx_port.h have already been included.                               */
38 /*                                                                        */
39 /*  RELEASE HISTORY                                                       */
40 /*                                                                        */
41 /*    DATE              NAME                      DESCRIPTION             */
42 /*                                                                        */
43 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
44 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
45 /*                                            resulting in version 6.1    */
46 /*  06-02-2021     Ting Zhu                 Modified comment(s),          */
47 /*                                            added animation delete API, */
48 /*                                            resulting in version 6.1.7  */
49 /*                                                                        */
50 /**************************************************************************/
51 
52 #ifndef GX_ANIMATION_H
53 #define GX_ANIMATION_H
54 
55 #define GX_ANIMATION_SLIDE_LEFT       0x0001
56 #define GX_ANIMATION_SLIDE_RIGHT      0x0002
57 #define GX_ANIMATION_SLIDE_UP         0x0040
58 #define GX_ANIMATION_SLIDE_DOWN       0x0080
59 
60 #define GX_ANIMATION_SLIDE_TIMER      1000
61 #define GX_ANIMATION_MIN_SLIDING_DIST 5
62 
63 /* Define animation management function prototypes.  */
64 
65 UINT _gx_animation_create(GX_ANIMATION *animation);
66 UINT _gx_animation_canvas_define(GX_ANIMATION *animation, GX_CANVAS *canvas);
67 VOID _gx_animation_complete_event_send(GX_ANIMATION *animation);
68 UINT _gx_animation_delete(GX_ANIMATION *target, GX_WIDGET *parent);
69 UINT _gx_animation_start(GX_ANIMATION *animation, GX_ANIMATION_INFO *info);
70 UINT _gx_animation_stop(GX_ANIMATION *animation);
71 VOID _gx_animation_update(VOID);
72 VOID _gx_animation_complete(GX_ANIMATION *animation);
73 
74 UINT _gx_animation_drag_disable(GX_ANIMATION *animation, GX_WIDGET *widget);
75 UINT _gx_animation_drag_enable(GX_ANIMATION *animation, GX_WIDGET *widget, GX_ANIMATION_INFO *info);
76 UINT _gx_animation_drag_event_process(GX_WIDGET *widget, GX_EVENT *event_ptr);
77 UINT _gx_animation_drag_tracking(GX_ANIMATION *animation, GX_POINT penpos);
78 UINT _gx_animation_drag_tracking_start(GX_ANIMATION *animation, GX_POINT penpos);
79 UINT _gx_animation_slide_landing(GX_ANIMATION *animation);
80 UINT _gx_animation_landing_speed_set(GX_ANIMATION *animation, USHORT shift_per_step);
81 UINT _gx_animation_slide_landing_start(GX_ANIMATION *animation);
82 
83 /* error checking versions of the animation API functions */
84 UINT _gxe_animation_create(GX_ANIMATION *animation);
85 UINT _gxe_animation_canvas_define(GX_ANIMATION *animation, GX_CANVAS *canvas);
86 UINT _gxe_animation_delete(GX_ANIMATION *target, GX_WIDGET *parent);
87 UINT _gxe_animation_drag_disable(GX_ANIMATION *animation, GX_WIDGET *widget);
88 UINT _gxe_animation_drag_enable(GX_ANIMATION *animation, GX_WIDGET *widget, GX_ANIMATION_INFO *info);
89 UINT _gxe_animation_start(GX_ANIMATION *animation, GX_ANIMATION_INFO *info);
90 UINT _gxe_animation_stop(GX_ANIMATION *animation);
91 
92 UINT _gxe_animation_landing_speed_set(GX_ANIMATION *animation, USHORT shift_per_step);
93 
94 #endif
95 
96