GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_radio_button_pixelmap_set.c Lines: 8 8 100.0 %
Date: 2026-03-06 19:21:09 Branches: 10 10 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
/**   Button Management (Button)                                          */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_widget.h"
29
#include "gx_button.h"
30
#include "gx_system.h"
31
#include "gx_utility.h"
32
33
/* Bring in externs for caller checking code.  */
34
GX_CALLER_CHECKING_EXTERNS
35
36
/**************************************************************************/
37
/*                                                                        */
38
/*  FUNCTION                                               RELEASE        */
39
/*                                                                        */
40
/*    _gxe_radio_button_pixelmap_set                      PORTABLE C      */
41
/*                                                           6.1          */
42
/*  AUTHOR                                                                */
43
/*                                                                        */
44
/*    Kenneth Maxwell, Microsoft Corporation                              */
45
/*                                                                        */
46
/*  DESCRIPTION                                                           */
47
/*                                                                        */
48
/*    This function checks for errors in the checkbox pixlemap set routine*/
49
/*    button.                                                             */
50
/*                                                                        */
51
/*  INPUT                                                                 */
52
/*                                                                        */
53
/*    button                                Button control block          */
54
/*    off_id                                Resource ID of the pixelmap   */
55
/*                                            used for draw button off    */
56
/*    on_id                                 Resource ID of the pixelmap   */
57
/*                                            used for checke  d box      */
58
/*    off_disabled_id                       Resource ID of the pixelmap   */
59
/*                                            used for unchecked disabled */
60
/*                                             box                        */
61
/*    on_disabled_id                        Resource ID of the pixelmap   */
62
/*                                            used for checked disabled   */
63
/*                                            box                         */
64
/*                                                                        */
65
/*  OUTPUT                                                                */
66
/*                                                                        */
67
/*    status                                Completion status             */
68
/*                                                                        */
69
/*  CALLS                                                                 */
70
/*                                                                        */
71
/*    _gx_radio_button_pixelmap_set         Acutal pixelmap set function  */
72
/*                                                                        */
73
/*  CALLED BY                                                             */
74
/*                                                                        */
75
/*    Application Code                                                    */
76
/*                                                                        */
77
/**************************************************************************/
78
54
UINT  _gxe_radio_button_pixelmap_set(GX_RADIO_BUTTON *button,
79
                                     GX_RESOURCE_ID off_id,
80
                                     GX_RESOURCE_ID on_id,
81
                                     GX_RESOURCE_ID off_disabled_id,
82
                                     GX_RESOURCE_ID on_disabled_id)
83
{
84
UINT status;
85
86
    /* Check for appropriate caller.  */
87

54
    GX_INIT_AND_THREADS_CALLER_CHECKING
88
89
    /* Check for the invalid input pointers.  */
90
52
    if (button == GX_NULL)
91
    {
92
2
        return(GX_PTR_ERROR);
93
    }
94
95
    /* Check for invalid widget. */
96
50
    if (button->gx_widget_type == 0)
97
    {
98
1
        return(GX_INVALID_WIDGET);
99
    }
100
101
49
    status = _gx_radio_button_pixelmap_set(button, off_id, on_id,
102
                                           off_disabled_id, on_disabled_id);
103
104
49
    return(status);
105
}
106