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 Managment (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_system.h" 29 #include "gx_multi_line_text_input.h" 30 31 GX_CALLER_CHECKING_EXTERNS 32 /**************************************************************************/ 33 /* */ 34 /* FUNCTION RELEASE */ 35 /* */ 36 /* _gxe_multi_line_text_input_text_select PORTABLE C */ 37 /* 6.1 */ 38 /* AUTHOR */ 39 /* */ 40 /* Kenneth Maxwell, Microsoft Corporation */ 41 /* */ 42 /* DESCRIPTION */ 43 /* */ 44 /* This function checks for errors in the multi line text input text */ 45 /* select function call. */ 46 /* */ 47 /* */ 48 /* INPUT */ 49 /* */ 50 /* input Multi-line text input widget */ 51 /* control block */ 52 /* start_mark The index of the first */ 53 /* highlight character. */ 54 /* end_mark The index of the last */ 55 /* highlight character */ 56 /* */ 57 /* OUTPUT */ 58 /* */ 59 /* status Completion status */ 60 /* */ 61 /* CALLS */ 62 /* */ 63 /* _gx_multi_line_text_input_text_select Actual multi line text input */ 64 /* text select fucntion */ 65 /* */ 66 /* CALLED BY */ 67 /* */ 68 /* Application Code */ 69 /* */ 70 /* RELEASE HISTORY */ 71 /* */ 72 /* DATE NAME DESCRIPTION */ 73 /* */ 74 /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ 75 /* 09-30-2020 Kenneth Maxwell Modified comment(s), */ 76 /* resulting in version 6.1 */ 77 /* */ 78 /**************************************************************************/ _gxe_multi_line_text_input_text_select(GX_MULTI_LINE_TEXT_INPUT * input,UINT start_index,UINT end_index)79UINT _gxe_multi_line_text_input_text_select(GX_MULTI_LINE_TEXT_INPUT *input, UINT start_index, UINT end_index) 80 { 81 UINT status; 82 83 /* Check for invalid caller. */ 84 GX_INIT_AND_THREADS_CALLER_CHECKING 85 86 if (!input) 87 { 88 return(GX_PTR_ERROR); 89 } 90 91 /* Check for invalid widget. */ 92 if (input -> gx_widget_type == 0) 93 { 94 return(GX_INVALID_WIDGET); 95 } 96 97 /* Check for invalid index value. */ 98 if ((start_index >= input -> gx_multi_line_text_view_text.gx_string_length) || 99 (end_index >= input -> gx_multi_line_text_view_text.gx_string_length)) 100 { 101 return(GX_INVALID_VALUE); 102 } 103 104 status = _gx_multi_line_text_input_text_select(input, start_index, end_index); 105 106 return(status); 107 } 108 109