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 /**   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 /*  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_first_client_child_get(GX_WIDGET * parent)79 GX_WIDGET *_gx_widget_first_client_child_get(GX_WIDGET *parent)
80 {
81 GX_WIDGET *test = parent -> gx_widget_first_child;
82 
83     while (test && (test -> gx_widget_status & GX_STATUS_NONCLIENT))
84     {
85         test = test -> gx_widget_next;
86     }
87     return test;
88 }
89 
90 /**************************************************************************/
91 /*                                                                        */
92 /*  FUNCTION                                               RELEASE        */
93 /*                                                                        */
94 /*    _gx_first_visible_client_child_get                  PORTABLE C      */
95 /*                                                           6.1.7        */
96 /*  AUTHOR                                                                */
97 /*                                                                        */
98 /*    Ting Zhu, Microsoft Corporation                                     */
99 /*                                                                        */
100 /*  DESCRIPTION                                                           */
101 /*                                                                        */
102 /*    This function get the first client child that is visible.           */
103 /*                                                                        */
104 /*  INPUT                                                                 */
105 /*                                                                        */
106 /*    parent                                Pointer to parent widget      */
107 /*                                                                        */
108 /*  OUTPUT                                                                */
109 /*                                                                        */
110 /*    test                                  First visible client child    */
111 /*                                                                        */
112 /*  CALLS                                                                 */
113 /*                                                                        */
114 /*    None                                                                */
115 /*                                                                        */
116 /*  CALLED BY                                                             */
117 /*                                                                        */
118 /*    GUIX Internal Code                                                  */
119 /*                                                                        */
120 /*  RELEASE HISTORY                                                       */
121 /*                                                                        */
122 /*    DATE              NAME                      DESCRIPTION             */
123 /*                                                                        */
124 /*  06-02-2021     Ting Zhu                 Initial Version 6.1.7         */
125 /*                                                                        */
126 /**************************************************************************/
_gx_widget_first_visible_client_child_get(GX_WIDGET * parent)127 GX_WIDGET *_gx_widget_first_visible_client_child_get(GX_WIDGET *parent)
128 {
129 GX_WIDGET *test = parent -> gx_widget_first_child;
130 
131     while (test)
132     {
133         if (!(test -> gx_widget_status & GX_STATUS_NONCLIENT) &&
134             (test -> gx_widget_status & GX_STATUS_VISIBLE))
135         {
136 
137             /* Find the first child that is client and visible. */
138             return test;
139         }
140 
141         test = test -> gx_widget_next;
142     }
143 
144     return GX_NULL;
145 }
146 
147