GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_rich_text_view_create.c Lines: 10 10 100.0 %
Date: 2026-03-06 19:21:09 Branches: 16 16 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
/**   Rich Text View Management (Rich Text View)                          */
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_window.h"
30
#include "gx_rich_text_view.h"
31
32
GX_CALLER_CHECKING_EXTERNS
33
34
/**************************************************************************/
35
/*                                                                        */
36
/*  FUNCTION                                               RELEASE        */
37
/*                                                                        */
38
/*    _gxe_multi_line_text_view_create                    PORTABLE C      */
39
/*                                                           6.1          */
40
/*  AUTHOR                                                                */
41
/*                                                                        */
42
/*    Kenneth Maxwell, Microsoft Corporation                              */
43
/*                                                                        */
44
/*  DESCRIPTION                                                           */
45
/*                                                                        */
46
/*    This function checks for errors in the rich text view create        */
47
/*    function.                                                           */
48
/*                                                                        */
49
/*  INPUT                                                                 */
50
/*                                                                        */
51
/*    text_view                             Rich text view widget control */
52
/*                                            block                       */
53
/*    name                                  Name of the widget            */
54
/*    parent                                Pointer to parent widget      */
55
/*    text_id                               Resource ID of the text string*/
56
/*    fonts                                 Font list                     */
57
/*    style                                 Style of text view widget     */
58
/*    id                                    Application-defined ID of text*/
59
/*                                            view                        */
60
/*    size                                  Dimension of the widget       */
61
/*                                                                        */
62
/*  OUTPUT                                                                */
63
/*                                                                        */
64
/*    status                                Completion status             */
65
/*                                                                        */
66
/*  CALLS                                                                 */
67
/*                                                                        */
68
/*    _gx_rich_text_view_create             Actual rich text view create  */
69
/*                                            function                    */
70
/*                                                                        */
71
/*  CALLED BY                                                             */
72
/*                                                                        */
73
/*    Application Code                                                    */
74
/*                                                                        */
75
/**************************************************************************/
76
256
UINT    _gxe_rich_text_view_create(GX_RICH_TEXT_VIEW *rich_view,
77
                                   GX_CONST GX_CHAR *name,
78
                                   GX_WIDGET *parent,
79
                                   GX_RESOURCE_ID text_id,
80
                                   GX_RICH_TEXT_FONTS *fonts,
81
                                   ULONG style,
82
                                   USHORT id,
83
                                   GX_CONST GX_RECTANGLE *size,
84
                                   UINT control_block_size)
85
{
86
UINT status;
87
88
    /* Check for invalid caller of this function.  */
89

256
    GX_INIT_AND_THREADS_CALLER_CHECKING
90
91
    /* Check for invalid pointer.  */
92

254
    if ((rich_view == GX_NULL) || (size == GX_NULL) || (fonts == GX_NULL))
93
    {
94
3
        return(GX_PTR_ERROR);
95
    }
96
97
    /* Check for invalid control block size. */
98
251
    if (control_block_size != sizeof(GX_RICH_TEXT_VIEW))
99
    {
100
1
        return(GX_INVALID_SIZE);
101
    }
102
103
    /* Check for widget already created.  */
104
250
    if (rich_view -> gx_widget_type != 0)
105
    {
106
1
        return(GX_ALREADY_CREATED);
107
    }
108
109
    /* Call actual multi line text input create function.  */
110
249
    status = _gx_rich_text_view_create(rich_view, name, parent, text_id, fonts, style, id, size);
111
112
    /* Return the error status from window create.  */
113
249
    return(status);
114
}
115