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 /**   Widget Management (Widget)                                          */
19 /**                                                                       */
20 /**************************************************************************/
21 
22 #define GX_SOURCE_CODE
23 
24 
25 /* Include necessary system files.  */
26 
27 #include "gx_api.h"
28 #include "gx_canvas.h"
29 #include "gx_system.h"
30 
31 /* Bring in externs for caller checking code.  */
32 GX_CALLER_CHECKING_EXTERNS
33 
34 /**************************************************************************/
35 /*                                                                        */
36 /*  FUNCTION                                               RELEASE        */
37 /*                                                                        */
38 /*    _gxe_canvas_ellipse_draw                            PORTABLE C      */
39 /*                                                           6.1          */
40 /*  AUTHOR                                                                */
41 /*                                                                        */
42 /*    Kenneth Maxwell, Microsoft Corporation                              */
43 /*                                                                        */
44 /*  DESCRIPTION                                                           */
45 /*                                                                        */
46 /*    This function checks for errors in canvas ellipse draw function     */
47 /*    call.                                                               */
48 /*                                                                        */
49 /*  INPUT                                                                 */
50 /*                                                                        */
51 /*    xcenter                               x-coord of center of ellipse  */
52 /*    ycenter                               y-coord of center of ellipse  */
53 /*    r                                     Radius of circle              */
54 /*    a                                     Length of the Semi-major Axis */
55 /*    b                                     Length of the Semi-minor Axis */
56 /*                                                                        */
57 /*  OUTPUT                                                                */
58 /*                                                                        */
59 /*    status                                Completion status             */
60 /*                                                                        */
61 /*  CALLS                                                                 */
62 /*                                                                        */
63 /*    _gx_canvas_ellipse_draw               Actual canvas ellipse draw    */
64 /*                                            function                    */
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 /**************************************************************************/
_gxe_canvas_ellipse_draw(INT xcenter,INT ycenter,INT a,INT b)79 UINT _gxe_canvas_ellipse_draw(INT xcenter, INT ycenter, INT a, INT b)
80 {
81 UINT status;
82 
83     /* Check for appropriate caller.  */
84     GX_INIT_AND_THREADS_CALLER_CHECKING
85 
86     /* Check for invalid input values.  */
87     if ((a <= 0) || (b <= 0))
88     {
89         return(GX_INVALID_VALUE);
90     }
91 
92     /* Check for invalid draw context. */
93     if (_gx_system_current_draw_context == GX_NULL)
94     {
95         return GX_INVALID_CONTEXT;
96     }
97 
98     /* Call actual widget draw function.  */
99     status = _gx_canvas_ellipse_draw(xcenter, ycenter, a, b);
100 
101     /* Return completion status.  */
102     return(status);
103 }
104 
105