GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_widget_show.c Lines: 18 18 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_system.h"
29
#include "gx_widget.h"
30
#include "gx_window.h"
31
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gx_widget_show                                     PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    Kenneth Maxwell, Microsoft Corporation                              */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    This function shows the widget.                                     */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    widget                                Pointer to widget             */
50
/*                                                                        */
51
/*  OUTPUT                                                                */
52
/*                                                                        */
53
/*    status                                Completion status             */
54
/*                                                                        */
55
/*  CALLS                                                                 */
56
/*                                                                        */
57
/*    [gx_widget_event_process_function]    Call widget event processing  */
58
/*    _gx_widget_clipping_update            Update the clipping area      */
59
/*    _gx_system_dirty_mark                 Mark a widget as dirty        */
60
/*    _gx_window_view_update_detect         Detect window view area for   */
61
/*                                            update                      */
62
/*                                                                        */
63
/*  CALLED BY                                                             */
64
/*                                                                        */
65
/*    Application Code                                                    */
66
/*    GUIX Internal Code                                                  */
67
/*                                                                        */
68
/**************************************************************************/
69
4781
UINT  _gx_widget_show(GX_WIDGET *widget)
70
{
71
GX_EVENT   show_event;
72
GX_WINDOW *win;
73
74
4781
    show_event.gx_event_target = GX_NULL;
75
4781
    widget -> gx_widget_status &= ~GX_STATUS_HIDDEN;
76
77
4781
    if (!(widget -> gx_widget_status & GX_STATUS_VISIBLE))
78
    {
79
        /* Send a GX_SHOW event to widget and all children of the widget.  */
80
3733
        show_event.gx_event_type = GX_EVENT_SHOW;
81
82
        /* Call widget's event processing.  */
83
3733
        widget -> gx_widget_event_process_function(widget, &show_event);
84
85
        /* update the clipping for this widget */
86
3733
        _gx_widget_clipping_update(widget);
87
88
3733
        _gx_system_dirty_mark(widget);
89
90
3733
        if (widget -> gx_widget_type >= GX_TYPE_WINDOW)
91
        {
92
1922
            win = (GX_WINDOW *)widget;
93
1922
            if (win -> gx_window_views)
94
            {
95
8
                _gx_system_views_free(win -> gx_window_views);
96
8
                win -> gx_window_views = GX_NULL;
97
            }
98
1922
            _gx_window_view_update_detect(win);
99
        }
100
101
3733
        if ((widget -> gx_widget_status & GX_STATUS_ACCEPTS_FOCUS) &&
102
1938
            widget -> gx_widget_parent)
103
        {
104
        	/* if this widget was part of navigation order, re-create nav order list */
105
1091
            _gx_widget_nav_order_initialize(widget -> gx_widget_parent);
106
        }
107
    }
108
109
    /* Return successful completion.  */
110
4781
    return(GX_SUCCESS);
111
}
112