1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** GUIX Component                                                        */
17 /**                                                                       */
18 /**   Multi Line Text Input Management (Multi Line Text Input)            */
19 /**                                                                       */
20 /**************************************************************************/
21 
22 #define GX_SOURCE_CODE
23 
24 
25 /* Include necessary system files.  */
26 
27 #include "gx_api.h"
28 #include "gx_multi_line_text_input.h"
29 
30 
31 /**************************************************************************/
32 /*                                                                        */
33 /*  FUNCTION                                               RELEASE        */
34 /*                                                                        */
35 /*    _gx_multi_line_text_input_buffer_get                PORTABLE C      */
36 /*                                                           6.1          */
37 /*  AUTHOR                                                                */
38 /*                                                                        */
39 /*    Kenneth Maxwell, Microsoft Corporation                              */
40 /*                                                                        */
41 /*  DESCRIPTION                                                           */
42 /*                                                                        */
43 /*    This function retrieves buffer infomation of a multi-line text input*/
44 /*    widget.                                                             */
45 /*                                                                        */
46 /*  INPUT                                                                 */
47 /*                                                                        */
48 /*    text_input                            Multi-line text input widget  */
49 /*                                            control block               */
50 /*    buffer_address                        The address of the input      */
51 /*                                            buffer                      */
52 /*    content_size                          The byte count of the input   */
53 /*                                            data                        */
54 /*    buffer_size                           The size of the input buffer. */
55 /*                                                                        */
56 /*  OUTPUT                                                                */
57 /*                                                                        */
58 /*    status                                Completion status             */
59 /*                                                                        */
60 /*  CALLS                                                                 */
61 /*                                                                        */
62 /*    None                                                                */
63 /*                                                                        */
64 /*  CALLED BY                                                             */
65 /*                                                                        */
66 /*    Application Code                                                    */
67 /*    GUIX Internal Code                                                  */
68 /*                                                                        */
69 /*  RELEASE HISTORY                                                       */
70 /*                                                                        */
71 /*    DATE              NAME                      DESCRIPTION             */
72 /*                                                                        */
73 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
74 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
75 /*                                            resulting in version 6.1    */
76 /*                                                                        */
77 /**************************************************************************/
_gx_multi_line_text_input_buffer_get(GX_MULTI_LINE_TEXT_INPUT * text_input,GX_CHAR ** buffer_address,UINT * content_size,UINT * buffer_size)78 UINT _gx_multi_line_text_input_buffer_get(GX_MULTI_LINE_TEXT_INPUT *text_input, GX_CHAR **buffer_address,
79                                           UINT *content_size, UINT *buffer_size)
80 {
81     if (buffer_address)
82     {
83         *buffer_address = (GX_CHAR *)text_input->gx_multi_line_text_view_text.gx_string_ptr;
84     }
85 
86     if (content_size)
87     {
88         *content_size = text_input->gx_multi_line_text_view_text.gx_string_length;
89     }
90 
91     if (buffer_size)
92     {
93         *buffer_size = text_input->gx_multi_line_text_input_buffer_size;
94     }
95     return GX_SUCCESS;
96 }
97 
98