GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_animation_start.c Lines: 16 16 100.0 %
Date: 2026-03-06 19:21:09 Branches: 20 24 83.3 %

Line Branch Exec Source
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_widget.h"
29
#include "gx_system.h"
30
#include "gx_canvas.h"
31
#include "gx_animation.h"
32
33
/* Bring in externs for caller checking code.  */
34
GX_CALLER_CHECKING_EXTERNS
35
36
/**************************************************************************/
37
/*                                                                        */
38
/*  FUNCTION                                               RELEASE        */
39
/*                                                                        */
40
/*    _gxe_animation_start                                PORTABLE C      */
41
/*                                                           6.3.0        */
42
/*  AUTHOR                                                                */
43
/*                                                                        */
44
/*    Kenneth Maxwell, Microsoft Corporation                              */
45
/*                                                                        */
46
/*  DESCRIPTION                                                           */
47
/*                                                                        */
48
/*    This function checks for error in animation start call.             */
49
/*                                                                        */
50
/*                                                                        */
51
/*  INPUT                                                                 */
52
/*                                                                        */
53
/*    animation                             Pointer to animation control  */
54
/*                                            block                       */
55
/*    info                                  Animation information         */
56
/*                                                                        */
57
/*  OUTPUT                                                                */
58
/*                                                                        */
59
/*    status                                Completion status             */
60
/*                                                                        */
61
/*  CALLS                                                                 */
62
/*                                                                        */
63
/*    _gx_animation_start                   Actual animation start call.  */
64
/*                                                                        */
65
/*  CALLED BY                                                             */
66
/*                                                                        */
67
/*    Application Code                                                    */
68
/*                                                                        */
69
/**************************************************************************/
70
#if (GX_ANIMATION_POOL_SIZE > 0)
71
72
UINT _gxe_animation_start(GX_ANIMATION *animation, GX_ANIMATION_INFO *info)
72
{
73
    /* Check for appropriate caller.  */
74

72
    GX_INIT_AND_THREADS_CALLER_CHECKING
75
76

72
    if (animation == GX_NULL ||
77
        info == GX_NULL)
78
    {
79
3
        return GX_PTR_ERROR;
80
    }
81
82

69
    if (info->gx_animation_steps < 2 || info->gx_animation_frame_interval < 1)
83
    {
84
2
        return GX_INVALID_VALUE;
85
    }
86
87
67
    if (info -> gx_animation_end_alpha == 0 &&
88
4
        info -> gx_animation_start_alpha == 0)
89
    {
90
1
        return GX_INVALID_VALUE;
91
    }
92
93
66
    if (info -> gx_animation_target == GX_NULL)
94
    {
95
1
        return GX_INVALID_WIDGET;
96
    }
97
65
    if (info -> gx_animation_target -> gx_widget_type == 0)
98
    {
99
        /* target widget has not been created */
100
1
        return GX_INVALID_WIDGET;
101
    }
102
103
    /* Check for invalid animation status. */
104
64
    if (animation -> gx_animation_status != GX_ANIMATION_IDLE)
105
    {
106
2
        return(GX_INVALID_STATUS);
107
    }
108
109
62
    return(_gx_animation_start(animation, info));
110
}
111
#endif