GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_radio_button_create.c Lines: 12 12 100.0 %
Date: 2026-03-06 19:21:09 Branches: 18 18 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 (radio_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_button.h"
29
#include "gx_system.h"
30
31
/* Bring in externs for caller checking code.  */
32
GX_CALLER_CHECKING_EXTERNS
33
34
/**************************************************************************/
35
/*                                                                        */
36
/*  FUNCTION                                               RELEASE        */
37
/*                                                                        */
38
/*    _gxe_radio_button_create                            PORTABLE C      */
39
/*                                                           6.1          */
40
/*  AUTHOR                                                                */
41
/*                                                                        */
42
/*    Kenneth Maxwell, Microsoft Corporation                              */
43
/*                                                                        */
44
/*  DESCRIPTION                                                           */
45
/*                                                                        */
46
/*    This service checks for error in radio button create call.          */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    button                                Button control block          */
51
/*    name                                  Name of button                */
52
/*    parent                                Parent widget control block   */
53
/*    text_id                               text resource id              */
54
/*    style                                 Style of button               */
55
/*    radio_button_id                       Application-defined ID of     */
56
/*                                            radio button                */
57
/*    size                                  Button size                   */
58
/*    radio_button_control_block_size       Size of the radio button      */
59
/*                                            control block               */
60
/*                                                                        */
61
/*  OUTPUT                                                                */
62
/*                                                                        */
63
/*    status                                Completion status             */
64
/*                                                                        */
65
/*  CALLS                                                                 */
66
/*                                                                        */
67
/*    _gx_radio_button_create               The actual radio button       */
68
/*                                            create function             */
69
/*                                                                        */
70
/*  CALLED BY                                                             */
71
/*                                                                        */
72
/*    Application Code                                                    */
73
/*                                                                        */
74
/**************************************************************************/
75
5353
UINT  _gxe_radio_button_create(GX_RADIO_BUTTON *button, GX_CONST GX_CHAR *name, GX_WIDGET *parent,
76
                               GX_RESOURCE_ID text_id, ULONG style, USHORT radio_btton_id,
77
                               GX_CONST GX_RECTANGLE *size, UINT radio_button_control_block_size)
78
{
79
UINT status;
80
81
    /* Check for appropriate caller.  */
82

5353
    GX_INIT_AND_THREADS_CALLER_CHECKING
83
84
    /* Check error for valid pointer. */
85

5351
    if ((button == GX_NULL) || (size == GX_NULL))
86
    {
87
2
        return(GX_PTR_ERROR);
88
    }
89
90
    /* Check for widget already created.  */
91
5349
    if (button -> gx_widget_type != 0)
92
    {
93
1
        return(GX_ALREADY_CREATED);
94
    }
95
96
    /* Check for invalid control block size. */
97
5348
    if (radio_button_control_block_size != sizeof(GX_RADIO_BUTTON))
98
    {
99
1
        return(GX_INVALID_SIZE);
100
    }
101
102
    /* Check for invalid parent widget. */
103

5347
    if (parent && parent -> gx_widget_type == 0)
104
    {
105
1
        return(GX_INVALID_WIDGET);
106
    }
107
108
    /* Call the actual function.  */
109
5346
    status = _gx_radio_button_create(button, name, parent, text_id, style, radio_btton_id, size);
110
111
    /* Return completion status.  */
112
5346
    return(status);
113
}
114