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 Input Management (Multi Line Text Input)            */
18 /**                                                                       */
19 /**************************************************************************/
20 
21 #define GX_SOURCE_CODE
22 
23 
24 /* Include necessary system files.  */
25 
26 #include "gx_api.h"
27 #include "gx_multi_line_text_input.h"
28 
29 
30 /**************************************************************************/
31 /*                                                                        */
32 /*  FUNCTION                                               RELEASE        */
33 /*                                                                        */
34 /*    _gx_multi_line_text_input_buffer_get                PORTABLE C      */
35 /*                                                           6.1          */
36 /*  AUTHOR                                                                */
37 /*                                                                        */
38 /*    Kenneth Maxwell, Microsoft Corporation                              */
39 /*                                                                        */
40 /*  DESCRIPTION                                                           */
41 /*                                                                        */
42 /*    This function retrieves buffer infomation of a multi-line text input*/
43 /*    widget.                                                             */
44 /*                                                                        */
45 /*  INPUT                                                                 */
46 /*                                                                        */
47 /*    text_input                            Multi-line text input widget  */
48 /*                                            control block               */
49 /*    buffer_address                        The address of the input      */
50 /*                                            buffer                      */
51 /*    content_size                          The byte count of the input   */
52 /*                                            data                        */
53 /*    buffer_size                           The size of the input buffer. */
54 /*                                                                        */
55 /*  OUTPUT                                                                */
56 /*                                                                        */
57 /*    status                                Completion status             */
58 /*                                                                        */
59 /*  CALLS                                                                 */
60 /*                                                                        */
61 /*    None                                                                */
62 /*                                                                        */
63 /*  CALLED BY                                                             */
64 /*                                                                        */
65 /*    Application Code                                                    */
66 /*    GUIX Internal Code                                                  */
67 /*                                                                        */
68 /*  RELEASE HISTORY                                                       */
69 /*                                                                        */
70 /*    DATE              NAME                      DESCRIPTION             */
71 /*                                                                        */
72 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
73 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
74 /*                                            resulting in version 6.1    */
75 /*                                                                        */
76 /**************************************************************************/
_gx_multi_line_text_input_buffer_get(GX_MULTI_LINE_TEXT_INPUT * text_input,GX_CHAR ** buffer_address,UINT * content_size,UINT * buffer_size)77 UINT _gx_multi_line_text_input_buffer_get(GX_MULTI_LINE_TEXT_INPUT *text_input, GX_CHAR **buffer_address,
78                                           UINT *content_size, UINT *buffer_size)
79 {
80     if (buffer_address)
81     {
82         *buffer_address = (GX_CHAR *)text_input->gx_multi_line_text_view_text.gx_string_ptr;
83     }
84 
85     if (content_size)
86     {
87         *content_size = text_input->gx_multi_line_text_view_text.gx_string_length;
88     }
89 
90     if (buffer_size)
91     {
92         *buffer_size = text_input->gx_multi_line_text_input_buffer_size;
93     }
94     return GX_SUCCESS;
95 }
96 
97