| 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 |  |  | /**   Text Input Management (Single 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_single_line_text_input.h" | 
    
    | 28 |  |  |  | 
    
    | 29 |  |  |  | 
    
    | 30 |  |  | /**************************************************************************/ | 
    
    | 31 |  |  | /*                                                                        */ | 
    
    | 32 |  |  | /*  FUNCTION                                               RELEASE        */ | 
    
    | 33 |  |  | /*                                                                        */ | 
    
    | 34 |  |  | /*    gx_single_line_text_input_buffer_get                PORTABLE C      */ | 
    
    | 35 |  |  | /*                                                           6.1          */ | 
    
    | 36 |  |  | /*  AUTHOR                                                                */ | 
    
    | 37 |  |  | /*                                                                        */ | 
    
    | 38 |  |  | /*    Kenneth Maxwell, Microsoft Corporation                              */ | 
    
    | 39 |  |  | /*                                                                        */ | 
    
    | 40 |  |  | /*  DESCRIPTION                                                           */ | 
    
    | 41 |  |  | /*                                                                        */ | 
    
    | 42 |  |  | /*    This service retrieves buffer information of the text input widget. */ | 
    
    | 43 |  |  | /*                                                                        */ | 
    
    | 44 |  |  | /*  INPUT                                                                 */ | 
    
    | 45 |  |  | /*                                                                        */ | 
    
    | 46 |  |  | /*    text_input_ptr                        Single line text input        */ | 
    
    | 47 |  |  | /*                                            control blcok               */ | 
    
    | 48 |  |  | /*    buffer_address                        The address of the input      */ | 
    
    | 49 |  |  | /*                                            buffer                      */ | 
    
    | 50 |  |  | /*    content_size                          The count of the input data   */ | 
    
    | 51 |  |  | /*    buffer_size                           The size of the input buffer. */ | 
    
    | 52 |  |  | /*                                                                        */ | 
    
    | 53 |  |  | /*  OUTPUT                                                                */ | 
    
    | 54 |  |  | /*                                                                        */ | 
    
    | 55 |  |  | /*    status                                Completion status             */ | 
    
    | 56 |  |  | /*                                                                        */ | 
    
    | 57 |  |  | /*  CALLS                                                                 */ | 
    
    | 58 |  |  | /*                                                                        */ | 
    
    | 59 |  |  | /*    None                                                                */ | 
    
    | 60 |  |  | /*                                                                        */ | 
    
    | 61 |  |  | /*  CALLED BY                                                             */ | 
    
    | 62 |  |  | /*                                                                        */ | 
    
    | 63 |  |  | /*    Application Code                                                    */ | 
    
    | 64 |  |  | /*    GUIX Internal Code                                                  */ | 
    
    | 65 |  |  | /*                                                                        */ | 
    
    | 66 |  |  | /*  RELEASE HISTORY                                                       */ | 
    
    | 67 |  |  | /*                                                                        */ | 
    
    | 68 |  |  | /*    DATE              NAME                      DESCRIPTION             */ | 
    
    | 69 |  |  | /*                                                                        */ | 
    
    | 70 |  |  | /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */ | 
    
    | 71 |  |  | /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */ | 
    
    | 72 |  |  | /*                                            resulting in version 6.1    */ | 
    
    | 73 |  |  | /*                                                                        */ | 
    
    | 74 |  |  | /**************************************************************************/ | 
    
    | 75 |  | 250 | UINT _gx_single_line_text_input_buffer_get(GX_SINGLE_LINE_TEXT_INPUT *text_input_ptr, GX_CHAR **buffer_address, | 
    
    | 76 |  |  |                                            UINT *content_size, UINT *buffer_size) | 
    
    | 77 |  |  | { | 
    
    | 78 | ✓✓ | 250 |     if (buffer_address) | 
    
    | 79 |  |  |     { | 
    
    | 80 |  | 249 |         *buffer_address = text_input_ptr -> gx_single_line_text_input_buffer; | 
    
    | 81 |  |  |     } | 
    
    | 82 |  |  |  | 
    
    | 83 | ✓✓ | 250 |     if (content_size) | 
    
    | 84 |  |  |     { | 
    
    | 85 |  | 249 |         *content_size = text_input_ptr -> gx_single_line_text_input_string_size; | 
    
    | 86 |  |  |     } | 
    
    | 87 |  |  |  | 
    
    | 88 | ✓✓ | 250 |     if (buffer_size) | 
    
    | 89 |  |  |     { | 
    
    | 90 |  | 249 |         *buffer_size = text_input_ptr -> gx_single_line_text_input_buffer_size; | 
    
    | 91 |  |  |     } | 
    
    | 92 |  |  |  | 
    
    | 93 |  | 250 |     return GX_SUCCESS; | 
    
    | 94 |  |  | } | 
    
    | 95 |  |  |  |