GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_pixelmap_prompt_pixelmap_set.c Lines: 10 10 100.0 %
Date: 2024-12-05 08:52:37 Branches: 2 2 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
/**   Prompt Management (Prompt)                                          */
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_button.h"
29
#include "gx_system.h"
30
#include "gx_pixelmap_prompt.h"
31
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gx_pixelmap_prompt_pixelmap_set                    PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    Kenneth Maxwell, Microsoft Corporation                              */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    This function assigned the pixelmaps used to draw a pixelmap_prompt */
46
/*                                                                        */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    prompt                                Prompt control block          */
51
/*    normal_left_id                        Left pixelmap ID              */
52
/*    normal_fill_id                        Fill pixelmap ID              */
53
/*    normal_right_id                       Right pixelmap ID             */
54
/*    selected_left_id                      Left pixelmap ID              */
55
/*    selected_fill_id                      Fill pixelmap ID              */
56
/*    selected_right_id                     Right pixelmap ID             */
57
/*                                                                        */
58
/*  OUTPUT                                                                */
59
/*                                                                        */
60
/*    status                                Completion status             */
61
/*                                                                        */
62
/*  CALLS                                                                 */
63
/*                                                                        */
64
/*    _gx_system_dirty_mark                 Mark the widget as dirty      */
65
/*                                                                        */
66
/*  CALLED BY                                                             */
67
/*                                                                        */
68
/*    Application Code                                                    */
69
/*                                                                        */
70
/*  RELEASE HISTORY                                                       */
71
/*                                                                        */
72
/*    DATE              NAME                      DESCRIPTION             */
73
/*                                                                        */
74
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
75
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
76
/*                                            resulting in version 6.1    */
77
/*                                                                        */
78
/**************************************************************************/
79
13766
UINT  _gx_pixelmap_prompt_pixelmap_set(GX_PIXELMAP_PROMPT *prompt,
80
                                       GX_RESOURCE_ID normal_left_id,
81
                                       GX_RESOURCE_ID normal_fill_id,
82
                                       GX_RESOURCE_ID normal_right_id,
83
                                       GX_RESOURCE_ID selected_left_id,
84
                                       GX_RESOURCE_ID selected_fill_id,
85
                                       GX_RESOURCE_ID selected_right_id)
86
{
87
13766
    prompt -> gx_normal_left_pixelmap_id = normal_left_id;
88
13766
    prompt -> gx_normal_fill_pixelmap_id = normal_fill_id;
89
13766
    prompt -> gx_normal_right_pixelmap_id = normal_right_id;
90
91
13766
    prompt -> gx_selected_left_pixelmap_id = selected_left_id;
92
13766
    prompt -> gx_selected_fill_pixelmap_id = selected_fill_id;
93
13766
    prompt -> gx_selected_right_pixelmap_id = selected_right_id;
94
95
13766
    if (prompt -> gx_widget_status & GX_STATUS_VISIBLE)
96
    {
97
        /* Mark widget as needing to be re-painted.  */
98
3
        _gx_system_dirty_mark((GX_WIDGET *)prompt);
99
    }
100
101
13766
    return(GX_SUCCESS);
102
}
103