GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_line_chart_create.c Lines: 8 8 100.0 %
Date: 2026-03-06 19:21:09 Branches: 2 2 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 Management (Line Chart)                                  */
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_window.h"
30
#include "gx_line_chart.h"
31
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gx_line_chart_create                               PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    Kenneth Maxwell, Microsoft Corporation                              */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    This function creates a GX_LINE_CHART widget                        */
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
/*    Completion Status                                                   */
60
/*                                                                        */
61
/*  CALLS                                                                 */
62
/*                                                                        */
63
/*    _gx_window_create                                                   */
64
/*    _gx_widget_link                                                     */
65
/*                                                                        */
66
/*  CALLED BY                                                             */
67
/*                                                                        */
68
/*    Application Code                                                    */
69
/*                                                                        */
70
/**************************************************************************/
71
328
UINT _gx_line_chart_create(GX_LINE_CHART *chart,
72
                           GX_CONST GX_CHAR *name,
73
                           GX_WIDGET *parent,
74
                           GX_CONST GX_LINE_CHART_INFO *info,
75
                           ULONG style,
76
                           USHORT chart_id,
77
                           GX_CONST GX_RECTANGLE *size)
78
{
79
80
328
    _gx_window_create((GX_WINDOW *) chart, name, parent, style, chart_id, size);
81
82
328
    chart -> gx_widget_draw_function =           (VOID (*)(GX_WIDGET *))_gx_line_chart_draw;
83
84
328
    chart -> gx_line_chart_info = *info;
85
328
    chart -> gx_widget_type = GX_TYPE_LINE_CHART;
86
87
328
    if (parent)
88
    {
89
327
        _gx_widget_link(parent, (GX_WIDGET *) chart);
90
    }
91
92
328
    return(GX_SUCCESS);
93
}