GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_checkbox_event_process.c Lines: 10 10 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
/**   Button Management (checkbox)                                        */
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_widget.h"
30
#include "gx_button.h"
31
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gx_checkbox_event_process                          PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    Kenneth Maxwell, Microsoft Corporation                              */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    This function processes events for the specified button.            */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    checkbox                              Checkbox control block        */
50
/*    event_ptr                             Incoming event to process     */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    status                                Completion status             */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*    [_gx_button_select_handler]           Button select callback        */
59
/*    _gx_text_button_event_process         Default widget event process  */
60
/*    _gx_widget_event_to_parent            Pass event to parent          */
61
/*                                                                        */
62
/*  CALLED BY                                                             */
63
/*                                                                        */
64
/*    Application Code                                                    */
65
/*    GUIX Internal Code                                                  */
66
/*                                                                        */
67
/**************************************************************************/
68
2333
UINT  _gx_checkbox_event_process(GX_CHECKBOX *checkbox, GX_EVENT *event_ptr)
69
{
70
UINT status;
71
72
    /* Default status to success.  */
73
2333
    status =  GX_SUCCESS;
74
75
    /* Process relative to the type of event.  */
76
2333
    switch (event_ptr -> gx_event_type)
77
    {
78
79
54
    case GX_EVENT_PEN_DOWN:
80
54
        checkbox -> gx_button_select_handler((GX_WIDGET *)checkbox);
81
82
        /* Pass event to parent. */
83
54
        status = _gx_widget_event_to_parent((GX_WIDGET *)checkbox, event_ptr);
84
54
        break;
85
86
2279
    default:
87
88
        /* Call the widget default processing.  */
89
2279
        status = _gx_text_button_event_process((GX_TEXT_BUTTON *)checkbox, event_ptr);
90
    }
91
92
    /* Return completion status.  */
93
2333
    return(status);
94
}
95