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