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