GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_radial_slider_angle_set.c Lines: 8 8 100.0 %
Date: 2024-12-05 08:52:37 Branches: 4 4 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_system.h"
28
#include "gx_widget.h"
29
#include "gx_radial_slider.h"
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gx_radial_slider_angle_set                         PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This service sets new slider angle value.                           */
44
/*                                                                        */
45
/*  INPUT                                                                 */
46
/*                                                                        */
47
/*    slider                                Radial slider control block   */
48
/*    new_angle                             New angle to be set           */
49
/*                                                                        */
50
/*  OUTPUT                                                                */
51
/*                                                                        */
52
/*    status                                Completion status             */
53
/*                                                                        */
54
/*  CALLS                                                                 */
55
/*                                                                        */
56
/*    _gx_widget_event_generate             Generate child signal         */
57
/*    _gx_system_dirty_mark                 Mark widget as dirty          */
58
/*                                                                        */
59
/*  CALLED BY                                                             */
60
/*                                                                        */
61
/*    GUIX Internal Code                                                  */
62
/*    Application Code                                                    */
63
/*                                                                        */
64
/*  RELEASE HISTORY                                                       */
65
/*                                                                        */
66
/*    DATE              NAME                      DESCRIPTION             */
67
/*                                                                        */
68
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
69
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
70
/*                                            resulting in version 6.1    */
71
/*                                                                        */
72
/**************************************************************************/
73
151
UINT _gx_radial_slider_angle_set(GX_RADIAL_SLIDER *slider, GX_VALUE new_angle)
74
{
75
151
GX_RADIAL_SLIDER_INFO *info = &slider -> gx_radial_slider_info;
76
77
151
    if (new_angle != info -> gx_radial_slider_info_current_angle)
78
    {
79
137
        info -> gx_radial_slider_info_current_angle = new_angle;
80
81
137
        _gx_widget_event_generate((GX_WIDGET *)slider, GX_EVENT_SLIDER_VALUE, new_angle);
82
83
137
        if (slider -> gx_widget_status & GX_STATUS_VISIBLE)
84
        {
85
121
            _gx_system_dirty_mark((GX_WIDGET *)slider);
86
        }
87
    }
88
89
151
    return(GX_SUCCESS);
90
}
91