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 /**   System Management (System)                                          */
19 /**                                                                       */
20 /**************************************************************************/
21 
22 #define GX_SOURCE_CODE
23 
24 
25 /* Include necessary system files.  */
26 
27 #include "gx_api.h"
28 #include "gx_system.h"
29 #include "gx_widget.h"
30 #include "gx_utility.h"
31 
32 
33 /**************************************************************************/
34 /*                                                                        */
35 /*  FUNCTION                                               RELEASE        */
36 /*                                                                        */
37 /*    _gx_system_dirty_list_remove                        PORTABLE C      */
38 /*                                                           6.1          */
39 /*  AUTHOR                                                                */
40 /*                                                                        */
41 /*    Kenneth Maxwell, Microsoft Corporation                              */
42 /*                                                                        */
43 /*  DESCRIPTION                                                           */
44 /*                                                                        */
45 /*    This function removes a widget from the dirty list.                 */
46 /*                                                                        */
47 /*  INPUT                                                                 */
48 /*                                                                        */
49 /*    remove                                Widget to be removed          */
50 /*                                                                        */
51 /*  OUTPUT                                                                */
52 /*                                                                        */
53 /*    None                                                                */
54 /*                                                                        */
55 /*  CALLS                                                                 */
56 /*                                                                        */
57 /*    _gx_widget_child_detect               Detect a child widget         */
58 /*                                                                        */
59 /*  CALLED BY                                                             */
60 /*                                                                        */
61 /*    _gx_system_dirty_list_remove          Remove widget from dirty list */
62 /*                                                                        */
63 /*  RELEASE HISTORY                                                       */
64 /*                                                                        */
65 /*    DATE              NAME                      DESCRIPTION             */
66 /*                                                                        */
67 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
68 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
69 /*                                            resulting in version 6.1    */
70 /*                                                                        */
71 /**************************************************************************/
_gx_system_dirty_list_remove(GX_WIDGET * remove)72 VOID  _gx_system_dirty_list_remove(GX_WIDGET *remove)
73 {
74 GX_CANVAS     *canvas;
75 GX_DIRTY_AREA *dirty_entry;
76 UINT           index;
77 
78     /* pick up pointer to canvas */
79 
80     canvas = _gx_system_canvas_created_list;
81 
82     while (canvas)
83     {
84         /* Setup pointer to dirty list.  */
85 
86         dirty_entry = canvas -> gx_canvas_dirty_list;
87 
88         /* Check to see if widget already has an entry.  */
89         for (index = 0; index < canvas -> gx_canvas_dirty_count; index++)
90         {
91             /* Is the same widget is present. */
92             if (dirty_entry -> gx_dirty_area_widget)
93             {
94                 if (dirty_entry -> gx_dirty_area_widget == remove)
95                 {
96                     dirty_entry -> gx_dirty_area_widget = GX_NULL;
97                 }
98                 /* No need to test for the dirty list entry being a child of the widget being deleted,
99                    since child widgets are always deleted before the parent.
100                 */
101             }
102             dirty_entry++;
103         }
104         canvas = canvas -> gx_canvas_created_next;
105     }
106 }
107 
108