GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_multi_line_text_button_create.c Lines: 10 10 100.0 %
Date: 2026-03-06 19:21:09 Branches: 14 14 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
/**   Text 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_button.h"
29
30
GX_CALLER_CHECKING_EXTERNS
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gxe_multi_line_text_button_create                  PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function checks for errors in the text button create function  */
45
/*    call.                                                               */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    button                                Button control block          */
50
/*    name                                  Name of button                */
51
/*    parent                                Parent widget control block   */
52
/*    text_id                               text resource id              */
53
/*    style                                 Style of button               */
54
/*    size                                  Button size                   */
55
/*    text_button_control_block_size        Size of the text button       */
56
/*                                            control block               */
57
/*                                                                        */
58
/*  OUTPUT                                                                */
59
/*                                                                        */
60
/*    status                                Completion status             */
61
/*                                                                        */
62
/*  CALLS                                                                 */
63
/*                                                                        */
64
/*    _gx_text_button_create                Actual text button create     */
65
/*                                          function                      */
66
/*                                                                        */
67
/*  CALLED BY                                                             */
68
/*                                                                        */
69
/*    Application Code                                                    */
70
/*                                                                        */
71
/**************************************************************************/
72
370
UINT  _gxe_multi_line_text_button_create(GX_MULTI_LINE_TEXT_BUTTON *button, GX_CONST GX_CHAR *name, GX_WIDGET *parent,
73
                                         GX_RESOURCE_ID text_id, ULONG style, USHORT Id,
74
                                         GX_CONST GX_RECTANGLE *size, UINT text_button_control_block_size)
75
{
76
77
UINT status;
78
79
    /* Check for appropriate caller.  */
80

370
    GX_INIT_AND_THREADS_CALLER_CHECKING
81
82
    /* Check for invalid input pointers.  */
83

368
    if ((button == GX_NULL) || (size == GX_NULL))
84
    {
85
2
        return(GX_PTR_ERROR);
86
    }
87
88
366
    if (text_button_control_block_size != sizeof(GX_MULTI_LINE_TEXT_BUTTON))
89
    {
90
1
        return(GX_INVALID_SIZE);
91
    }
92
93
    /* Check for id is created.  */
94
365
    if (button -> gx_widget_type != 0)
95
    {
96
1
        return GX_ALREADY_CREATED;
97
    }
98
99
    /* Call the actual text button create function.  */
100
364
    status = _gx_multi_line_text_button_create(button, name, parent, text_id, style, Id, size);
101
102
    /* Return completion status.  */
103
364
    return status;
104
}
105