GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_window_view_update_detect.c Lines: 11 11 100.0 %
Date: 2024-12-05 08:52:37 Branches: 8 8 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 *
4
 * This program and the accompanying materials are made available under the
5
 * terms of the MIT License which is available at
6
 * https://opensource.org/licenses/MIT.
7
 *
8
 * SPDX-License-Identifier: MIT
9
 **************************************************************************/
10
11
12
/**************************************************************************/
13
/**************************************************************************/
14
/**                                                                       */
15
/** GUIX Component                                                        */
16
/**                                                                       */
17
/**   Window Management (Window)                                          */
18
/**                                                                       */
19
/**************************************************************************/
20
21
#define GX_SOURCE_CODE
22
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_widget.h"
28
#include "gx_window.h"
29
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gx_window_view_update_detect                       PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Kenneth Maxwell, Microsoft Corporation                              */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function is called when a window is moved or changes in a way  */
44
/*    that causes viewports to be invalid. Check to see if this window is */
45
/*    a child of the root window, and if so mark the root as needing an   */
46
/*    update.                                                             */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    window                                Window's widget control block */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    status                                Completion status             */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*    none                                                                */
59
/*                                                                        */
60
/*  CALLED BY                                                             */
61
/*                                                                        */
62
/*    Application Code                                                    */
63
/*    GUIX Internal Code                                                  */
64
/*                                                                        */
65
/*  RELEASE HISTORY                                                       */
66
/*                                                                        */
67
/*    DATE              NAME                      DESCRIPTION             */
68
/*                                                                        */
69
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
70
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
71
/*                                            resulting in version 6.1    */
72
/*                                                                        */
73
/**************************************************************************/
74
28625
VOID _gx_window_view_update_detect(GX_WINDOW *window)
75
{
76
GX_WINDOW_ROOT *root;
77
GX_WIDGET      *parent;
78
79
    /* pick up a pointer to the parent of this widget */
80
81
28625
    if (window -> gx_widget_type >= GX_TYPE_WINDOW)
82
    {
83
28624
        parent = window -> gx_widget_parent;
84
85
28624
        if (parent)
86
        {
87
            /* is my parent a GX_ROOT_WINDOW type? */
88
26810
            if (parent -> gx_widget_type == GX_TYPE_ROOT_WINDOW)
89
            {
90
4882
                root = (GX_WINDOW_ROOT *)parent;
91
4882
                root -> gx_window_root_views_changed = GX_TRUE;
92
            }
93
        }
94
        else
95
        {
96
1814
            if (window -> gx_widget_type == GX_TYPE_ROOT_WINDOW)
97
            {
98
1811
                root = (GX_WINDOW_ROOT *)window;
99
1811
                root -> gx_window_root_views_changed = GX_TRUE;
100
            }
101
        }
102
    }
103
28625
}
104