GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_widget_next_client_child_get.c Lines: 15 15 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
/**   Window Management (Window)                                          */
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
#include "gx_window.h"
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gx_next_client_child_get                           PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function get the next client child.                            */
44
/*                                                                        */
45
/*  INPUT                                                                 */
46
/*                                                                        */
47
/*    start                                Pointer to starting widget     */
48
/*                                                                        */
49
/*  OUTPUT                                                                */
50
/*                                                                        */
51
/*    child                                Next client child              */
52
/*                                                                        */
53
/*  CALLS                                                                 */
54
/*                                                                        */
55
/*    None                                                                */
56
/*                                                                        */
57
/*  CALLED BY                                                             */
58
/*                                                                        */
59
/*    _gx_drop_list_event_process                                         */
60
/*    _gx_horizontal_list_event_process                                   */
61
/*    _gx_horizontal_list_left_wrap                                       */
62
/*    _gx_horizontal_list_right_wrap                                      */
63
/*    _gx_horizontal_list_scroll_info_get                                 */
64
/*    _gx_horizontal_list_slide_back_check                                */
65
/*    _gx_vertical_list_down_wrap                                         */
66
/*    _gx_vertical_list_event_process                                     */
67
/*    _gx_vertical_list_scroll_info_get                                   */
68
/*    _gx_vertical_list_slide_back_check                                  */
69
/*    _gx_vertical_list_up_wrap                                           */
70
/*                                                                        */
71
/**************************************************************************/
72
8541
GX_WIDGET *_gx_widget_next_client_child_get(GX_WIDGET *start)
73
{
74
8541
GX_WIDGET *child = start -> gx_widget_next;
75
76
9838
    while (child)
77
    {
78
8202
        if (!(child -> gx_widget_status & GX_STATUS_NONCLIENT))
79
        {
80
6905
            break;
81
        }
82
1297
        child = child -> gx_widget_next;
83
    }
84
8541
    return child;
85
}
86
87
/**************************************************************************/
88
/*                                                                        */
89
/*  FUNCTION                                               RELEASE        */
90
/*                                                                        */
91
/*    _gx_widget_next_visible_client_child_get            PORTABLE C      */
92
/*                                                           6.1.7        */
93
/*  AUTHOR                                                                */
94
/*                                                                        */
95
/*    Ting Zhu, Microsoft Corporation                                     */
96
/*                                                                        */
97
/*  DESCRIPTION                                                           */
98
/*                                                                        */
99
/*    This function get the next client child that is visible.            */
100
/*                                                                        */
101
/*  INPUT                                                                 */
102
/*                                                                        */
103
/*    start                                Pointer to starting widget     */
104
/*                                                                        */
105
/*  OUTPUT                                                                */
106
/*                                                                        */
107
/*    child                                Next visible client child      */
108
/*                                                                        */
109
/*  CALLS                                                                 */
110
/*                                                                        */
111
/*    None                                                                */
112
/*                                                                        */
113
/*  CALLED BY                                                             */
114
/*                                                                        */
115
/*    GUIX Internal Code                                                  */
116
/*                                                                        */
117
/**************************************************************************/
118
2436
GX_WIDGET *_gx_widget_next_visible_client_child_get(GX_WIDGET *start)
119
{
120
2436
GX_WIDGET *child = start -> gx_widget_next;
121
122
2602
    while (child)
123
    {
124
2299
        if (!(child -> gx_widget_status & GX_STATUS_NONCLIENT) &&
125
2262
            (child -> gx_widget_status & GX_STATUS_VISIBLE))
126
        {
127
128
        	/* Find the next child that is client and visible. */
129
2133
            return child;
130
        }
131
166
        child = child -> gx_widget_next;
132
    }
133
303
    return GX_NULL;
134
}
135