GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_pixelmap_slider_pixelmap_update.c Lines: 15 15 100.0 %
Date: 2024-12-05 08:52:37 Branches: 12 12 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 *
4
 * This program and the accompanying materials are made available under the
5
 * terms of the MIT License which is available at
6
 * https://opensource.org/licenses/MIT.
7
 *
8
 * SPDX-License-Identifier: MIT
9
 **************************************************************************/
10
11
12
/**************************************************************************/
13
/**************************************************************************/
14
/**                                                                       */
15
/** GUIX Component                                                        */
16
/**                                                                       */
17
/**   Slider Management (Slider)                                          */
18
/**                                                                       */
19
/**************************************************************************/
20
21
#define GX_SOURCE_CODE
22
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_widget.h"
28
#include "gx_slider.h"
29
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gx_pixelmap_slider_pixelmap_update                 PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function creates a pixelmap slider, which is a type of widget  */
44
/*    for displaying a user-adjustable value in graphical fashion.        */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    slider                                Slider control block          */
49
/*    pixinfo                               Slider infomration block      */
50
/*                                                                        */
51
/*  OUTPUT                                                                */
52
/*                                                                        */
53
/*    status                                Completion status             */
54
/*                                                                        */
55
/*  CALLS                                                                 */
56
/*                                                                        */
57
/*    _gx_widget_pixelmap_get               Retrieve the pixelmap         */
58
/*    _gx_widget_status_add                 Add status flag               */
59
/*    _gx_system_dirty_mark                 Mark the widget as dirty      */
60
/*                                                                        */
61
/*  CALLED BY                                                             */
62
/*                                                                        */
63
/*    _gx_pixelmap_slider_event_process     Event process routine for     */
64
/*                                            pixelmap slider widget      */
65
/*    _gx_pixelmap_slider_pixelmap_set      Assign pixelmap to the        */
66
/*                                            pixelmap slider widget      */
67
/*                                                                        */
68
/*  RELEASE HISTORY                                                       */
69
/*                                                                        */
70
/*    DATE              NAME                      DESCRIPTION             */
71
/*                                                                        */
72
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
73
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
74
/*                                            resulting in version 6.1    */
75
/*                                                                        */
76
/**************************************************************************/
77
1264
VOID _gx_pixelmap_slider_pixelmap_update(GX_PIXELMAP_SLIDER *slider)
78
{
79
1264
GX_PIXELMAP_SLIDER_INFO *pixelmap_info = &slider -> gx_pixelmap_slider_pixelmap_info;
80
1264
GX_WIDGET               *widget = (GX_WIDGET *)slider;
81
GX_PIXELMAP             *map;
82
83
    /* if any of my pixelmaps are transparent, give myself transparent status */
84
85
1264
    if (pixelmap_info -> gx_pixelmap_slider_info_needle_pixelmap)
86
    {
87
1199
        _gx_widget_pixelmap_get(widget, pixelmap_info -> gx_pixelmap_slider_info_needle_pixelmap, &map);
88
89
1199
        if (map)
90
        {
91
1198
            slider -> gx_slider_info.gx_slider_info_needle_height = map -> gx_pixelmap_height;
92
1198
            slider -> gx_slider_info.gx_slider_info_needle_width = map -> gx_pixelmap_width;
93
94
1198
            if (PIXELMAP_IS_TRANSPARENT(map))
95
            {
96
1197
                _gx_widget_status_add((GX_WIDGET *)slider, GX_STATUS_TRANSPARENT);
97
            }
98
        }
99
    }
100
101
1264
    if (pixelmap_info -> gx_pixelmap_slider_info_lower_background_pixelmap)
102
    {
103
997
        _gx_widget_pixelmap_get(widget, pixelmap_info -> gx_pixelmap_slider_info_lower_background_pixelmap, &map);
104
105

997
        if (map && PIXELMAP_IS_TRANSPARENT(map))
106
        {
107
566
            _gx_widget_status_add((GX_WIDGET *)slider, GX_STATUS_TRANSPARENT);
108
        }
109
    }
110
1264
}
111