GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_window_root_create.c Lines: 12 12 100.0 %
Date: 2026-03-06 19:21:09 Branches: 16 16 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
31
/* Bring in externs for caller checking code.  */
32
GX_CALLER_CHECKING_EXTERNS
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gxe_window_root_create                             PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    Kenneth Maxwell, Microsoft Corporation                              */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    This function checks for errors in window root create function call.*/
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    root_window                           Root window control block     */
50
/*    name                                  Name of window                */
51
/*    canvas                                Canvas this root window       */
52
/*                                            belongs to                  */
53
/*    style                                 Style of window               */
54
/*    Id                                    User-specified root window ID */
55
/*    size                                  Window size                   */
56
/*                                                                        */
57
/*  OUTPUT                                                                */
58
/*                                                                        */
59
/*    status                                Completion status             */
60
/*                                                                        */
61
/*  CALLS                                                                 */
62
/*                                                                        */
63
/*    _gx_window_root_create                Actual root window create call*/
64
/*                                                                        */
65
/*  CALLED BY                                                             */
66
/*                                                                        */
67
/*    Application Code                                                    */
68
/*                                                                        */
69
/**************************************************************************/
70
1196
UINT  _gxe_window_root_create(GX_WINDOW_ROOT *root_window,
71
                              GX_CONST GX_CHAR *name, GX_CANVAS *canvas,
72
                              ULONG style, USHORT Id, GX_CONST GX_RECTANGLE *size, UINT root_window_control_block_size)
73
{
74
UINT status;
75
76
    /* Check for appropriate caller.  */
77

1196
    GX_INIT_AND_THREADS_CALLER_CHECKING
78
79
    /* Check for invalid input pointers.  */
80

1194
    if ((root_window == GX_NULL) || (size == GX_NULL))
81
    {
82
2
        return(GX_PTR_ERROR);
83
    }
84
85
    /* Check for invalid input pointers.  */
86
1192
    if (canvas == GX_NULL)
87
    {
88
1
        return(GX_PTR_ERROR);
89
    }
90
91
    /* Check for invalid widget control block size.  */
92
1191
    if (root_window_control_block_size != sizeof(GX_WINDOW_ROOT))
93
    {
94
1
        return(GX_INVALID_SIZE);
95
    }
96
97
    /* Check for widget already created.  */
98
1190
    if (root_window -> gx_widget_type != 0)
99
    {
100
1
        return(GX_ALREADY_CREATED);
101
    }
102
103
    /* Call actual root window create function. */
104
1189
    status = _gx_window_root_create(root_window, name, canvas, style, Id, size);
105
106
1189
    return(status);
107
}
108