1 |
|
|
/*************************************************************************** |
2 |
|
|
* Copyright (c) 2024 Microsoft Corporation |
3 |
|
|
* Copyright (c) 2026-present Eclipse ThreadX contributors |
4 |
|
|
* |
5 |
|
|
* This program and the accompanying materials are made available under the |
6 |
|
|
* terms of the MIT License which is available at |
7 |
|
|
* https://opensource.org/licenses/MIT. |
8 |
|
|
* |
9 |
|
|
* SPDX-License-Identifier: MIT |
10 |
|
|
**************************************************************************/ |
11 |
|
|
|
12 |
|
|
|
13 |
|
|
/**************************************************************************/ |
14 |
|
|
/**************************************************************************/ |
15 |
|
|
/** */ |
16 |
|
|
/** GUIX Component */ |
17 |
|
|
/** */ |
18 |
|
|
/** Prompt Management (Prompt) */ |
19 |
|
|
/** */ |
20 |
|
|
/**************************************************************************/ |
21 |
|
|
|
22 |
|
|
#define GX_SOURCE_CODE |
23 |
|
|
|
24 |
|
|
|
25 |
|
|
/* Include necessary system files. */ |
26 |
|
|
|
27 |
|
|
#include "gx_api.h" |
28 |
|
|
#include "gx_widget.h" |
29 |
|
|
#include "gx_prompt.h" |
30 |
|
|
#include "gx_utility.h" |
31 |
|
|
#include "gx_system.h" |
32 |
|
|
|
33 |
|
|
/**************************************************************************/ |
34 |
|
|
/* */ |
35 |
|
|
/* FUNCTION RELEASE */ |
36 |
|
|
/* */ |
37 |
|
|
/* _gx_prompt_event_process PORTABLE C */ |
38 |
|
|
/* 6.1 */ |
39 |
|
|
/* AUTHOR */ |
40 |
|
|
/* */ |
41 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
42 |
|
|
/* */ |
43 |
|
|
/* DESCRIPTION */ |
44 |
|
|
/* */ |
45 |
|
|
/* This function processes events for the specified prompt. */ |
46 |
|
|
/* */ |
47 |
|
|
/* INPUT */ |
48 |
|
|
/* */ |
49 |
|
|
/* prompt Pointer to prompt control */ |
50 |
|
|
/* block */ |
51 |
|
|
/* event_ptr Incoming event to process */ |
52 |
|
|
/* */ |
53 |
|
|
/* OUTPUT */ |
54 |
|
|
/* */ |
55 |
|
|
/* status Completion status */ |
56 |
|
|
/* */ |
57 |
|
|
/* CALLS */ |
58 |
|
|
/* */ |
59 |
|
|
/* _gx_system_memory_free Release memory */ |
60 |
|
|
/* _gx_utility_bidi_resolved_text_info_delete */ |
61 |
|
|
/* Delete dynamic bidi text */ |
62 |
|
|
/* _gx_widget_event_process Default widget event process */ |
63 |
|
|
/* */ |
64 |
|
|
/* CALLED BY */ |
65 |
|
|
/* */ |
66 |
|
|
/* Application Code */ |
67 |
|
|
/* GUIX Internal Code */ |
68 |
|
|
/* */ |
69 |
|
|
/**************************************************************************/ |
70 |
|
21335 |
UINT _gx_prompt_event_process(GX_PROMPT *prompt, GX_EVENT *event_ptr) |
71 |
|
|
{ |
72 |
|
|
|
73 |
|
|
/* Process relative to the type of event. */ |
74 |
✓✓ |
21335 |
switch (event_ptr -> gx_event_type) |
75 |
|
|
{ |
76 |
|
126 |
case GX_EVENT_DELETE: |
77 |
✓✓✓✓
|
126 |
if ((prompt -> gx_widget_style & GX_STYLE_TEXT_COPY) && prompt -> gx_prompt_string.gx_string_ptr) |
78 |
|
|
{ |
79 |
✓✓ |
6 |
if (!_gx_system_memory_free) |
80 |
|
|
{ |
81 |
|
1 |
return GX_SYSTEM_MEMORY_ERROR; |
82 |
|
|
} |
83 |
|
5 |
_gx_system_memory_free((void *)prompt -> gx_prompt_string.gx_string_ptr); |
84 |
|
5 |
prompt -> gx_prompt_string.gx_string_ptr = GX_NULL; |
85 |
|
5 |
prompt -> gx_prompt_string.gx_string_length = 0; |
86 |
|
|
} |
87 |
|
|
#if defined(GX_DYNAMIC_BIDI_TEXT_SUPPORT) |
88 |
|
|
|
89 |
|
|
if (prompt -> gx_prompt_bidi_resolved_text_info) |
90 |
|
|
{ |
91 |
|
|
_gx_utility_bidi_resolved_text_info_delete(&prompt -> gx_prompt_bidi_resolved_text_info); |
92 |
|
|
} |
93 |
|
|
#endif |
94 |
|
125 |
break; |
95 |
|
|
|
96 |
|
21209 |
default: |
97 |
|
|
|
98 |
|
|
/* Do nothing. */ |
99 |
|
21209 |
break; |
100 |
|
|
} |
101 |
|
|
|
102 |
|
|
/* Return completion status. */ |
103 |
|
21334 |
return _gx_widget_event_process((GX_WIDGET*)prompt, event_ptr); |
104 |
|
|
} |
105 |
|
|
|