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 /**   Multi Line Text View Management (Multi Line Text)                   */
18 /**                                                                       */
19 /**************************************************************************/
20 
21 #define GX_SOURCE_CODE
22 
23 
24 /* Include necessary system files.  */
25 
26 #include "gx_api.h"
27 #include "gx_system.h"
28 #include "gx_window.h"
29 #include "gx_multi_line_text_view.h"
30 
31 GX_CALLER_CHECKING_EXTERNS
32 
33 /**************************************************************************/
34 /*                                                                        */
35 /*  FUNCTION                                               RELEASE        */
36 /*                                                                        */
37 /*    _gxe_multi_line_text_view_create                    PORTABLE C      */
38 /*                                                           6.1          */
39 /*  AUTHOR                                                                */
40 /*                                                                        */
41 /*    Kenneth Maxwell, Microsoft Corporation                              */
42 /*                                                                        */
43 /*  DESCRIPTION                                                           */
44 /*                                                                        */
45 /*    This function checks for errors in the multi line text view create  */
46 /*    function.                                                           */
47 /*  INPUT                                                                 */
48 /*                                                                        */
49 /*    text_view_ptr                         Multi Line view control block */
50 /*    name                                  Wigdget name                  */
51 /*    parent                                Parent widget control block   */
52 /*    input_buffer                          User-supplied input buffer    */
53 /*    style                                 The style of the widget border*/
54 /*    text_view_id                          The ID number of the widget   */
55 /*    size                                  Parent widget control block   */
56 /*    text_view_control_block_size          Size of the multi line text   */
57 /*                                            view control_block          */
58 /*                                                                        */
59 /*  OUTPUT                                                                */
60 /*                                                                        */
61 /*    status                                Completion status             */
62 /*                                                                        */
63 /*  CALLS                                                                 */
64 /*                                                                        */
65 /*    _gx_multi_line_text_view_create       Actual multi line text view   */
66 /*                                            create function             */
67 /*                                                                        */
68 /*  CALLED BY                                                             */
69 /*                                                                        */
70 /*    Application Code                                                    */
71 /*                                                                        */
72 /*  RELEASE HISTORY                                                       */
73 /*                                                                        */
74 /*    DATE              NAME                      DESCRIPTION             */
75 /*                                                                        */
76 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
77 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
78 /*                                            resulting in version 6.1    */
79 /*                                                                        */
80 /**************************************************************************/
_gxe_multi_line_text_view_create(GX_MULTI_LINE_TEXT_VIEW * text_view_ptr,GX_CONST GX_CHAR * name_ptr,GX_WIDGET * parent,GX_RESOURCE_ID text_id,ULONG style,USHORT Id,GX_CONST GX_RECTANGLE * size,UINT text_view_control_block_size)81 UINT    _gxe_multi_line_text_view_create(GX_MULTI_LINE_TEXT_VIEW *text_view_ptr,
82                                          GX_CONST GX_CHAR *name_ptr,
83                                          GX_WIDGET *parent,
84                                          GX_RESOURCE_ID text_id,
85                                          ULONG style,
86                                          USHORT Id,
87                                          GX_CONST GX_RECTANGLE *size,
88                                          UINT text_view_control_block_size)
89 {
90 UINT status;
91 
92     /* Check for invalid caller of this function.  */
93     GX_INIT_AND_THREADS_CALLER_CHECKING
94 
95     /* Check for invalid pointer.  */
96     if ((text_view_ptr == GX_NULL) || (size == GX_NULL))
97     {
98         return(GX_PTR_ERROR);
99     }
100 
101     if (text_view_control_block_size != sizeof(GX_MULTI_LINE_TEXT_VIEW))
102     {
103         return(GX_INVALID_SIZE);
104     }
105 
106     /* Check for widget already created.  */
107     if (text_view_ptr -> gx_widget_type != 0)
108     {
109         return(GX_ALREADY_CREATED);
110     }
111 
112     /* Call actual multi line text input create function.  */
113     status = _gx_multi_line_text_view_create(text_view_ptr, name_ptr, parent, text_id, style, Id, size);
114 
115     /* Return the error status from window create.  */
116     return(status);
117 }
118 
119