| 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 |  |  | /**   Circular Gauge Management (Circular Gauge)                          */ | 
    
    | 18 |  |  | /**                                                                       */ | 
    
    | 19 |  |  | /**************************************************************************/ | 
    
    | 20 |  |  |  | 
    
    | 21 |  |  | #define GX_SOURCE_CODE | 
    
    | 22 |  |  |  | 
    
    | 23 |  |  |  | 
    
    | 24 |  |  | /* Include necessary system files.  */ | 
    
    | 25 |  |  |  | 
    
    | 26 |  |  | #include "gx_api.h" | 
    
    | 27 |  |  | #include "gx_system.h" | 
    
    | 28 |  |  | #include "gx_utility.h" | 
    
    | 29 |  |  | #include "gx_circular_gauge.h" | 
    
    | 30 |  |  |  | 
    
    | 31 |  |  |  | 
    
    | 32 |  |  | /**************************************************************************/ | 
    
    | 33 |  |  | /*                                                                        */ | 
    
    | 34 |  |  | /*  FUNCTION                                               RELEASE        */ | 
    
    | 35 |  |  | /*                                                                        */ | 
    
    | 36 |  |  | /*    _gx_circular_gauge_needle_dirty_mark                PORTABLE C      */ | 
    
    | 37 |  |  | /*                                                           6.1          */ | 
    
    | 38 |  |  | /*  AUTHOR                                                                */ | 
    
    | 39 |  |  | /*                                                                        */ | 
    
    | 40 |  |  | /*    Kenneth Maxwell, Microsoft Corporation                              */ | 
    
    | 41 |  |  | /*                                                                        */ | 
    
    | 42 |  |  | /*  DESCRIPTION                                                           */ | 
    
    | 43 |  |  | /*                                                                        */ | 
    
    | 44 |  |  | /*    This function calculates current needle rectangle.                  */ | 
    
    | 45 |  |  | /*                                                                        */ | 
    
    | 46 |  |  | /*  INPUT                                                                 */ | 
    
    | 47 |  |  | /*                                                                        */ | 
    
    | 48 |  |  | /*    circular_gauge                        Circular gauge control block  */ | 
    
    | 49 |  |  | /*                                                                        */ | 
    
    | 50 |  |  | /*  OUTPUT                                                                */ | 
    
    | 51 |  |  | /*                                                                        */ | 
    
    | 52 |  |  | /*    status                                Completion status             */ | 
    
    | 53 |  |  | /*                                                                        */ | 
    
    | 54 |  |  | /*  CALLS                                                                 */ | 
    
    | 55 |  |  | /*                                                                        */ | 
    
    | 56 |  |  | /*    _gx_circular_gauge_needle_rectangle_calculate                       */ | 
    
    | 57 |  |  | /*                                          Calculate the needle          */ | 
    
    | 58 |  |  | /*                                            rectangle                   */ | 
    
    | 59 |  |  | /*    _gx_system_dirty_partial_add          Add partial dirty area        */ | 
    
    | 60 |  |  | /*                                                                        */ | 
    
    | 61 |  |  | /*  CALLED BY                                                             */ | 
    
    | 62 |  |  | /*                                                                        */ | 
    
    | 63 |  |  | /*    Application Code                                                    */ | 
    
    | 64 |  |  | /*                                                                        */ | 
    
    | 65 |  |  | /*  RELEASE HISTORY                                                       */ | 
    
    | 66 |  |  | /*                                                                        */ | 
    
    | 67 |  |  | /*    DATE              NAME                      DESCRIPTION             */ | 
    
    | 68 |  |  | /*                                                                        */ | 
    
    | 69 |  |  | /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */ | 
    
    | 70 |  |  | /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */ | 
    
    | 71 |  |  | /*                                            resulting in version 6.1    */ | 
    
    | 72 |  |  | /*                                                                        */ | 
    
    | 73 |  |  | /**************************************************************************/ | 
    
    | 74 |  | 1694 | UINT  _gx_circular_gauge_needle_dirty_mark(GX_CIRCULAR_GAUGE *gauge) | 
    
    | 75 |  |  | { | 
    
    | 76 |  |  | GX_RECTANGLE            dirty_rect; | 
    
    | 77 |  |  |  | 
    
    | 78 |  |  |     /* Get last needle rectangle. */ | 
    
    | 79 |  | 1694 |     dirty_rect = gauge -> gx_circular_gauge_current_needle_rectangle; | 
    
    | 80 |  |  |  | 
    
    | 81 |  |  |     /*Caculate the new needle rectangle. */ | 
    
    | 82 |  | 1694 |     _gx_circular_gauge_needle_rectangle_calculate(gauge, gauge->gx_circular_gauge_current_angle, &(gauge->gx_circular_gauge_current_needle_rectangle)); | 
    
    | 83 |  |  |  | 
    
    | 84 |  |  |     /* Combine last and current needle rectangle.  */ | 
    
    | 85 |  | 1694 |     _gx_utility_rectangle_combine(&dirty_rect, &(gauge->gx_circular_gauge_current_needle_rectangle)); | 
    
    | 86 |  |  |  | 
    
    | 87 |  |  |     /* Mark the combine area as dirty.  */ | 
    
    | 88 |  | 1694 |     _gx_system_dirty_partial_add((GX_WIDGET *)gauge, &dirty_rect); | 
    
    | 89 |  |  |  | 
    
    | 90 |  | 1694 |     return(GX_SUCCESS); | 
    
    | 91 |  |  | } | 
    
    | 92 |  |  |  |