GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_widget_fill_color_set.c Lines: 7 7 100.0 %
Date: 2026-03-06 19:21:09 Branches: 2 2 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
/**   Widget Management (Widget)                                          */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_system.h"
29
#include "gx_widget.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_widget_fill_color_set                           PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function sets the background color of the widget.              */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    widget                                Widget control block          */
49
/*    normal_color                          Normal fill color id          */
50
/*    selected_color                        Selected fill color id        */
51
/*    disabled_color                        Disabled fill color id        */
52
/*                                                                        */
53
/*  OUTPUT                                                                */
54
/*                                                                        */
55
/*    status                                Completion status             */
56
/*                                                                        */
57
/*  CALLS                                                                 */
58
/*                                                                        */
59
/*    _gx_system_dirty_mark                 Mark widget as dirty          */
60
/*                                                                        */
61
/*  CALLED BY                                                             */
62
/*                                                                        */
63
/*    Application Code                                                    */
64
/*                                                                        */
65
/**************************************************************************/
66
114451
UINT  _gx_widget_fill_color_set(GX_WIDGET *widget,
67
                                GX_RESOURCE_ID normal_color,
68
                                GX_RESOURCE_ID selected_color,
69
                                GX_RESOURCE_ID disabled_color)
70
{
71
72
    /* Set the widget's color.  */
73
114451
    widget -> gx_widget_normal_fill_color =  normal_color;
74
114451
    widget -> gx_widget_selected_fill_color = selected_color;
75
114451
    widget -> gx_widget_disabled_fill_color = disabled_color;
76
77
114451
    if (widget -> gx_widget_status & GX_STATUS_VISIBLE)
78
    {
79
        /* Mark widget as needing to be re-painted.  */
80
291
        _gx_system_dirty_mark(widget);
81
    }
82
83
    /* Return successful completion.  */
84
114451
    return(GX_SUCCESS);
85
}
86