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 /**   Window Management (Window)                                          */
18 /**                                                                       */
19 /**************************************************************************/
20 
21 #define GX_SOURCE_CODE
22 
23 
24 /* Include necessary system files.  */
25 
26 #include "gx_api.h"
27 #include "gx_widget.h"
28 #include "gx_window.h"
29 
30 /**************************************************************************/
31 /*                                                                        */
32 /*  FUNCTION                                               RELEASE        */
33 /*                                                                        */
34 /*    _gx_next_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 next client child.                            */
43 /*                                                                        */
44 /*  INPUT                                                                 */
45 /*                                                                        */
46 /*    start                                Pointer to starting widget     */
47 /*                                                                        */
48 /*  OUTPUT                                                                */
49 /*                                                                        */
50 /*    child                                Next 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 /*  RELEASE HISTORY                                                       */
71 /*                                                                        */
72 /*    DATE              NAME                      DESCRIPTION             */
73 /*                                                                        */
74 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
75 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
76 /*                                            resulting in version 6.1    */
77 /*                                                                        */
78 /**************************************************************************/
_gx_widget_next_client_child_get(GX_WIDGET * start)79 GX_WIDGET *_gx_widget_next_client_child_get(GX_WIDGET *start)
80 {
81 GX_WIDGET *child = start -> gx_widget_next;
82 
83     while (child)
84     {
85         if (!(child -> gx_widget_status & GX_STATUS_NONCLIENT))
86         {
87             break;
88         }
89         child = child -> gx_widget_next;
90     }
91     return child;
92 }
93 
94 /**************************************************************************/
95 /*                                                                        */
96 /*  FUNCTION                                               RELEASE        */
97 /*                                                                        */
98 /*    _gx_widget_next_visible_client_child_get            PORTABLE C      */
99 /*                                                           6.1.7        */
100 /*  AUTHOR                                                                */
101 /*                                                                        */
102 /*    Ting Zhu, Microsoft Corporation                                     */
103 /*                                                                        */
104 /*  DESCRIPTION                                                           */
105 /*                                                                        */
106 /*    This function get the next client child that is visible.            */
107 /*                                                                        */
108 /*  INPUT                                                                 */
109 /*                                                                        */
110 /*    start                                Pointer to starting widget     */
111 /*                                                                        */
112 /*  OUTPUT                                                                */
113 /*                                                                        */
114 /*    child                                Next visible client child      */
115 /*                                                                        */
116 /*  CALLS                                                                 */
117 /*                                                                        */
118 /*    None                                                                */
119 /*                                                                        */
120 /*  CALLED BY                                                             */
121 /*                                                                        */
122 /*    GUIX Internal Code                                                  */
123 /*                                                                        */
124 /*  RELEASE HISTORY                                                       */
125 /*                                                                        */
126 /*    DATE              NAME                      DESCRIPTION             */
127 /*                                                                        */
128 /*  06-02-2021     Ting Zhu                 Initial Version 6.1.7         */
129 /*                                                                        */
130 /**************************************************************************/
_gx_widget_next_visible_client_child_get(GX_WIDGET * start)131 GX_WIDGET *_gx_widget_next_visible_client_child_get(GX_WIDGET *start)
132 {
133 GX_WIDGET *child = start -> gx_widget_next;
134 
135     while (child)
136     {
137         if (!(child -> gx_widget_status & GX_STATUS_NONCLIENT) &&
138             (child -> gx_widget_status & GX_STATUS_VISIBLE))
139         {
140 
141         	/* Find the next child that is client and visible. */
142             return child;
143         }
144         child = child -> gx_widget_next;
145     }
146     return GX_NULL;
147 }
148 
149