1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
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 /*  RELEASE HISTORY                                                       */
71 /*                                                                        */
72 /*    DATE              NAME                      DESCRIPTION             */
73 /*                                                                        */
74 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
75 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
76 /*                                            resulting in version 6.1    */
77 /*                                                                        */
78 /**************************************************************************/
_gx_line_chart_create(GX_LINE_CHART * chart,GX_CONST GX_CHAR * name,GX_WIDGET * parent,GX_CONST GX_LINE_CHART_INFO * info,ULONG style,USHORT chart_id,GX_CONST GX_RECTANGLE * size)79 UINT _gx_line_chart_create(GX_LINE_CHART *chart,
80                            GX_CONST GX_CHAR *name,
81                            GX_WIDGET *parent,
82                            GX_CONST GX_LINE_CHART_INFO *info,
83                            ULONG style,
84                            USHORT chart_id,
85                            GX_CONST GX_RECTANGLE *size)
86 {
87 
88     _gx_window_create((GX_WINDOW *) chart, name, parent, style, chart_id, size);
89 
90     chart -> gx_widget_draw_function =           (VOID (*)(GX_WIDGET *))_gx_line_chart_draw;
91 
92     chart -> gx_line_chart_info = *info;
93     chart -> gx_widget_type = GX_TYPE_LINE_CHART;
94 
95     if (parent)
96     {
97         _gx_widget_link(parent, (GX_WIDGET *) chart);
98     }
99 
100     return(GX_SUCCESS);
101 }
102