GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_line_chart_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
/**   Line Chart  (Chart)                                                 */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_widget.h"
28
#include "gx_line_chart.h"
29
30
/* Bring in externs for caller checking code.  */
31
GX_CALLER_CHECKING_EXTERNS
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gxe_line_chart_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 line chart create function.  */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    chart                                 GX_LINE_CHART control block   */
50
/*    name                                  Logical name of icon widget   */
51
/*    parent                                Pointer to the parent widget  */
52
/*    info                                  chart drawing parameters      */
53
/*    style                                 chart style flags             */
54
/*    chart_id                              chart ID                      */
55
/*    size                                  chart size                    */
56
/*                                                                        */
57
/*  OUTPUT                                                                */
58
/*                                                                        */
59
/*    status                                Completion status             */
60
/*                                                                        */
61
/*  CALLS                                                                 */
62
/*                                                                        */
63
/*    _gx_line_chart_create                 Actual line chart create call */
64
/*                                                                        */
65
/*  CALLED BY                                                             */
66
/*                                                                        */
67
/*    Application Code                                                    */
68
/*                                                                        */
69
/**************************************************************************/
70
334
UINT  _gxe_line_chart_create(GX_LINE_CHART *chart,
71
                             GX_CONST GX_CHAR *name,
72
                             GX_WIDGET *parent,
73
                             GX_CONST GX_LINE_CHART_INFO *info,
74
                             ULONG style,
75
                             USHORT chart_id,
76
                             GX_CONST GX_RECTANGLE *size,
77
                             UINT control_block_size)
78
{
79
UINT status;
80
81
    /* Check for appropriate caller.  */
82

334
    GX_INIT_AND_THREADS_CALLER_CHECKING
83
84
    /* Check for invalid input pointers.  */
85

332
    if ((chart == GX_NULL) || (size == GX_NULL))
86
    {
87
2
        return(GX_PTR_ERROR);
88
    }
89
90
330
    if (control_block_size != sizeof(GX_LINE_CHART))
91
    {
92
1
        return(GX_INVALID_SIZE);
93
    }
94
95
    /* Check for widget already created.  */
96
329
    if (chart -> gx_widget_type != 0)
97
    {
98
1
        return(GX_ALREADY_CREATED);
99
    }
100
101
    /* Call the actual icon button create function.  */
102
328
    status = _gx_line_chart_create(chart, name, parent, info, style, chart_id, size);
103
104
    /* Return completion status.  */
105
328
    return status;
106
}
107