void QAndroidOffscreenEditText::setVerticalScrollBarEnabled(bool verticalScrollBarEnabled)
{
	if (QJniObject * view = offscreenView())
	{
		view->callVoid("setVerticalScrollBarEnabled", jboolean(verticalScrollBarEnabled));
	}
}
/*
 * Class:     de_rwth_0005faachen_techinfo_ltilib_Matrix
 * Method:    _prettyCloseTo
 * Signature: (JLde/rwth_aachen/techinfo/ltilib/Matrix;D)Z
 */
JNIEXPORT jboolean JNICALL Java_de_rwth_1aachen_techinfo_ltilib_Matrix__1prettyCloseTo
  (JNIEnv *env, jobject m, jlong nat, jlong other, jdouble tol) {

  // insert your code here
  return jboolean(jlong2matrix(nat)
->prettyCloseTo(*jlong2matrix(other),tol));
}
void QAndroidOffscreenEditText::setHorizontallyScrolling(bool whether)
{
	if (QJniObject * view = offscreenView())
	{
		view->callVoid("setHorizontallyScrolling", jboolean(whether));
	}
}
void QAndroidOffscreenEditText::setAllCaps(bool allCaps)
{
	if (QJniObject * view = offscreenView())
	{
		view->callVoid("setAllCaps", jboolean(allCaps));
	}
}
void QAndroidOffscreenEditText::setTextIsSelectable(bool selectable)
{
	if (QJniObject * view = offscreenView())
	{
		view->callVoid("setTextIsSelectable", jboolean(selectable));
	}
}
void QAndroidOffscreenEditText::setSingleLine(bool singleLine)
{
	if (QJniObject * view = offscreenView())
	{
		view->callVoid("setSingleLine", jboolean(singleLine));
	}
}
void QAndroidOffscreenEditText::setCursorVisible(bool visible)
{
	if (QJniObject * view = offscreenView())
	{
		view->callVoid("setCursorVisible", jboolean(visible));
	}
}
void QAndroidOffscreenEditText::setAllowFullscreenKeyboard(bool allow)
{
	if (QJniObject * view = offscreenView())
	{
		view->callVoid("setAllowFullscreenKeyboard", jboolean(allow));
	}
}
void QAndroidDialog::showMessage(
	const QString & title,
	const QString & explanation,
	const QString & positive_button_text,
	const QString & negative_button_text,
	const QString & neutral_button_text,
	bool pause,
	bool lock_rotation)
{
	if (!isInteractiveMode())
	{
		qDebug() << "Dialog was not shown due to non-interactive mode";
		qDebug() << "title: \"" << title << "\"";
		qDebug() << "explanation: " << explanation << "\"";
		return;
	}

	if (dialog_helper_)
	{
		if (pause)
		{
			lock_rotation = true;
		}
		// TODO: We can't read or lock orientation when we don't have an activity.
		// Currently, we check it via customContextSet(), but this might not always be the right way.
		bool in_activity = !QAndroidQPAPluginGap::customContextSet();
		int orientation = (lock_rotation && in_activity)? QAndroidScreenOrientation::getCurrentFixedOrientation(): -1;
		dialog_helper_->callParamVoid("showMessage",
			"Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZIZ",
			QJniLocalRef(title).jObject(),
			QJniLocalRef(explanation).jObject(),
			QJniLocalRef(positive_button_text).jObject(),
			QJniLocalRef(negative_button_text).jObject(),
			QJniLocalRef(neutral_button_text).jObject(),
			jboolean(pause),
			jint(orientation),
			jboolean(in_activity)
		);
	}
	else
	{
		qCritical()<<"Failed to show message because DialogHelper instance not created!";
	}
}
status_t NativeInputEventSender::receiveFinishedSignals(JNIEnv* env) {
    if (kDebugDispatchCycle) {
        ALOGD("channel '%s' ~ Receiving finished signals.", getInputChannelName());
    }

    ScopedLocalRef<jobject> senderObj(env, NULL);
    bool skipCallbacks = false;
    for (;;) {
        uint32_t publishedSeq;
        bool handled;
        status_t status = mInputPublisher.receiveFinishedSignal(&publishedSeq, &handled);
        if (status) {
            if (status == WOULD_BLOCK) {
                return OK;
            }
            ALOGE("channel '%s' ~ Failed to consume finished signals.  status=%d",
                    getInputChannelName(), status);
            return status;
        }

        ssize_t index = mPublishedSeqMap.indexOfKey(publishedSeq);
        if (index >= 0) {
            uint32_t seq = mPublishedSeqMap.valueAt(index);
            mPublishedSeqMap.removeItemsAt(index);

            if (kDebugDispatchCycle) {
                ALOGD("channel '%s' ~ Received finished signal, seq=%u, handled=%s, "
                        "pendingEvents=%zu.",
                        getInputChannelName(), seq, handled ? "true" : "false",
                        mPublishedSeqMap.size());
            }

            if (!skipCallbacks) {
                if (!senderObj.get()) {
                    senderObj.reset(jniGetReferent(env, mSenderWeakGlobal));
                    if (!senderObj.get()) {
                        ALOGW("channel '%s' ~ Sender object was finalized "
                                "without being disposed.", getInputChannelName());
                        return DEAD_OBJECT;
                    }
                }

                env->CallVoidMethod(senderObj.get(),
                        gInputEventSenderClassInfo.dispatchInputEventFinished,
                        jint(seq), jboolean(handled));
                if (env->ExceptionCheck()) {
                    ALOGE("Exception dispatching finished signal.");
                    skipCallbacks = true;
                }
            }
        }
    }
}
Q_DECL_EXPORT jboolean JNICALL Java_AndroidOffscreenEditText_nativeOnKey(JNIEnv *, jobject, jlong param, jboolean down, jint keycode)
{
	if (param)
	{
		void * vp = reinterpret_cast<void*>(param);
		QAndroidOffscreenEditText * edit = qobject_cast<QAndroidOffscreenEditText*>(reinterpret_cast<QAndroidOffscreenView*>(vp));
		if (edit)
		{
			return jboolean(edit->javaOnKey(down? true: false, keycode));
		}
	}
	qWarning()<<__FUNCTION__<<"Zero param!";
	return JNI_FALSE;
}
Beispiel #12
0
static jvalue numToJvalue(const T &num)
{
    jvalue value;
    switch (sig) //a good compiler should simplify out the switch
    {
    case 'Z': value.z = jboolean(num); return value;
    case 'C': value.c = jchar(num); return value;
    case 'B': value.b = jbyte(num); return value;
    case 'S': value.s = jshort(num); return value;
    case 'I': value.i = jint(num); return value;
    case 'J': value.j = jlong(num); return value;
    case 'F': value.f = jfloat(num); return value;
    case 'D': value.d = jdouble(num); return value;
    }
    poco_bugcheck_msg(std::string(1, sig).c_str()); throw;
}
Beispiel #13
0
string JNIKit::unwrapString(jstring str) {
	return string(env->GetStringUTFChars(str, jboolean(false)));
}
Beispiel #14
0
bool JByteBuffer::isDirect() const {
  static auto meth = javaClassStatic()->getMethod<jboolean()>("isDirect");
  return meth(self());
}
/*
 * Class:     de_rwth_0005faachen_techinfo_ltilib_Matrix
 * Method:    _equals
 * Signature: (JLde/rwth_aachen/techinfo/ltilib/Matrix;)Z
 */
JNIEXPORT jboolean JNICALL Java_de_rwth_1aachen_techinfo_ltilib_Matrix__1equals
  (JNIEnv *env, jobject m, jlong nat, jlong other) {

  // insert your code here
  return jboolean(jlong2matrix(nat)->equals(*jlong2matrix(other)));
}
Beispiel #16
0
string JavaString::unwrap() {
	return kit->getEnv()->GetStringUTFChars(ref, jboolean(false));
}
/*
 * Class:     de_rwth_0005faachen_techinfo_ltilib_Matrix
 * Method:    _compare
 * Signature: (JJ)Z
 */
JNIEXPORT jboolean JNICALL Java_de_rwth_1aachen_techinfo_ltilib_Matrix__1compare
  (JNIEnv *env, jobject m, jlong nat, jlong other) {

  return jboolean(*jlong2matrix(nat) == *jlong2matrix(other));
}