GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_tree_view_create.c Lines: 12 12 100.0 %
Date: 2026-03-06 19:21:09 Branches: 18 18 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
/**   Tree View Management (Tree View)                                    */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_tree_view.h"
29
30
/* Bring in externs for caller checking code.  */
31
GX_CALLER_CHECKING_EXTERNS
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gxe_tree_view_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 tree view create function call.  */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    tree                                  Pointer to the tree view      */
50
/*                                            control block               */
51
/*    name                                  Name of the tree view         */
52
/*    parent                                Parent widget control block   */
53
/*    style                                 Style of the widget           */
54
/*    tree_id                               Application-defined ID of     */
55
/*                                          the tree view                 */
56
/*    size                                  Tree view size                */
57
/*    control_block_size                    Control block size            */
58
/*                                                                        */
59
/*  OUTPUT                                                                */
60
/*                                                                        */
61
/*    status                                Completion status             */
62
/*                                                                        */
63
/*  CALLS                                                                 */
64
/*                                                                        */
65
/*    _gx_tree_view_create                  Actual tree view create       */
66
/*                                            function call               */
67
/*                                                                        */
68
/*  CALLED BY                                                             */
69
/*                                                                        */
70
/*    Application Code                                                    */
71
/*                                                                        */
72
/**************************************************************************/
73
551
UINT  _gxe_tree_view_create(GX_TREE_VIEW *tree, GX_CONST GX_CHAR *name, GX_WIDGET *parent,
74
                            ULONG style, USHORT tree_id, GX_CONST GX_RECTANGLE *size, UINT control_block_size)
75
{
76
UINT status;
77
78
    /* Check for appropriate caller.  */
79

551
    GX_INIT_AND_THREADS_CALLER_CHECKING
80
81
    /* Check for invalid input pointers.  */
82

549
    if ((!tree) || (!size))
83
    {
84
2
        return(GX_PTR_ERROR);
85
    }
86
87
    /* Check for widget already created.  */
88
547
    if (tree -> gx_widget_type != 0)
89
    {
90
1
        return(GX_ALREADY_CREATED);
91
    }
92
93
    /* Check for invalid control block size. */
94
546
    if (control_block_size != sizeof(GX_TREE_VIEW))
95
    {
96
1
        return(GX_INVALID_SIZE);
97
    }
98
99
    /* Check for invalid parent widget. */
100

545
    if (parent && (parent -> gx_widget_type == 0))
101
    {
102
1
        return(GX_INVALID_WIDGET);
103
    }
104
105
    /* Call actual tree view create function.  */
106
544
    status = _gx_tree_view_create(tree, name, parent, style, tree_id, size);
107
108
544
    return(status);
109
}
110