GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_radial_slider_anchor_angles_set.c Lines: 9 9 100.0 %
Date: 2024-12-05 08:52:37 Branches: 8 8 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
/**************************************************************************/
30
/*                                                                        */
31
/*  FUNCTION                                               RELEASE        */
32
/*                                                                        */
33
/*    _gxe_radial_slider_anchor_angles_set                PORTABLE C      */
34
/*                                                           6.1          */
35
/*  AUTHOR                                                                */
36
/*                                                                        */
37
/*    Kenneth Maxwell, Microsoft Corporation                              */
38
/*                                                                        */
39
/*  DESCRIPTION                                                           */
40
/*                                                                        */
41
/*    This function checks for errors in the radial slider anchor angles  */
42
/*    set function call.                                                  */
43
/*                                                                        */
44
/*  INPUT                                                                 */
45
/*                                                                        */
46
/*    slider                                Radial slider control block   */
47
/*    anchor_angles                         The angle list to set, which  */
48
/*                                            defines anchor angles for   */
49
/*                                            radial slider               */
50
/*    anchor_count                          The count of the anchor angles*/
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    status                                Completion status             */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*    _gx_radial_slider_anchor_angles_set   Actual radial slider anchor   */
59
/*                                            angles set function         */
60
/*                                                                        */
61
/*  CALLED BY                                                             */
62
/*                                                                        */
63
/*    Application Code                                                    */
64
/*                                                                        */
65
/*  RELEASE HISTORY                                                       */
66
/*                                                                        */
67
/*    DATE              NAME                      DESCRIPTION             */
68
/*                                                                        */
69
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
70
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
71
/*                                            resulting in version 6.1    */
72
/*                                                                        */
73
/**************************************************************************/
74
7
UINT _gxe_radial_slider_anchor_angles_set(GX_RADIAL_SLIDER *slider, GX_VALUE *anchor_angles, USHORT anchor_count)
75
{
76
UINT status;
77
78
    /* Check for invalid input pointers.  */
79
7
    if (slider == GX_NULL)
80
    {
81
2
        return(GX_PTR_ERROR);
82
    }
83
84
    /* Check for invalid anchor count. */
85

5
    if ((anchor_angles) && (anchor_count == 0))
86
    {
87
1
        return(GX_INVALID_VALUE);
88
    }
89
90
    /* Check for invalid widget.  */
91
4
    if (slider -> gx_widget_type == 0)
92
    {
93
1
        return(GX_INVALID_WIDGET);
94
    }
95
96
    /* Call actual radial slider anchor angles set function.  */
97
3
    status = _gx_radial_slider_anchor_angles_set(slider, anchor_angles, anchor_count);
98
99
    /* Return completion status.  */
100
3
    return(status);
101
}
102