GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_window_root_delete.c Lines: 11 11 100.0 %
Date: 2026-03-06 19:21:09 Branches: 14 14 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_system.h"
29
#include "gx_window.h"
30
#include "gx_widget.h"
31
32
/* Bring in externs for caller checking code.  */
33
GX_CALLER_CHECKING_EXTERNS
34
/**************************************************************************/
35
/*                                                                        */
36
/*  FUNCTION                                               RELEASE        */
37
/*                                                                        */
38
/*    _gxe_window_root_delete                             PORTABLE C      */
39
/*                                                           6.1          */
40
/*  AUTHOR                                                                */
41
/*                                                                        */
42
/*    Kenneth Maxwell, Microsoft Corporation                              */
43
/*                                                                        */
44
/*  DESCRIPTION                                                           */
45
/*                                                                        */
46
/*    This function checks for errors in window root delete call.         */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    root_window                           Root window control block     */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    status                                Completion status             */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*    _gx_window_root_destory               Actual window root destory    */
59
/*                                            function                    */
60
/*                                                                        */
61
/*  CALLED BY                                                             */
62
/*                                                                        */
63
/*    Application Code                                                    */
64
/*                                                                        */
65
/**************************************************************************/
66
10
UINT  _gxe_window_root_delete(GX_WINDOW_ROOT *root_window)
67
{
68
UINT status;
69
70
    /* Check for appropriate caller.  */
71

10
    GX_INIT_AND_THREADS_CALLER_CHECKING
72
73
    /* Check for invalid input pointers.  */
74
8
    if (!root_window)
75
    {
76
2
        return(GX_PTR_ERROR);
77
    }
78
79
    /* Check for invalid widget. */
80
6
    if (root_window -> gx_widget_type == 0)
81
    {
82
1
        return(GX_INVALID_WIDGET);
83
    }
84
85
5
    if (root_window -> gx_widget_style & (GX_STYLE_TEXT_COPY | GX_STATUS_DYNAMICALLY_ALLOCATED))
86
    {
87
2
        if (_gx_system_memory_free == GX_NULL)
88
        {
89
1
            return(GX_SYSTEM_MEMORY_ERROR);
90
        }
91
    }
92
93
    /* Call actual window root destory function.  */
94
4
    status = _gx_window_root_delete(root_window);
95
96
4
    return(status);
97
}
98