GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_display_active_language_set.c Lines: 12 12 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
/**   Display Management (Display)                                        */
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_display.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_display_active_language_set                     PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This service sets the active language.                              */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    display                               Pointer to display instance.  */
49
/*    language                              Language table id             */
50
/*                                                                        */
51
/*  OUTPUT                                                                */
52
/*                                                                        */
53
/*    status                                Completion status             */
54
/*                                                                        */
55
/*  CALLS                                                                 */
56
/*                                                                        */
57
/*    _gx_system_all_canvas_dirty           Mark all canvas dirty         */
58
/*                                                                        */
59
/*  CALLED BY                                                             */
60
/*                                                                        */
61
/*    Application Code                                                    */
62
/*                                                                        */
63
/**************************************************************************/
64
794
UINT  _gx_display_active_language_set(GX_DISPLAY *display, GX_UBYTE language)
65
{
66
GX_EVENT   language_event;
67
GX_WINDOW_ROOT *root;
68
69
    /* Set display active language.  */
70
71
794
    display -> gx_display_active_language = language;
72
794
    memset(&language_event, 0, sizeof(GX_EVENT));
73
794
    language_event.gx_event_type = GX_EVENT_LANGUAGE_CHANGE;
74
75
794
    root = (GX_WINDOW_ROOT *)_gx_system_root_window_created_list;
76
880
    while (root)
77
    {
78
86
        if (root -> gx_window_root_canvas)
79
        {
80
85
            if (root -> gx_window_root_canvas -> gx_canvas_display == display)
81
            {
82
80
                root -> gx_widget_event_process_function((GX_WIDGET *)root, &language_event);
83
            }
84
        }
85
86
        root = (GX_WINDOW_ROOT *) root -> gx_widget_next;
86
    }
87
88
794
    _gx_system_all_canvas_dirty();
89
90
    /* Return success.  */
91
794
    return(GX_SUCCESS);
92
}
93