GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_radial_slider_animation_set.c Lines: 8 8 100.0 %
Date: 2024-12-05 08:52:37 Branches: 10 10 100.0 %

Line Branch Exec Source
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
/**   Radial Slider Management (Slider)                                   */
18
/**                                                                       */
19
/**************************************************************************/
20
21
#define GX_SOURCE_CODE
22
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_radial_slider.h"
28
29
/* Bring in externs for caller checking code.  */
30
GX_CALLER_CHECKING_EXTERNS
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gxe_radial_slider_animation_set                    PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function checks for errors in the radial slider animation set  */
45
/*    function call.                                                      */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    slider                                Radial slider control block   */
50
/*    steps                                 Total steps for one animation */
51
/*    delay                                 Delay time for every step     */
52
/*    animation_style                       Easing function type          */
53
/*    animation_update_callback             Function that to be called    */
54
/*                                          after each animation step,    */
55
/*                                          could be NULL                 */
56
/*                                                                        */
57
/*  OUTPUT                                                                */
58
/*                                                                        */
59
/*    status                                Completion status             */
60
/*                                                                        */
61
/*  CALLS                                                                 */
62
/*                                                                        */
63
/*    _gx_radial_slider_animation_set       Actual radial slider          */
64
/*                                            animation set function      */
65
/*                                                                        */
66
/*  CALLED BY                                                             */
67
/*                                                                        */
68
/*    Application Code                                                    */
69
/*                                                                        */
70
/*  RELEASE HISTORY                                                       */
71
/*                                                                        */
72
/*    DATE              NAME                      DESCRIPTION             */
73
/*                                                                        */
74
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
75
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
76
/*                                            resulting in version 6.1    */
77
/*                                                                        */
78
/**************************************************************************/
79
251
UINT _gxe_radial_slider_animation_set(GX_RADIAL_SLIDER *slider, USHORT steps, USHORT delay, USHORT animation_style,
80
                                      VOID (*animation_update_callback)(GX_RADIAL_SLIDER *slider))
81
{
82
UINT status;
83
84
    /* Check for appropriate caller.  */
85

251
    GX_INIT_AND_THREADS_CALLER_CHECKING
86
87
    /* Check for invalid input pointers.  */
88
249
    if (slider == GX_NULL)
89
    {
90
2
        return(GX_PTR_ERROR);
91
    }
92
93
    /* Check for invalid widget.  */
94
247
    if (slider -> gx_widget_type == 0)
95
    {
96
1
        return(GX_INVALID_WIDGET);
97
    }
98
99
    /* Call actual radial slider animation set function.  */
100
246
    status = _gx_radial_slider_animation_set(slider, steps, delay, animation_style, animation_update_callback);
101
102
    /* Return completion status.  */
103
246
    return(status);
104
}
105