GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_radial_progress_bar_info_set.c Lines: 10 10 100.0 %
Date: 2026-03-06 19:21:09 Branches: 6 6 100.0 %

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
/**   Progress Bar Management (Radial Progress Bar)                       */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
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_progress_bar.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_radial_progress_bar_info_set                    PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function reset the information structure of a radial progress  */
45
/*      bar                                                               */
46
/*                                                                        */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    bar                                   Radial proress bar control    */
51
/*                                            block                       */
52
/*    info                                  Radial progess bar info block */
53
/*                                                                        */
54
/*  OUTPUT                                                                */
55
/*                                                                        */
56
/*    status                                Completion status             */
57
/*                                                                        */
58
/*  CALLS                                                                 */
59
/*                                                                        */
60
/*    _gx_radial_progrss_bar_size_update    Update the size of the        */
61
/*                                            progress bar                */
62
/*    _gx_system_dirty_mark                 Mark the widget as dirty      */
63
/*                                                                        */
64
/*  CALLED BY                                                             */
65
/*                                                                        */
66
/*    Application Code                                                    */
67
/*    GUIX Internal Code                                                  */
68
/*                                                                        */
69
/**************************************************************************/
70
946
UINT _gx_radial_progress_bar_info_set(GX_RADIAL_PROGRESS_BAR *bar, GX_RADIAL_PROGRESS_BAR_INFO *info)
71
{
72
73
    /* Copy the new info.  */
74
946
    bar -> gx_radial_progress_bar_info = *info;
75
76
946
    if (info -> gx_radial_progress_bar_info_anchor_val < 0)
77
    {
78
1
        bar -> gx_radial_progress_bar_info.gx_radial_progress_bar_info_anchor_val = 0;
79
    }
80
945
    else if (info -> gx_radial_progress_bar_info_anchor_val > 360)
81
    {
82
1
        bar -> gx_radial_progress_bar_info.gx_radial_progress_bar_info_anchor_val = 360;
83
    }
84
85
    /* Calculate radial progress bar.  */
86
946
    _gx_radial_progress_bar_size_update(bar);
87
88
946
    if (bar -> gx_widget_status & GX_STATUS_VISIBLE)
89
    {
90
        /* Mark the widget area as dirty.  */
91
945
        _gx_system_dirty_mark((GX_WIDGET *)bar);
92
    }
93
94
946
    return(GX_SUCCESS);
95
}
96