MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / input_android_text_box_input_callback

Method input_android_text_box_input_callback

src/RichTextUserInput.cpp:72–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72RichTextUserInput::Changes RichTextUserInput::input_android_text_box_input_callback(const CustomEvents::AndroidTextBoxInputEvent& textboxInput) {
73 RichTextUserInput::Changes toRet{false, false};
74 switch(textboxInput.command) {
75 case CustomEvents::AndroidTextBoxInputEvent::CommandType::COMMIT_ALL: {
76 #ifdef __ANDROID__
77 std::pair<bool, bool> c = AndroidJNICalls::getChangesToCommit(id);
78 toRet.textEdited = c.first;
79 toRet.cursorChanged = c.second;
80 if(toRet.textEdited)
81 do_textbox_operation_with_undo([&]() {
82 AndroidJNICalls::commitAll(id, textBox, cursor);
83 });
84 else
85 AndroidJNICalls::commitAll(id, textBox, cursor);
86 #else
87 toRet.textEdited = toRet.cursorChanged = false;
88 #endif
89 break;
90 }
91 }
92 return toRet;
93}
94
95void RichTextUserInput::add_text_to_textbox(const std::string& inputText) {
96 do_textbox_operation_with_undo([&]() {

Callers

nothing calls this directly

Calls 2

getChangesToCommitFunction · 0.85
commitAllFunction · 0.85

Tested by

no test coverage detected