GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_pixelmap_slider_create.c Lines: 12 12 100.0 %
Date: 2026-03-06 19:21:09 Branches: 2 2 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_widget.h"
29
#include "gx_slider.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_pixelmap_slider_create                          PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function creates a pixelmap slider, which is a type of widget  */
45
/*    for displaying a user-adjustable value in graphical fashion.        */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    slider                                Slider control block          */
50
/*    name                                  Name of prompt                */
51
/*    parent                                Parent widget control block   */
52
/*    info                                  Pointer to a GX_SLIDER_INFO   */
53
/*    pixelmap_info                         Pointer to the pixelmap       */
54
/*                                            info block                  */
55
/*    style                                 Style of slider               */
56
/*    pixelmap_slider_id                    Application-defined ID of     */
57
/*                                            pixelmap slider             */
58
/*    size                                  Dimensions of pixelmap prompt */
59
/*                                                                        */
60
/*  OUTPUT                                                                */
61
/*                                                                        */
62
/*    status                                Completion status             */
63
/*                                                                        */
64
/*  CALLS                                                                 */
65
/*                                                                        */
66
/*    _gx_widget_create                     Create the underlying widget  */
67
/*    _gx_widget_link                       Link the widget to its parent */
68
/*                                                                        */
69
/*  CALLED BY                                                             */
70
/*                                                                        */
71
/*    Application Code                                                    */
72
/*                                                                        */
73
/**************************************************************************/
74
75
1503
UINT  _gx_pixelmap_slider_create(GX_PIXELMAP_SLIDER *slider,
76
                                 GX_CONST GX_CHAR *name,
77
                                 GX_WIDGET *parent,
78
                                 GX_SLIDER_INFO *info,
79
                                 GX_PIXELMAP_SLIDER_INFO *pixelmap_info,
80
                                 ULONG style,
81
                                 USHORT pixelmap_slider_id,
82
                                 GX_CONST GX_RECTANGLE *size)
83
{
84
85
    /* Call the widget create function.  */
86
1503
    _gx_widget_create((GX_WIDGET *)slider, name, GX_NULL, style, pixelmap_slider_id, size);
87
88
    /* Populate the rest of slider control block - overriding as necessary.  */
89
1503
    slider -> gx_widget_type = GX_TYPE_PIXELMAP_SLIDER;
90
91
1503
    slider -> gx_widget_draw_function = (VOID (*)(GX_WIDGET *))_gx_pixelmap_slider_draw;
92
1503
    slider -> gx_widget_event_process_function = (UINT (*)(GX_WIDGET *, GX_EVENT *))_gx_pixelmap_slider_event_process;
93
1503
    slider -> gx_slider_info = *info;
94
1503
    slider -> gx_pixelmap_slider_pixelmap_info = *pixelmap_info;
95
96
1503
    slider -> gx_slider_info.gx_slider_info_needle_height = 0;
97
1503
    slider -> gx_slider_info.gx_slider_info_needle_width = 0;
98
99
    /* Determine if a parent widget was provided.  */
100
1503
    if (parent)
101
    {
102
1502
        _gx_widget_link(parent, (GX_WIDGET *)slider);
103
    }
104
105
    /* Return the status from prompt create.  */
106
1503
    return(GX_SUCCESS);
107
}
108