GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_scroll_wheel_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
/**   Scroll Wheel Management (Scroll Wheel)                              */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_scroll_wheel.h"
29
30
GX_CALLER_CHECKING_EXTERNS
31
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gxe_scroll_wheel_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 scroll wheel create call.        */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    wheel                                 Scroll wheel control block    */
50
/*    name                                  Name of widget                */
51
/*    parent                                Parent widget control block   */
52
/*    total_rows                            Total rows of the scroll wheel*/
53
/*    style                                 Style of widget               */
54
/*    Id                                    Application-defined ID of the */
55
/*                                            the widget                  */
56
/*    size                                  Widget size                   */
57
/*    control_block_size                    Size of the scroll wheel      */
58
/*                                            control block               */
59
/*                                                                        */
60
/*  OUTPUT                                                                */
61
/*                                                                        */
62
/*    status                                Completion status             */
63
/*                                                                        */
64
/*  CALLS                                                                 */
65
/*                                                                        */
66
/*    _gx_scroll_wheel_create               Actual scroll wheel           */
67
/*                                            create call                 */
68
/*                                                                        */
69
/*  CALLED BY                                                             */
70
/*                                                                        */
71
/*    Application Code                                                    */
72
/*                                                                        */
73
/**************************************************************************/
74
9
UINT  _gxe_scroll_wheel_create(GX_SCROLL_WHEEL *wheel, GX_CONST GX_CHAR *name, GX_WIDGET *parent, INT total_rows,
75
                               ULONG style, USHORT Id, GX_CONST GX_RECTANGLE *size, UINT control_block_size)
76
{
77
UINT status;
78
79
    /* Check for appropriate caller.  */
80

9
    GX_INIT_AND_THREADS_CALLER_CHECKING
81
82
    /* Check for invalid pointer. */
83

7
    if ((wheel == GX_NULL) || (size == GX_NULL))
84
    {
85
2
        return GX_PTR_ERROR;
86
    }
87
88
    /* Check for invalid control block size. */
89
5
    if (control_block_size != sizeof(GX_SCROLL_WHEEL))
90
    {
91
1
        return GX_INVALID_SIZE;
92
    }
93
94
    /* Check for widget already created.  */
95
4
    if (wheel -> gx_widget_type != 0)
96
    {
97
1
        return(GX_ALREADY_CREATED);
98
    }
99
100
    /* Check for invalid parent widget. */
101

3
    if (parent && parent -> gx_widget_type == 0)
102
    {
103
1
        return(GX_INVALID_WIDGET);
104
    }
105
106
2
    status = _gx_scroll_wheel_create(wheel, name, parent, total_rows, style, Id, size);
107
108
2
    return status;
109
}
110