GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_drop_list_create.c Lines: 10 10 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
/**   Drop List (List)                                                    */
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
#include "gx_system.h"
30
#include "gx_drop_list.h"
31
32
/* Bring in externs for caller checking code.  */
33
GX_CALLER_CHECKING_EXTERNS
34
/**************************************************************************/
35
/*                                                                        */
36
/*  FUNCTION                                               RELEASE        */
37
/*                                                                        */
38
/*    _gxe_drop_list_create                               PORTABLE C      */
39
/*                                                           6.1          */
40
/*  AUTHOR                                                                */
41
/*                                                                        */
42
/*    Kenneth Maxwell, Microsoft Corporation                              */
43
/*                                                                        */
44
/*  DESCRIPTION                                                           */
45
/*                                                                        */
46
/*    This function checks for errors in the drop list create function    */
47
/*    call.                                                               */
48
/*                                                                        */
49
/*  INPUT                                                                 */
50
/*                                                                        */
51
/*    drop_list                             Drop list control block       */
52
/*    name                                  Name of drop list             */
53
/*    parent                                Pointer to parent widget      */
54
/*    total_rows                            Total number of rows in       */
55
/*                                            drop list                   */
56
/*    open_height                           Height of the vertical list   */
57
/*    callback                              Callback function             */
58
/*    style                                 Style of scrollbar widget     */
59
/*    drop_list_id                          Application-defined ID of     */
60
/*                                            the drop list               */
61
/*    size                                  Dimensions of the drop list   */
62
/*    drop_list_control_block_size          Control block size            */
63
/*                                                                        */
64
/*  OUTPUT                                                                */
65
/*                                                                        */
66
/*    status                                Completion status             */
67
/*                                                                        */
68
/*  CALLS                                                                 */
69
/*                                                                        */
70
/*    _gx_drop_list_create                  Actual drop list create call  */
71
/*                                                                        */
72
/*  CALLED BY                                                             */
73
/*                                                                        */
74
/*    Application Code                                                    */
75
/*                                                                        */
76
/**************************************************************************/
77
568
UINT  _gxe_drop_list_create(GX_DROP_LIST *drop_list, GX_CONST GX_CHAR *name,
78
                            GX_WIDGET *parent, INT total_rows, INT open_height,
79
                            VOID (*callback)(GX_VERTICAL_LIST *, GX_WIDGET *, INT),
80
                            ULONG style, USHORT drop_list_id, GX_CONST GX_RECTANGLE *size, UINT drop_list_control_block_size)
81
{
82
UINT status;
83
84
    /* Check for appropriate caller.  */
85

568
    GX_INIT_AND_THREADS_CALLER_CHECKING
86
87
    /* Check for invalid input pointers.  */
88

566
    if (!drop_list || !size)
89
    {
90
2
        return(GX_PTR_ERROR);
91
    }
92
93
    /* Check for control block size. */
94
564
    if (drop_list_control_block_size != sizeof(GX_DROP_LIST))
95
    {
96
1
        return(GX_INVALID_SIZE);
97
    }
98
99
    /* Check for widget already created.  */
100
563
    if (drop_list -> gx_widget_type != 0)
101
    {
102
1
        return(GX_ALREADY_CREATED);
103
    }
104
105
    /* Call actual widget hide function.  */
106
562
    status = _gx_drop_list_create(drop_list, name, parent, total_rows, open_height,
107
                                  callback, style, drop_list_id, size);
108
109
562
    return(status);
110
}
111