1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 
12 /**************************************************************************/
13 /**************************************************************************/
14 /**                                                                       */
15 /** GUIX Component                                                        */
16 /**                                                                       */
17 /**   Progress Bar Management (Radial Progress Bar)                       */
18 /**                                                                       */
19 /**************************************************************************/
20 
21 #define GX_SOURCE_CODE
22 
23 /* Include necessary system files.  */
24 
25 #include "gx_api.h"
26 #include "gx_radial_progress_bar.h"
27 
28 /* Bring in externs for caller checking code.  */
29 GX_CALLER_CHECKING_EXTERNS
30 
31 /**************************************************************************/
32 /*                                                                        */
33 /*  FUNCTION                                               RELEASE        */
34 /*                                                                        */
35 /*    _gxe_radia_progress_bar_anchor_set                  PORTABLE C      */
36 /*                                                           6.1          */
37 /*  AUTHOR                                                                */
38 /*                                                                        */
39 /*    Kenneth Maxwell, Microsoft Corporation                              */
40 /*                                                                        */
41 /*  DESCRIPTION                                                           */
42 /*                                                                        */
43 /*    This function checks for errors in radial progress bar anchor set   */
44 /*      call.                                                             */
45 /*                                                                        */
46 /*                                                                        */
47 /*  INPUT                                                                 */
48 /*                                                                        */
49 /*    progress_bar                          Radial Progress Bar control   */
50 /*                                            block                       */
51 /*    angle                                 Starting angle of the circular*/
52 /*                                            arc                         */
53 /*                                                                        */
54 /*  OUTPUT                                                                */
55 /*                                                                        */
56 /*    status                                Completion status             */
57 /*                                                                        */
58 /*  CALLS                                                                 */
59 /*                                                                        */
60 /*    _gx_radial_progress_bar_anchor_set    Actual radial progress bar    */
61 /*                                            anchor set call             */
62 /*                                                                        */
63 /*  CALLED BY                                                             */
64 /*                                                                        */
65 /*    Application Code                                                    */
66 /*    GUIX Internal Code                                                  */
67 /*                                                                        */
68 /*  RELEASE HISTORY                                                       */
69 /*                                                                        */
70 /*    DATE              NAME                      DESCRIPTION             */
71 /*                                                                        */
72 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
73 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
74 /*                                            resulting in version 6.1    */
75 /*                                                                        */
76 /**************************************************************************/
_gxe_radial_progress_bar_anchor_set(GX_RADIAL_PROGRESS_BAR * progress_bar,GX_VALUE angle)77 UINT _gxe_radial_progress_bar_anchor_set(GX_RADIAL_PROGRESS_BAR *progress_bar, GX_VALUE angle)
78 {
79 UINT status;
80 
81     /* Check for invalid caller.  */
82     GX_INIT_AND_THREADS_CALLER_CHECKING
83 
84     /* Check for invalid pointer.  */
85     if (progress_bar == GX_NULL)
86     {
87         return(GX_PTR_ERROR);
88     }
89 
90     /* Check for invalid widget. */
91     if (progress_bar -> gx_widget_type == 0)
92     {
93         return(GX_INVALID_WIDGET);
94     }
95 
96     /* Call actual radial progress bar value set function.  */
97     status = _gx_radial_progress_bar_anchor_set(progress_bar, angle);
98 
99     /* Return completion status.  */
100     return(status);
101 }
102 
103