gx_multi_line_text_input.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. /** GUIX Component */
  15. /** */
  16. /** Multi Line Text Input Management (Multi Line Text Input) */
  17. /** */
  18. /**************************************************************************/
  19. /**************************************************************************/
  20. /**************************************************************************/
  21. /* */
  22. /* COMPONENT DEFINITION RELEASE */
  23. /* */
  24. /* gx_multi_line_text_input.h PORTABLE C */
  25. /* 6.0 */
  26. /* AUTHOR */
  27. /* */
  28. /* Kenneth Maxwell, Microsoft Corporation */
  29. /* */
  30. /* DESCRIPTION */
  31. /* */
  32. /* This file defines the GUIX multi line text input management */
  33. /* component, including all data types and external references. It is */
  34. /* assumed that gx_api.h and gx_port.h have already been included. */
  35. /* */
  36. /* RELEASE HISTORY */
  37. /* */
  38. /* DATE NAME DESCRIPTION */
  39. /* */
  40. /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */
  41. /* */
  42. /**************************************************************************/
  43. #define ID_TEXT_INPUT_TIMER 2
  44. #define GX_MARK_TIMER 3
  45. #define NUM_BEF_CURSOR 1
  46. #define NUM_AFT_CURSOR 3
  47. #define GX_MARK_INTERVAL 5
  48. /* Define multi-line text input management function prototypes. */
  49. UINT _gx_multi_line_text_input_backspace(GX_MULTI_LINE_TEXT_INPUT *text_input);
  50. UINT _gx_multi_line_text_input_buffer_clear(GX_MULTI_LINE_TEXT_INPUT *text_input);
  51. UINT _gx_multi_line_text_input_buffer_get(GX_MULTI_LINE_TEXT_INPUT *text_input_ptr, GX_CHAR **buffer_address,
  52. UINT *content_size, UINT *buffer_size);
  53. #if defined(GX_ENABLE_DEPRECATED_STRING_API)
  54. UINT _gx_multi_line_text_input_char_insert(GX_MULTI_LINE_TEXT_INPUT *text_input, GX_UBYTE *str, UINT str_size);
  55. #endif
  56. UINT _gx_multi_line_text_input_char_insert_ext(GX_MULTI_LINE_TEXT_INPUT *text_input, GX_CONST GX_STRING *str);
  57. UINT _gx_multi_line_text_input_char_remove(GX_MULTI_LINE_TEXT_INPUT *text_input, UINT index, UINT del_bytes);
  58. UINT _gx_multi_line_text_input_copy(GX_MULTI_LINE_TEXT_INPUT *input);
  59. UINT _gx_multi_line_text_input_create(GX_MULTI_LINE_TEXT_INPUT *text_input_ptr,
  60. GX_CONST GX_CHAR *name_ptr, GX_WIDGET *parent,
  61. GX_CHAR *input_buffer, UINT buffer_size, ULONG style, USHORT Id,
  62. GX_CONST GX_RECTANGLE *size);
  63. UINT _gx_multi_line_text_input_cursor_pos_calculate(GX_MULTI_LINE_TEXT_INPUT *text_input, GX_POINT click_pos);
  64. UINT _gx_multi_line_text_input_cursor_pos_get(GX_MULTI_LINE_TEXT_INPUT *input, GX_POINT *cursor_pos);
  65. UINT _gx_multi_line_text_input_cursor_pos_update(GX_MULTI_LINE_TEXT_INPUT *text_input, GX_BOOL make_cursor_visible);
  66. UINT _gx_multi_line_text_input_cursor_visible(GX_MULTI_LINE_TEXT_INPUT *text_input);
  67. UINT _gx_multi_line_text_input_cut(GX_MULTI_LINE_TEXT_INPUT *input);
  68. UINT _gx_multi_line_text_input_delete(GX_MULTI_LINE_TEXT_INPUT *text_input);
  69. UINT _gx_multi_line_text_input_down_arrow(GX_MULTI_LINE_TEXT_INPUT *text_input);
  70. VOID _gx_multi_line_text_input_draw(GX_MULTI_LINE_TEXT_INPUT *text_input);
  71. UINT _gx_multi_line_text_input_end(GX_MULTI_LINE_TEXT_INPUT *text_input);
  72. UINT _gx_multi_line_text_input_event_process(GX_MULTI_LINE_TEXT_INPUT *text_input, GX_EVENT *event_ptr);
  73. UINT _gx_multi_line_text_input_fill_color_set(GX_MULTI_LINE_TEXT_INPUT *input,
  74. GX_RESOURCE_ID normal_fill_color_id,
  75. GX_RESOURCE_ID selected_fill_color_id,
  76. GX_RESOURCE_ID disabled_fill_color_id,
  77. GX_RESOURCE_ID readonly_fill_color_id);
  78. UINT _gx_multi_line_text_input_home(GX_MULTI_LINE_TEXT_INPUT *text_input);
  79. UINT _gx_multi_line_text_input_highlight_rectangle_get(GX_MULTI_LINE_TEXT_INPUT *input, GX_RECTANGLE *rect);
  80. UINT _gx_multi_line_text_input_keydown_process(GX_MULTI_LINE_TEXT_INPUT *text_input, GX_EVENT *event_ptr);
  81. UINT _gx_multi_line_text_input_left_arrow(GX_MULTI_LINE_TEXT_INPUT *text_input);
  82. UINT _gx_multi_line_text_input_mark_end(GX_MULTI_LINE_TEXT_INPUT *text_input);
  83. UINT _gx_multi_line_text_input_mark_home(GX_MULTI_LINE_TEXT_INPUT *text_input);
  84. UINT _gx_multi_line_text_input_mark_next(GX_MULTI_LINE_TEXT_INPUT *text_input);
  85. UINT _gx_multi_line_text_input_mark_previous(GX_MULTI_LINE_TEXT_INPUT *text_input);
  86. UINT _gx_multi_line_text_input_mark_up(GX_MULTI_LINE_TEXT_INPUT *text_input);
  87. UINT _gx_multi_line_text_input_mark_down(GX_MULTI_LINE_TEXT_INPUT *text_input);
  88. UINT _gx_multi_line_text_input_paste(GX_MULTI_LINE_TEXT_INPUT *input);
  89. UINT _gx_multi_line_text_input_right_arrow(GX_MULTI_LINE_TEXT_INPUT *text_input);
  90. UINT _gx_multi_line_text_input_style_add(GX_MULTI_LINE_TEXT_INPUT *text_input_ptr, ULONG cursor_type);
  91. UINT _gx_multi_line_text_input_style_remove(GX_MULTI_LINE_TEXT_INPUT *text_input_ptr, ULONG cursor_type);
  92. UINT _gx_multi_line_text_input_style_set(GX_MULTI_LINE_TEXT_INPUT *text_input_ptr, ULONG cursor_type);
  93. UINT _gx_multi_line_text_input_text_color_set(GX_MULTI_LINE_TEXT_INPUT *input,
  94. GX_RESOURCE_ID normal_text_color_id,
  95. GX_RESOURCE_ID selected_text_color_id,
  96. GX_RESOURCE_ID disabled_text_color_id,
  97. GX_RESOURCE_ID readonly_text_color_id);
  98. UINT _gx_multi_line_text_input_text_rectangle_get(GX_MULTI_LINE_TEXT_INPUT *input, GX_POINT start_cursor_pos, GX_POINT end_cursor_pos, GX_RECTANGLE *rect);
  99. UINT _gx_multi_line_text_input_text_select(GX_MULTI_LINE_TEXT_INPUT *input, UINT start_index, UINT end_index);
  100. #if defined(GX_ENABLE_DEPRECATED_STRING_API)
  101. UINT _gx_multi_line_text_input_text_set(GX_MULTI_LINE_TEXT_INPUT *text_input, GX_CONST GX_CHAR *text);
  102. #endif
  103. UINT _gx_multi_line_text_input_text_set_ext(GX_MULTI_LINE_TEXT_INPUT *text_input, GX_CONST GX_STRING *text);
  104. UINT _gx_multi_line_text_input_up_arrow(GX_MULTI_LINE_TEXT_INPUT *text_input);
  105. /* Define error checking shells for API services. These are only referenced by the
  106. application. */
  107. UINT _gxe_multi_line_text_input_backspace(GX_MULTI_LINE_TEXT_INPUT *text_input);
  108. UINT _gxe_multi_line_text_input_buffer_clear(GX_MULTI_LINE_TEXT_INPUT *text_input);
  109. UINT _gxe_multi_line_text_input_buffer_get(GX_MULTI_LINE_TEXT_INPUT *text_input_ptr, GX_CHAR **buffer_address,
  110. UINT *content_size, UINT *buffer_size);
  111. #if defined(GX_ENABLE_DEPRECATED_STRING_API)
  112. UINT _gxe_multi_line_text_input_char_insert(GX_MULTI_LINE_TEXT_INPUT *text_input, GX_UBYTE *str, UINT str_size);
  113. #endif
  114. UINT _gxe_multi_line_text_input_char_insert_ext(GX_MULTI_LINE_TEXT_INPUT *text_input, GX_CONST GX_STRING *str);
  115. UINT _gxe_multi_line_text_input_create(GX_MULTI_LINE_TEXT_INPUT *text_input_ptr, GX_CONST GX_CHAR *name_ptr, GX_WIDGET *parent,
  116. GX_CHAR *input_buffer, UINT buffer_size, ULONG style, USHORT Id, GX_CONST GX_RECTANGLE *size,
  117. UINT text_input_control_block_size);
  118. UINT _gxe_multi_line_text_input_cursor_pos_get(GX_MULTI_LINE_TEXT_INPUT *input, GX_POINT *cursor_pos);
  119. UINT _gxe_multi_line_text_input_delete(GX_MULTI_LINE_TEXT_INPUT *text_input);
  120. UINT _gxe_multi_line_text_input_down_arrow(GX_MULTI_LINE_TEXT_INPUT *text_input);
  121. UINT _gxe_multi_line_text_input_end(GX_MULTI_LINE_TEXT_INPUT *text_input);
  122. UINT _gxe_multi_line_text_input_event_process(GX_MULTI_LINE_TEXT_INPUT *input, GX_EVENT *event_ptr);
  123. UINT _gxe_multi_line_text_input_fill_color_set(GX_MULTI_LINE_TEXT_INPUT *input,
  124. GX_RESOURCE_ID normal_fill_color_id,
  125. GX_RESOURCE_ID selected_fill_color_id,
  126. GX_RESOURCE_ID disabled_fill_color_id,
  127. GX_RESOURCE_ID readonly_fill_color_id);
  128. UINT _gxe_multi_line_text_input_home(GX_MULTI_LINE_TEXT_INPUT *text_input);
  129. UINT _gxe_multi_line_text_input_left_arrow(GX_MULTI_LINE_TEXT_INPUT *text_input);
  130. UINT _gxe_multi_line_text_input_right_arrow(GX_MULTI_LINE_TEXT_INPUT *text_input);
  131. UINT _gxe_multi_line_text_input_style_add(GX_MULTI_LINE_TEXT_INPUT *text_input_ptr, ULONG cursor_type);
  132. UINT _gxe_multi_line_text_input_style_remove(GX_MULTI_LINE_TEXT_INPUT *text_input_ptr, ULONG cursor_type);
  133. UINT _gxe_multi_line_text_input_style_set(GX_MULTI_LINE_TEXT_INPUT *text_input_ptr, ULONG cursor_type);
  134. UINT _gxe_multi_line_text_input_text_color_set(GX_MULTI_LINE_TEXT_INPUT *input,
  135. GX_RESOURCE_ID normal_text_color_id,
  136. GX_RESOURCE_ID selected_text_color_id,
  137. GX_RESOURCE_ID disabled_text_color_id,
  138. GX_RESOURCE_ID readonly_text_color_id);
  139. UINT _gxe_multi_line_text_input_text_select(GX_MULTI_LINE_TEXT_INPUT *input, UINT start_index, UINT end_index);
  140. #if defined(GX_ENABLE_DEPRECATED_STRING_API)
  141. UINT _gxe_multi_line_text_input_text_set(GX_MULTI_LINE_TEXT_INPUT *input, GX_CONST GX_CHAR *text);
  142. #endif
  143. UINT _gxe_multi_line_text_input_text_set_ext(GX_MULTI_LINE_TEXT_INPUT *input, GX_CONST GX_STRING *text);
  144. UINT _gxe_multi_line_text_input_up_arrow(GX_MULTI_LINE_TEXT_INPUT *text_input);