GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_system_dirty_list_remove.c Lines: 11 11 100.0 %
Date: 2026-03-06 19:21:09 Branches: 8 8 100.0 %

Line Branch Exec Source
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
/**   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
/**************************************************************************/
64
331
VOID  _gx_system_dirty_list_remove(GX_WIDGET *remove)
65
{
66
GX_CANVAS     *canvas;
67
GX_DIRTY_AREA *dirty_entry;
68
UINT           index;
69
70
    /* pick up pointer to canvas */
71
72
331
    canvas = _gx_system_canvas_created_list;
73
74
958
    while (canvas)
75
    {
76
        /* Setup pointer to dirty list.  */
77
78
627
        dirty_entry = canvas -> gx_canvas_dirty_list;
79
80
        /* Check to see if widget already has an entry.  */
81
1879
        for (index = 0; index < canvas -> gx_canvas_dirty_count; index++)
82
        {
83
            /* Is the same widget is present. */
84
1252
            if (dirty_entry -> gx_dirty_area_widget)
85
            {
86
1019
                if (dirty_entry -> gx_dirty_area_widget == remove)
87
                {
88
72
                    dirty_entry -> gx_dirty_area_widget = GX_NULL;
89
                }
90
                /* No need to test for the dirty list entry being a child of the widget being deleted,
91
                   since child widgets are always deleted before the parent.
92
                */
93
            }
94
1252
            dirty_entry++;
95
        }
96
627
        canvas = canvas -> gx_canvas_created_next;
97
    }
98
331
}
99