GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_progress_bar_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
/**   Progress Bar Management (Progress Bar)                              */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_progress_bar.h"
29
30
/* Bring in externs for caller checking code.  */
31
GX_CALLER_CHECKING_EXTERNS
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gxe_progress_bar_create                            PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    Kenneth Maxwell, Microsoft Corporation                              */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    This function checks for errors in the progress bar create call.    */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    progress_bar                          Progress Bar control block    */
50
/*    name                                  Name of prompt                */
51
/*    parent                                Parent widget control block   */
52
/*    progress_bar_info                     Pointer to progress bar info  */
53
/*    style                                 Style of progress bar         */
54
/*    progress_bar_id                       Application-defined ID of     */
55
/*                                            progress bar                */
56
/*    size                                  Dimensions of progress bar    */
57
/*                                                                        */
58
/*  OUTPUT                                                                */
59
/*                                                                        */
60
/*    status                                Completion status             */
61
/*                                                                        */
62
/*  CALLS                                                                 */
63
/*                                                                        */
64
/*    _gx_progress_bar_create               Actual progress bar create    */
65
/*                                             call                       */
66
/*                                                                        */
67
/*  CALLED BY                                                             */
68
/*                                                                        */
69
/*    Application Code                                                    */
70
/*                                                                        */
71
/**************************************************************************/
72
559
UINT  _gxe_progress_bar_create(GX_PROGRESS_BAR *progress_bar, GX_CONST GX_CHAR *name,
73
                               GX_WIDGET *parent,
74
                               GX_PROGRESS_BAR_INFO *progress_bar_info, ULONG style,
75
                               USHORT progress_bar_id,
76
                               GX_CONST GX_RECTANGLE *size,
77
                               UINT progress_bar_control_block_size)
78
{
79
UINT status;
80
81
    /* Check for invalid caller.  */
82

559
    GX_INIT_AND_THREADS_CALLER_CHECKING
83
84
    /* Check for invalid pointer.  */
85

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

553
    if (parent && (parent -> gx_widget_type == 0))
104
    {
105
1
        return(GX_INVALID_WIDGET);
106
    }
107
108
    /* Call actual progress bar create function.  */
109
552
    status = _gx_progress_bar_create(progress_bar, name, parent, progress_bar_info, style, progress_bar_id, size);
110
111
    /* Return completion status.  */
112
552
    return status;
113
}
114