1 |
|
|
/*************************************************************************** |
2 |
|
|
* Copyright (c) 2024 Microsoft Corporation |
3 |
|
|
* Copyright (c) 2026-present Eclipse ThreadX contributors |
4 |
|
|
* |
5 |
|
|
* This program and the accompanying materials are made available under the |
6 |
|
|
* terms of the MIT License which is available at |
7 |
|
|
* https://opensource.org/licenses/MIT. |
8 |
|
|
* |
9 |
|
|
* SPDX-License-Identifier: MIT |
10 |
|
|
**************************************************************************/ |
11 |
|
|
|
12 |
|
|
|
13 |
|
|
/**************************************************************************/ |
14 |
|
|
/**************************************************************************/ |
15 |
|
|
/** */ |
16 |
|
|
/** GUIX Component */ |
17 |
|
|
/** */ |
18 |
|
|
/** Animation Management (Animation) */ |
19 |
|
|
/** */ |
20 |
|
|
/**************************************************************************/ |
21 |
|
|
|
22 |
|
|
#define GX_SOURCE_CODE |
23 |
|
|
|
24 |
|
|
|
25 |
|
|
/* Include necessary system files. */ |
26 |
|
|
|
27 |
|
|
#include "gx_api.h" |
28 |
|
|
#include "gx_animation.h" |
29 |
|
|
#include "gx_system.h" |
30 |
|
|
|
31 |
|
|
/**************************************************************************/ |
32 |
|
|
/* */ |
33 |
|
|
/* FUNCTION RELEASE */ |
34 |
|
|
/* */ |
35 |
|
|
/* _gx_animation_drag_enable PORTABLE C */ |
36 |
|
|
/* 6.1 */ |
37 |
|
|
/* AUTHOR */ |
38 |
|
|
/* */ |
39 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
40 |
|
|
/* */ |
41 |
|
|
/* DESCRIPTION */ |
42 |
|
|
/* */ |
43 |
|
|
/* This function sets screen slide animation event process as a hook */ |
44 |
|
|
/* procedure of the widget's default event process. */ |
45 |
|
|
/* */ |
46 |
|
|
/* INPUT */ |
47 |
|
|
/* */ |
48 |
|
|
/* animation Pointer to animation control */ |
49 |
|
|
/* block */ |
50 |
|
|
/* widget Pointer to widget control */ |
51 |
|
|
/* block */ |
52 |
|
|
/* info Animation information */ |
53 |
|
|
/* */ |
54 |
|
|
/* OUTPUT */ |
55 |
|
|
/* */ |
56 |
|
|
/* status Completion status */ |
57 |
|
|
/* */ |
58 |
|
|
/* CALLS */ |
59 |
|
|
/* */ |
60 |
|
|
/* None */ |
61 |
|
|
/* */ |
62 |
|
|
/* CALLED BY */ |
63 |
|
|
/* */ |
64 |
|
|
/* Application Code */ |
65 |
|
|
/* */ |
66 |
|
|
/**************************************************************************/ |
67 |
|
|
#if (GX_ANIMATION_POOL_SIZE > 0) |
68 |
|
43 |
UINT _gx_animation_drag_enable(GX_ANIMATION *animation, GX_WIDGET *widget, GX_ANIMATION_INFO *info) |
69 |
|
|
{ |
70 |
|
|
/* Test invalid animation status. */ |
71 |
✓✓ |
43 |
if (animation -> gx_animation_status != GX_ANIMATION_IDLE) |
72 |
|
|
{ |
73 |
|
2 |
return(GX_INVALID_STATUS); |
74 |
|
|
} |
75 |
|
|
|
76 |
|
|
/* Save the widget's event process function, and replace it with the slide animation event process. */ |
77 |
|
41 |
animation -> gx_animation_original_event_process_function = widget -> gx_widget_event_process_function; |
78 |
|
41 |
widget -> gx_widget_event_process_function = _gx_animation_drag_event_process; |
79 |
|
|
|
80 |
|
|
/* Save the animation parameters */ |
81 |
|
41 |
animation -> gx_animation_info = *info; |
82 |
|
41 |
animation -> gx_animation_timer = animation -> gx_animation_info.gx_animation_frame_interval; |
83 |
|
41 |
animation -> gx_animation_next = _gx_system_animation_list; |
84 |
|
41 |
animation -> gx_animation_total_steps = info -> gx_animation_steps; |
85 |
|
41 |
_gx_system_animation_list = animation; |
86 |
|
|
|
87 |
|
|
/* Return completion status code. */ |
88 |
|
41 |
return(GX_SUCCESS); |
89 |
|
|
} |
90 |
|
|
#endif |