GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_pixelmap_prompt_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
/**   Prompt Management (Prompt)                                          */
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_prompt.h"
30
#include "gx_system.h"
31
#include "gx_pixelmap_prompt.h"
32
33
/* Bring in externs for caller checking code.  */
34
GX_CALLER_CHECKING_EXTERNS
35
36
/**************************************************************************/
37
/*                                                                        */
38
/*  FUNCTION                                               RELEASE        */
39
/*                                                                        */
40
/*    _gxe_pixelmap_prompt_create                         PORTABLE C      */
41
/*                                                           6.1          */
42
/*  AUTHOR                                                                */
43
/*                                                                        */
44
/*    Kenneth Maxwell, Microsoft Corporation                              */
45
/*                                                                        */
46
/*  DESCRIPTION                                                           */
47
/*                                                                        */
48
/*    This function checks errors in the pixelmap prompt create function. */
49
/*                                                                        */
50
/*  INPUT                                                                 */
51
/*                                                                        */
52
/*    prompt                                Prompt control block          */
53
/*    name                                  Name of prompt                */
54
/*    parent                                Parent widget control block   */
55
/*    text_id                               Resource string id            */
56
/*    left_id                               pixelmap id for left end      */
57
/*    fill_id                               pixelmap id for fill area     */
58
/*    style                                 Style of checkbox             */
59
/*    prompt_id                             Application-defined ID of     */
60
/*                                            pixelmap prompt             */
61
/*    size                                  Prompt size                   */
62
/*    pixelmap_prompt_control_block_size    Size of the pixelmap prompt   */
63
/*                                            control block               */
64
/*                                                                        */
65
/*  OUTPUT                                                                */
66
/*                                                                        */
67
/*    status                                Completion status             */
68
/*                                                                        */
69
/*  CALLS                                                                 */
70
/*                                                                        */
71
/*    _gx_pixelmap_prompt_create            The actual function           */
72
/*                                                                        */
73
/*  CALLED BY                                                             */
74
/*                                                                        */
75
/*    Application Code                                                    */
76
/*                                                                        */
77
/**************************************************************************/
78
973
UINT  _gxe_pixelmap_prompt_create(GX_PIXELMAP_PROMPT *prompt,
79
                                  GX_CONST GX_CHAR *name,
80
                                  GX_WIDGET *parent, GX_RESOURCE_ID text_id,
81
                                  GX_RESOURCE_ID fill_id, ULONG style,
82
                                  USHORT prompt_id,
83
                                  GX_CONST GX_RECTANGLE *size,
84
                                  UINT pixelmap_prompt_control_block_size)
85
{
86
87
UINT status;
88
89
    /* Check for appropriate caller.  */
90

973
    GX_INIT_AND_THREADS_CALLER_CHECKING
91
92
    /* Check for invalid input pointers.  */
93

971
    if ((prompt == GX_NULL) || (size == GX_NULL))
94
    {
95
2
        return(GX_PTR_ERROR);
96
    }
97
98
    /* Check for invalid widget control block size. */
99
969
    if (pixelmap_prompt_control_block_size != sizeof(GX_PIXELMAP_PROMPT))
100
    {
101
1
        return(GX_INVALID_SIZE);
102
    }
103
104
    /* Check for widget already created.  */
105
968
    if (prompt -> gx_widget_type != 0)
106
    {
107
1
        return(GX_ALREADY_CREATED);
108
    }
109
110
967
    status = _gx_pixelmap_prompt_create(prompt, name, parent, text_id, fill_id, style, prompt_id, size);
111
967
    return(status);
112
}
113