GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_system_view_add.c Lines: 10 10 100.0 %
Date: 2026-03-06 19:21:09 Branches: 6 6 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
/**   System Management (System)                                          */
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_utility.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_system_view_add                                 PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    Link a view to window's view list                                   */
45
/*                                                                        */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    win                                   Window to add view to         */
50
/*    view                                  Rectangle defining new view   */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    None                                                                */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*   _gx_system_view_fold                   Combine views                 */
59
/*   _gx_system_free_view_get               Get free view from storage    */
60
/*                                                                        */
61
/*  CALLED BY                                                             */
62
/*                                                                        */
63
/*    _gx_system_root_view_add              Add a view to the root        */
64
/*                                            window                      */
65
/*                                                                        */
66
/**************************************************************************/
67
7141
VOID _gx_system_view_add(GX_WINDOW *win, GX_RECTANGLE *view)
68
{
69
GX_VIEW *newview;
70
71
7141
    if (_gx_system_view_fold(win, view))
72
    {
73
75
        return;
74
    }
75
7066
    newview = _gx_system_free_view_get();
76
77
7066
    if (newview)
78
    {
79
7065
        newview -> gx_view_rectangle = *view;
80
81
7065
        if (win -> gx_window_views)
82
        {
83
3793
            newview -> gx_view_next = win -> gx_window_views;
84
        }
85
        else
86
        {
87
3272
            newview -> gx_view_next = GX_NULL;
88
        }
89
7065
        win -> gx_window_views = newview;
90
    }
91
}
92