GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_radial_slider_create.c Lines: 16 16 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
/**   Radial 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_radial_slider.h"
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gx_radial_slider_create                            PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function creates a radial slider, which is a special type of   */
44
/*    widget.                                                             */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    slider                                Radial slider control block   */
49
/*    name                                  Name of radial slider         */
50
/*    parent                                Parent widget control block   */
51
/*    info                                  Pointer to radial slider info */
52
/*    style                                 Style of prompt               */
53
/*    slider_id                             Application-defined ID of     */
54
/*                                            radial slider               */
55
/*    size                                  Widget size                   */
56
/*                                                                        */
57
/*  OUTPUT                                                                */
58
/*                                                                        */
59
/*    status                                Completion status             */
60
/*                                                                        */
61
/*  CALLS                                                                 */
62
/*                                                                        */
63
/*    _gx_widget_create                     Create the underlying widget  */
64
/*    _gx_widget_link                       Link the widget to its parent */
65
/*                                                                        */
66
/*  CALLED BY                                                             */
67
/*                                                                        */
68
/*    Application Code                                                    */
69
/*                                                                        */
70
/**************************************************************************/
71
240
UINT  _gx_radial_slider_create(GX_RADIAL_SLIDER *slider, GX_CONST GX_CHAR *name, GX_WIDGET *parent,
72
                               GX_RADIAL_SLIDER_INFO *info, ULONG style, USHORT slider_id, GX_CONST GX_RECTANGLE *size)
73
{
74
75
    /* Call the widget create function.  */
76
240
    _gx_widget_create((GX_WIDGET *)slider, name, GX_NULL, style, slider_id, size);
77
78
    /* Populate the rest of control block - overriding as necessary.  */
79
240
    slider -> gx_radial_slider_info = *info;
80
240
    slider -> gx_widget_type = GX_TYPE_RADIAL_SLIDER;
81
240
    slider -> gx_widget_draw_function = (VOID (*)(GX_WIDGET *))_gx_radial_slider_draw;
82
240
    slider -> gx_widget_event_process_function = (UINT (*)(GX_WIDGET *, GX_EVENT *event_ptr))_gx_radial_slider_event_process;
83
240
    slider -> gx_radial_slider_start_angle = 0;
84
240
    slider -> gx_radial_slider_target_angle = 0;
85
240
    slider -> gx_radial_slider_animation_total_steps = 15;
86
240
    slider -> gx_radial_slider_animation_step = 0;
87
240
    slider -> gx_radial_slider_animation_delay = 2;
88
240
    slider -> gx_widget_status |= GX_STATUS_ANIMATION_NONE;
89
240
    slider -> gx_radial_slider_animation_style = GX_ANIMATION_CIRC_EASE_IN_OUT;
90
91
    /* Determine if a parent widget was provided.  */
92
240
    if (parent)
93
    {
94
239
        _gx_widget_link(parent, (GX_WIDGET *)slider);
95
    }
96
97
    /* Return the status from widget create.  */
98
240
    return(GX_SUCCESS);
99
}
100