GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_icon_button_pixelmap_set.c Lines: 5 5 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
/**   Prompt Management (Prompt)                                          */
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_utility.h"
30
#include "gx_prompt.h"
31
#include "gx_system.h"
32
#include "gx_button.h"
33
34
35
/**************************************************************************/
36
/*                                                                        */
37
/*  FUNCTION                                               RELEASE        */
38
/*                                                                        */
39
/*    _gx_icon_button_pixelmap_set                        PORTABLE C      */
40
/*                                                           6.1          */
41
/*  AUTHOR                                                                */
42
/*                                                                        */
43
/*    Kenneth Maxwell, Microsoft Corporation                              */
44
/*                                                                        */
45
/*  DESCRIPTION                                                           */
46
/*                                                                        */
47
/*    Change the pixelmap associated with an icon after the icon has      */
48
/*    been created.                                                       */
49
/*                                                                        */
50
/*  INPUT                                                                 */
51
/*                                                                        */
52
/*    button                                Pointer to buttonontrol block */
53
/*    pixelmap_id                           Normal state pixelmap         */
54
/*                                            resource ID                 */
55
/*                                                                        */
56
/*  OUTPUT                                                                */
57
/*                                                                        */
58
/*    status                                Completion status             */
59
/*                                                                        */
60
/*  CALLS                                                                 */
61
/*                                                                        */
62
/*    _gx_system_dirty_mark                 Mark the widget dirty         */
63
/*                                                                        */
64
/*  CALLED BY                                                             */
65
/*                                                                        */
66
/*    _gx_drop_list_pixelmap_set                                          */
67
/*                                                                        */
68
/**************************************************************************/
69
3
UINT  _gx_icon_button_pixelmap_set(GX_ICON_BUTTON *button,
70
                                   GX_RESOURCE_ID pixelmap_id)
71
{
72
3
    button -> gx_icon_button_icon_id = pixelmap_id;
73
74
3
    if (button -> gx_widget_status & GX_STATUS_VISIBLE)
75
    {
76
        /* Mark widget as needing to be re-painted.  */
77
2
        _gx_system_dirty_mark((GX_WIDGET *)button);
78
    }
79
80
3
    return(GX_SUCCESS);
81
}
82