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 (Radial 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_radial_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_radial_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 radial progress bar create */ |
46 |
|
|
/* call. */ |
47 |
|
|
/* */ |
48 |
|
|
/* INPUT */ |
49 |
|
|
/* */ |
50 |
|
|
/* progress_bar Progress Bar control block */ |
51 |
|
|
/* name Name of radial progress bar */ |
52 |
|
|
/* parent Pointer to parent widget */ |
53 |
|
|
/* info Pointer to radial progress */ |
54 |
|
|
/* bar info. */ |
55 |
|
|
/* style Style of radial progress bar */ |
56 |
|
|
/* id Application-defined ID of */ |
57 |
|
|
/* progress bar */ |
58 |
|
|
/* size Dimensions of radial progress */ |
59 |
|
|
/* bar */ |
60 |
|
|
/* */ |
61 |
|
|
/* OUTPUT */ |
62 |
|
|
/* */ |
63 |
|
|
/* status Completion status */ |
64 |
|
|
/* */ |
65 |
|
|
/* CALLS */ |
66 |
|
|
/* */ |
67 |
|
|
/* _gx_radial_progress_bar_create Actual radial progress bar */ |
68 |
|
|
/* create call */ |
69 |
|
|
/* */ |
70 |
|
|
/* CALLED BY */ |
71 |
|
|
/* */ |
72 |
|
|
/* Application Code */ |
73 |
|
|
/* */ |
74 |
|
|
/**************************************************************************/ |
75 |
|
790 |
UINT _gxe_radial_progress_bar_create(GX_RADIAL_PROGRESS_BAR *progress_bar, |
76 |
|
|
GX_CONST GX_CHAR *name, |
77 |
|
|
GX_WIDGET *parent, |
78 |
|
|
GX_RADIAL_PROGRESS_BAR_INFO *info, |
79 |
|
|
ULONG style, |
80 |
|
|
USHORT id, |
81 |
|
|
UINT progress_bar_control_block_size) |
82 |
|
|
{ |
83 |
|
|
UINT status; |
84 |
|
|
|
85 |
|
|
/* Check for invalid caller. */ |
86 |
✓✓✓✓ ✓✓ |
790 |
GX_INIT_AND_THREADS_CALLER_CHECKING |
87 |
|
|
|
88 |
|
|
/* Check for invalid pointer. */ |
89 |
✓✓✓✓
|
788 |
if ((progress_bar == GX_NULL) || (info == GX_NULL)) |
90 |
|
|
{ |
91 |
|
2 |
return(GX_PTR_ERROR); |
92 |
|
|
} |
93 |
|
|
|
94 |
|
|
/* Check for invalid widget control block size. */ |
95 |
✓✓ |
786 |
if (progress_bar_control_block_size != sizeof(GX_RADIAL_PROGRESS_BAR)) |
96 |
|
|
{ |
97 |
|
1 |
return(GX_INVALID_SIZE); |
98 |
|
|
} |
99 |
|
|
|
100 |
|
|
/* Check for widget already created. */ |
101 |
✓✓ |
785 |
if (progress_bar -> gx_widget_type != 0) |
102 |
|
|
{ |
103 |
|
1 |
return(GX_ALREADY_CREATED); |
104 |
|
|
} |
105 |
|
|
|
106 |
|
|
/* Check for invalid parent widget. */ |
107 |
✓✓✓✓
|
784 |
if (parent && (parent -> gx_widget_type == 0)) |
108 |
|
|
{ |
109 |
|
1 |
return(GX_INVALID_WIDGET); |
110 |
|
|
} |
111 |
|
|
|
112 |
|
|
/* Call actual radial progress bar create function. */ |
113 |
|
783 |
status = _gx_radial_progress_bar_create(progress_bar, name, parent, info, style, id); |
114 |
|
|
|
115 |
|
|
/* Return completion status. */ |
116 |
|
783 |
return status; |
117 |
|
|
} |
118 |
|
|
|