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 |
|
|
/** Circular Gauge Management (Circular Gauge) */ |
19 |
|
|
/** */ |
20 |
|
|
/**************************************************************************/ |
21 |
|
|
|
22 |
|
|
#define GX_SOURCE_CODE |
23 |
|
|
|
24 |
|
|
|
25 |
|
|
/* Include necessary system files. */ |
26 |
|
|
|
27 |
|
|
#include "gx_api.h" |
28 |
|
|
#include "gx_circular_gauge.h" |
29 |
|
|
|
30 |
|
|
GX_CALLER_CHECKING_EXTERNS |
31 |
|
|
|
32 |
|
|
/**************************************************************************/ |
33 |
|
|
/* */ |
34 |
|
|
/* FUNCTION RELEASE */ |
35 |
|
|
/* */ |
36 |
|
|
/* _gxe_circular_gauge_create PORTABLE C */ |
37 |
|
|
/* 6.1 */ |
38 |
|
|
/* AUTHOR */ |
39 |
|
|
/* */ |
40 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
41 |
|
|
/* */ |
42 |
|
|
/* DESCRIPTION */ |
43 |
|
|
/* */ |
44 |
|
|
/* This function checks errors in circular gauge create call. */ |
45 |
|
|
/* */ |
46 |
|
|
/* INPUT */ |
47 |
|
|
/* */ |
48 |
|
|
/* circular_gauge Circular gauge control block */ |
49 |
|
|
/* name Name of the widget */ |
50 |
|
|
/* parent Parent widget control block */ |
51 |
|
|
/* circular_gauge_info Pointer to circular gauge info*/ |
52 |
|
|
/* style Style of circular gauge */ |
53 |
|
|
/* circular_gauge_id Application-defined ID of */ |
54 |
|
|
/* circular gauge */ |
55 |
|
|
/* size Dimensions of circular gauge */ |
56 |
|
|
/* */ |
57 |
|
|
/* OUTPUT */ |
58 |
|
|
/* */ |
59 |
|
|
/* status Completion status */ |
60 |
|
|
/* */ |
61 |
|
|
/* CALLS */ |
62 |
|
|
/* */ |
63 |
|
|
/* _gx_circular_gauge_create Actual circular gauge create. */ |
64 |
|
|
/* */ |
65 |
|
|
/* CALLED BY */ |
66 |
|
|
/* */ |
67 |
|
|
/* Application Code */ |
68 |
|
|
/* */ |
69 |
|
|
/**************************************************************************/ |
70 |
|
458 |
UINT _gxe_circular_gauge_create(GX_CIRCULAR_GAUGE *circular_gauge, |
71 |
|
|
GX_CONST GX_CHAR *name, |
72 |
|
|
GX_WIDGET *parent, |
73 |
|
|
GX_CIRCULAR_GAUGE_INFO *circular_gauge_info, |
74 |
|
|
GX_RESOURCE_ID background, |
75 |
|
|
ULONG style, |
76 |
|
|
USHORT circular_gauge_id, |
77 |
|
|
GX_VALUE xpos, GX_VALUE ypos, UINT checkbox_control_block_size) |
78 |
|
|
{ |
79 |
|
|
UINT status; |
80 |
|
|
|
81 |
|
|
/* Check for appropriate caller. */ |
82 |
✓✓✓✓ ✓✓ |
458 |
GX_INIT_AND_THREADS_CALLER_CHECKING |
83 |
|
|
|
84 |
|
|
/* Check for invalid input pointers. */ |
85 |
✓✓✓✓
|
456 |
if ((circular_gauge == GX_NULL) || (circular_gauge_info == GX_NULL)) |
86 |
|
|
{ |
87 |
|
3 |
return(GX_PTR_ERROR); |
88 |
|
|
} |
89 |
|
|
|
90 |
✓✓ |
453 |
if (checkbox_control_block_size != sizeof(GX_CIRCULAR_GAUGE)) |
91 |
|
|
{ |
92 |
|
1 |
return(GX_INVALID_SIZE); |
93 |
|
|
} |
94 |
|
|
|
95 |
|
|
/* Check for widget already created. */ |
96 |
✓✓ |
452 |
if (circular_gauge -> gx_widget_type != 0) |
97 |
|
|
{ |
98 |
|
1 |
return(GX_ALREADY_CREATED); |
99 |
|
|
} |
100 |
|
|
|
101 |
|
|
/* Call the actual gauge create function. */ |
102 |
|
451 |
status = _gx_circular_gauge_create(circular_gauge, name, parent, |
103 |
|
|
circular_gauge_info, background, |
104 |
|
|
style, circular_gauge_id, xpos, ypos); |
105 |
|
|
|
106 |
|
451 |
return status; |
107 |
|
|
} |
108 |
|
|
|