GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_widget_fill_color_set.c Lines: 7 7 100.0 %
Date: 2024-12-05 08:52:37 Branches: 2 2 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
/**   Widget Management (Widget)                                          */
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
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gx_widget_fill_color_set                           PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function sets the background color of the widget.              */
44
/*                                                                        */
45
/*  INPUT                                                                 */
46
/*                                                                        */
47
/*    widget                                Widget control block          */
48
/*    normal_color                          Normal fill color id          */
49
/*    selected_color                        Selected fill color id        */
50
/*    disabled_color                        Disabled fill color id        */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    status                                Completion status             */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*    _gx_system_dirty_mark                 Mark widget as dirty          */
59
/*                                                                        */
60
/*  CALLED BY                                                             */
61
/*                                                                        */
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
114451
UINT  _gx_widget_fill_color_set(GX_WIDGET *widget,
74
                                GX_RESOURCE_ID normal_color,
75
                                GX_RESOURCE_ID selected_color,
76
                                GX_RESOURCE_ID disabled_color)
77
{
78
79
    /* Set the widget's color.  */
80
114451
    widget -> gx_widget_normal_fill_color =  normal_color;
81
114451
    widget -> gx_widget_selected_fill_color = selected_color;
82
114451
    widget -> gx_widget_disabled_fill_color = disabled_color;
83
84
114451
    if (widget -> gx_widget_status & GX_STATUS_VISIBLE)
85
    {
86
        /* Mark widget as needing to be re-painted.  */
87
291
        _gx_system_dirty_mark(widget);
88
    }
89
90
    /* Return successful completion.  */
91
114451
    return(GX_SUCCESS);
92
}
93