GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_widget_border_style_set.c Lines: 15 15 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
/**   Widget Management (Widget)                                          */
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
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_widget_border_style_set                         PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function sets the border style flags of the widget.            */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    widget                                Widget control block          */
49
/*    Style                                 Border style for widget       */
50
/*                                                                        */
51
/*  OUTPUT                                                                */
52
/*                                                                        */
53
/*    status                                Completion status             */
54
/*                                                                        */
55
/*                                                                        */
56
/*  CALLED BY                                                             */
57
/*                                                                        */
58
/*    Application Code                                                    */
59
/*                                                                        */
60
/**************************************************************************/
61
2035
UINT  _gx_widget_border_style_set(GX_WIDGET *widget, ULONG Style)
62
{
63
2035
GX_WINDOW *win = (GX_WINDOW *)widget;
64
GX_VALUE   border_width;
65
GX_EVENT   my_event;
66
2035
ULONG      old_style = widget -> gx_widget_style;
67
68
    /* Set the widget's border style.  */
69
70
2035
    widget -> gx_widget_style &= ~GX_STYLE_BORDER_MASK;
71
2035
    Style &= GX_STYLE_BORDER_MASK;
72
2035
    widget -> gx_widget_style |= Style;
73
74
2035
    if (widget -> gx_widget_type >= GX_TYPE_WINDOW)
75
    {
76
        /* Pick up border width.  */
77
11
        _gx_widget_border_width_get(widget, &border_width);
78
79
        /* Get window client.  */
80
11
        _gx_widget_client_get(widget, border_width, &win -> gx_window_client);
81
    }
82
83
2035
    memset(&my_event, 0, sizeof(GX_EVENT));
84
2035
    my_event.gx_event_payload.gx_event_ulongdata = old_style;
85
2035
    my_event.gx_event_type = GX_EVENT_STYLE_CHANGED;
86
2035
    my_event.gx_event_target = widget;
87
2035
    _gx_system_event_fold(&my_event);
88
2035
    return(GX_SUCCESS);
89
}
90