GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_widget_first_client_child_get.c Lines: 13 13 100.0 %
Date: 2026-03-06 19:21:09 Branches: 10 10 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
/**   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_widget.h"
29
30
/**************************************************************************/
31
/*                                                                        */
32
/*  FUNCTION                                               RELEASE        */
33
/*                                                                        */
34
/*    _gx_first_client_child_get                          PORTABLE C      */
35
/*                                                           6.1          */
36
/*  AUTHOR                                                                */
37
/*                                                                        */
38
/*    Kenneth Maxwell, Microsoft Corporation                              */
39
/*                                                                        */
40
/*  DESCRIPTION                                                           */
41
/*                                                                        */
42
/*    This function get the first client child.                           */
43
/*                                                                        */
44
/*  INPUT                                                                 */
45
/*                                                                        */
46
/*    parent                                Pointer to parent widget      */
47
/*                                                                        */
48
/*  OUTPUT                                                                */
49
/*                                                                        */
50
/*    test                                  First client child            */
51
/*                                                                        */
52
/*  CALLS                                                                 */
53
/*                                                                        */
54
/*    None                                                                */
55
/*                                                                        */
56
/*  CALLED BY                                                             */
57
/*                                                                        */
58
/*    _gx_drop_list_event_process                                         */
59
/*    _gx_horizontal_list_event_process                                   */
60
/*    _gx_horizontal_list_left_wrap                                       */
61
/*    _gx_horizontal_list_right_wrap                                      */
62
/*    _gx_horizontal_list_scroll_info_get                                 */
63
/*    _gx_horizontal_list_slide_back_check                                */
64
/*    _gx_vertical_list_down_wrap                                         */
65
/*    _gx_vertical_list_event_process                                     */
66
/*    _gx_vertical_list_scroll_info_get                                   */
67
/*    _gx_vertical_list_slide_back_check                                  */
68
/*    _gx_vertical_list_up_wrap                                           */
69
/*                                                                        */
70
/**************************************************************************/
71
12535
GX_WIDGET *_gx_widget_first_client_child_get(GX_WIDGET *parent)
72
{
73
12535
GX_WIDGET *test = parent -> gx_widget_first_child;
74
75

14578
    while (test && (test -> gx_widget_status & GX_STATUS_NONCLIENT))
76
    {
77
2043
        test = test -> gx_widget_next;
78
    }
79
12535
    return test;
80
}
81
82
/**************************************************************************/
83
/*                                                                        */
84
/*  FUNCTION                                               RELEASE        */
85
/*                                                                        */
86
/*    _gx_first_visible_client_child_get                  PORTABLE C      */
87
/*                                                           6.1.7        */
88
/*  AUTHOR                                                                */
89
/*                                                                        */
90
/*    Ting Zhu, Microsoft Corporation                                     */
91
/*                                                                        */
92
/*  DESCRIPTION                                                           */
93
/*                                                                        */
94
/*    This function get the first client child that is visible.           */
95
/*                                                                        */
96
/*  INPUT                                                                 */
97
/*                                                                        */
98
/*    parent                                Pointer to parent widget      */
99
/*                                                                        */
100
/*  OUTPUT                                                                */
101
/*                                                                        */
102
/*    test                                  First visible client child    */
103
/*                                                                        */
104
/*  CALLS                                                                 */
105
/*                                                                        */
106
/*    None                                                                */
107
/*                                                                        */
108
/*  CALLED BY                                                             */
109
/*                                                                        */
110
/*    GUIX Internal Code                                                  */
111
/*                                                                        */
112
/**************************************************************************/
113
590
GX_WIDGET *_gx_widget_first_visible_client_child_get(GX_WIDGET *parent)
114
{
115
590
GX_WIDGET *test = parent -> gx_widget_first_child;
116
117
808
    while (test)
118
    {
119
773
        if (!(test -> gx_widget_status & GX_STATUS_NONCLIENT) &&
120
768
            (test -> gx_widget_status & GX_STATUS_VISIBLE))
121
        {
122
123
            /* Find the first child that is client and visible. */
124
555
            return test;
125
        }
126
127
218
        test = test -> gx_widget_next;
128
    }
129
130
35
    return GX_NULL;
131
}
132