GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_text_button_draw.c Lines: 8 8 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
/**   Text Button Management (Button)                                     */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_system.h"
29
#include "gx_display.h"
30
#include "gx_context.h"
31
#include "gx_widget.h"
32
#include "gx_button.h"
33
34
35
/**************************************************************************/
36
/*                                                                        */
37
/*  FUNCTION                                               RELEASE        */
38
/*                                                                        */
39
/*    _gx_text_button_draw                                PORTABLE C      */
40
/*                                                           6.1          */
41
/*  AUTHOR                                                                */
42
/*                                                                        */
43
/*    Kenneth Maxwell, Microsoft Corporation                              */
44
/*                                                                        */
45
/*  DESCRIPTION                                                           */
46
/*                                                                        */
47
/*    This function draws the specified text button, which is a special   */
48
/*    type of widget.                                                     */
49
/*                                                                        */
50
/*  INPUT                                                                 */
51
/*                                                                        */
52
/*    button                                Text button control block     */
53
/*                                                                        */
54
/*  OUTPUT                                                                */
55
/*                                                                        */
56
/*    status                                Completion status             */
57
/*                                                                        */
58
/*  CALLS                                                                 */
59
/*                                                                        */
60
/*    _gx_button_background_draw            Draw button background        */
61
/*    _gx_widget_text_draw                  Draw text string              */
62
/*    _gx_widget_children_draw              Draw children widgets         */
63
/*                                                                        */
64
/*  CALLED BY                                                             */
65
/*                                                                        */
66
/*    Application Code                                                    */
67
/*    GUIX Internal Code                                                  */
68
/*                                                                        */
69
/**************************************************************************/
70
87299
VOID  _gx_text_button_draw(GX_TEXT_BUTTON *button)
71
{
72
GX_WIDGET *widget;
73
74
    /* Setup the button.  */
75
87299
    widget =  (GX_WIDGET *)button;
76
77
    /* Draw button background. */
78
87299
    _gx_button_background_draw((GX_BUTTON *)button);
79
80
    /* draw the text */
81
87299
    _gx_text_button_text_draw(button);
82
83
    /* Draw button's children.  */
84
87299
    _gx_widget_children_draw(widget);
85
86
87299
    if (!(button -> gx_widget_style & GX_STYLE_ENABLED))
87
    {
88
        /* Draw a line on the button to show it's disable for mono driver. */
89
79
        _gx_monochrome_driver_disabled_button_line_draw((GX_BUTTON *)button);
90
    }
91
87299
}
92