GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_horizontal_list_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
/**   Horizontal 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_window.h"
29
30
GX_CALLER_CHECKING_EXTERNS
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gxe_horizontal_list_create                         PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function checks for errors in the horizontal list create       */
45
/*    function call.                                                      */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    horizontal_list                       Horizontal list widget control*/
50
/*                                          block                         */
51
/*    name                                  Name of horizontal list       */
52
/*    parent                                Pointer to parent widget      */
53
/*    total_columns                         Total number of columsn in    */
54
/*                                          horizontal list               */
55
/*    style                                 Style of scrollbar widget     */
56
/*    horizontal_list_id                      Application-defined ID of   */
57
/*                                          horizontal list               */
58
/*    size                                  Dimensions of horizontal list */
59
/*    horizontal_list_control_block_size      Size of the horizontal list */
60
/*                                            control block               */
61
/*                                                                        */
62
/*  OUTPUT                                                                */
63
/*                                                                        */
64
/*    status                                Completion status             */
65
/*                                                                        */
66
/*  CALLS                                                                 */
67
/*                                                                        */
68
/*    _gx_horizontal_list_create            Actual horizontal list create */
69
/*                                            function                    */
70
/*                                                                        */
71
/*  CALLED BY                                                             */
72
/*                                                                        */
73
/*    Application Code                                                    */
74
/*                                                                        */
75
/**************************************************************************/
76
626
UINT  _gxe_horizontal_list_create(GX_HORIZONTAL_LIST *horizontal_list,
77
                                  GX_CONST GX_CHAR *name,
78
                                  GX_WIDGET *parent, INT total_columns,
79
                                  VOID (*callback)(GX_HORIZONTAL_LIST *, GX_WIDGET *, INT),
80
                                  ULONG style, USHORT horizontal_list_id,
81
                                  GX_CONST GX_RECTANGLE *size,
82
                                  UINT horizontal_list_control_block_size)
83
{
84
UINT status;
85
86
    /* Check for appropriate caller.  */
87

626
    GX_INIT_AND_THREADS_CALLER_CHECKING
88
89
    /* Check for invalid input pointers.  */
90

624
    if ((horizontal_list == GX_NULL) || (size == GX_NULL))
91
    {
92
2
        return GX_PTR_ERROR;
93
    }
94
95
622
    if (horizontal_list_control_block_size != sizeof(GX_HORIZONTAL_LIST))
96
    {
97
1
        return(GX_INVALID_SIZE);
98
    }
99
100
    /* Check for id is created.  */
101
621
    if (horizontal_list -> gx_widget_type != 0)
102
    {
103
1
        return GX_ALREADY_CREATED;
104
    }
105
106
    /* Check for valid number of rows .  */
107
620
    if (total_columns <= 0)
108
    {
109
1
        return GX_INVALID_VALUE;
110
    }
111
112
    /* Call the actual horizontal list create function.  */
113
619
    status = _gx_horizontal_list_create(horizontal_list, name, parent, total_columns, callback, style, horizontal_list_id, size);
114
115
    /* Return completion status.  */
116
619
    return status;
117
}
118