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

955
    GX_INIT_AND_THREADS_CALLER_CHECKING
90
91
    /* Check error for valid pointer. */
92

953
    if ((prompt == GX_NULL) || (size == GX_NULL))
93
    {
94
2
        return(GX_PTR_ERROR);
95
    }
96
97
    /* Check for widget already created.  */
98
951
    if (prompt -> gx_widget_type != 0)
99
    {
100
1
        return(GX_ALREADY_CREATED);
101
    }
102
103
950
    if (control_block_size != sizeof(GX_NUMERIC_PIXELMAP_PROMPT))
104
    {
105
1
        return(GX_INVALID_SIZE);
106
    }
107
108
    /* Call actual numeric pixelmap prompt create. */
109
949
    status = _gx_numeric_pixelmap_prompt_create(prompt, name, parent, text_id, fill_id, style, pixelmap_prompt_id, size);
110
111
949
    return(status);
112
}
113