GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_pixelmap_slider_create.c Lines: 11 11 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
/**   Slider Management (Slider)                                          */
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_widget.h"
30
#include "gx_slider.h"
31
32
/* Bring in externs for caller checking code.  */
33
GX_CALLER_CHECKING_EXTERNS
34
35
/**************************************************************************/
36
/*                                                                        */
37
/*  FUNCTION                                               RELEASE        */
38
/*                                                                        */
39
/*    _gxe_pixelmap_slider_create                         PORTABLE C      */
40
/*                                                           6.1          */
41
/*  AUTHOR                                                                */
42
/*                                                                        */
43
/*    Kenneth Maxwell, Microsoft Corporation                              */
44
/*                                                                        */
45
/*  DESCRIPTION                                                           */
46
/*                                                                        */
47
/*    This function checks for error in pixelmap slider create call.      */
48
/*                                                                        */
49
/*  INPUT                                                                 */
50
/*                                                                        */
51
/*    slider                                Slider control block          */
52
/*    name                                  Name of prompt                */
53
/*    parent                                Parent widget control block   */
54
/*    info                                  Pointer to a GX_SLIDER_INFO   */
55
/*    pixelmap_info                         Pointer to the pixelmap       */
56
/*                                            info block                  */
57
/*    style                                 Style of the slider           */
58
/*    pixelmap_slider_id                    Application-defined ID of     */
59
/*                                            pixelmap slider             */
60
/*    size                                  Dimensions of pixelmap prompt */
61
/*    pixelmap_slider_control_block_size    Size of the pixelmap slider   */
62
/*                                            control block               */
63
/*                                                                        */
64
/*  OUTPUT                                                                */
65
/*                                                                        */
66
/*    status                                Completion status             */
67
/*                                                                        */
68
/*  CALLS                                                                 */
69
/*                                                                        */
70
/*    _gx_pixelmap_slider_create            The actual function           */
71
/*                                                                        */
72
/*  CALLED BY                                                             */
73
/*                                                                        */
74
/*    Application Code                                                    */
75
/*                                                                        */
76
/**************************************************************************/
77
1511
UINT  _gxe_pixelmap_slider_create(GX_PIXELMAP_SLIDER *slider,
78
                                  GX_CONST GX_CHAR *name,
79
                                  GX_WIDGET *parent,
80
                                  GX_SLIDER_INFO *info,
81
                                  GX_PIXELMAP_SLIDER_INFO *pixelmap_info,
82
                                  ULONG style,
83
                                  USHORT pixelmap_slider_id,
84
                                  GX_CONST GX_RECTANGLE *size,
85
                                  UINT pixelmap_slider_control_block_size)
86
{
87
88
UINT status;
89
90
    /* Check for appropriate caller.  */
91

1511
    GX_INIT_AND_THREADS_CALLER_CHECKING
92
93
    /* Check error for valid pointer. */
94

1509
    if ((slider == GX_NULL) || (size == GX_NULL) ||
95
1506
        (info == GX_NULL) || (pixelmap_info == GX_NULL))
96
    {
97
4
        return(GX_PTR_ERROR);
98
    }
99
100
    /* Check for invalid widget control block size. */
101
1505
    if (pixelmap_slider_control_block_size != sizeof(GX_PIXELMAP_SLIDER))
102
    {
103
1
        return(GX_INVALID_SIZE);
104
    }
105
106
    /* Check for widget already created.  */
107
1504
    if (slider -> gx_widget_type != 0)
108
    {
109
1
        return(GX_ALREADY_CREATED);
110
    }
111
112
1503
    status = _gx_pixelmap_slider_create(slider, name, parent, info, pixelmap_info, style, pixelmap_slider_id, size);
113
114
1503
    return(status);
115
}
116