GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_window_wallpaper_set.c Lines: 8 8 100.0 %
Date: 2026-03-06 19:21:09 Branches: 4 4 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
/**   Window Management (Window)                                          */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_widget.h"
29
#include "gx_window.h"
30
#include "gx_system.h"
31
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gx_window_wallpaper_set                            PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    Kenneth Maxwell, Microsoft Corporation                              */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    This service sets the wallpaper for the specified window.           */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    window                                Pointer to window             */
50
/*    wallpaper_id                          Resource ID of wallpaper      */
51
/*    tile                                  Wallpaper is tiled if GX_TRUE,*/
52
/*                                          otherwise wallpaper is not    */
53
/*                                          tiled                         */
54
/*                                                                        */
55
/*  OUTPUT                                                                */
56
/*                                                                        */
57
/*    status                                Completion status             */
58
/*                                                                        */
59
/*  CALLS                                                                 */
60
/*                                                                        */
61
/*    _gx_system_dirty_mark                 Mark this text as dirty       */
62
/*                                                                        */
63
/*  CALLED BY                                                             */
64
/*                                                                        */
65
/*    GUIX Internal Code                                                  */
66
/*                                                                        */
67
/**************************************************************************/
68
89972
UINT _gx_window_wallpaper_set(GX_WINDOW *window, GX_RESOURCE_ID wallpaper_id, GX_BOOL tile)
69
{
70
    /* assign the resource id */
71
89972
    window -> gx_window_wallpaper = wallpaper_id;
72
73
    /* check for centered or tiled */
74
89972
    if (tile)
75
    {
76
290
        window -> gx_widget_style |= GX_STYLE_TILE_WALLPAPER;
77
    }
78
    else
79
    {
80
89682
        window -> gx_widget_style &= (ULONG)(~GX_STYLE_TILE_WALLPAPER);
81
    }
82
83
    /* if I am already visible then I need to mark as dirty */
84
89972
    if (window -> gx_widget_status & GX_STATUS_VISIBLE)
85
    {
86
88408
        _gx_system_dirty_mark((GX_WIDGET *)window);
87
    }
88
89
89972
    return(GX_SUCCESS);
90
}
91