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

Function shareText

src/AndroidJNICalls.cpp:107–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105 }
106
107 void shareText(const std::string& str) {
108 Logger::get().log(Logger::LogType::INFO, "[AndroidJNICalls::shareText] Share text " + str);
109 JNIEnv* env = static_cast<JNIEnv*>(SDL_GetAndroidJNIEnv());
110 jni_local_frame(env, 16, [&] {
111 jobject activity = (jobject) SDL_GetAndroidActivity();
112 jclass clazz = env->GetObjectClass(activity);
113 jmethodID method_id = env->GetStaticMethodID(clazz, "shareText",
114 "(Ljava/lang/String;)V");
115 env->CallStaticVoidMethod(clazz, method_id, string2jstring(env, str));
116 });
117 }
118
119 int get_android_text_pos_from_cursor_pos(const std::shared_ptr<RichText::TextBox>& t, const RichText::TextPosition& p) {
120 return t->get_utf16_location_from_codepoint_location(t->get_codepoint_location_from_text_position(p));

Callers 1

Calls 4

jni_local_frameFunction · 0.85
string2jstringFunction · 0.85
logMethod · 0.80
getFunction · 0.50

Tested by

no test coverage detected