Sha256: d728b5060505c9f5ba78627a50307597a926ba5bc8bf30eb1710e1ce1ed7d7b2

Contents?: true

Size: 1.36 KB

Versions: 32

Compression:

Stored size: 1.36 KB

Contents

#include "rhodes/JNIRhodes.h"

#include "rhodes/jni/com_rhomobile_rhodes_camera_Camera.h"

#include <common/RhodesApp.h>

#undef DEFAULT_LOGCATEGORY
#define DEFAULT_LOGCATEGORY "Camera"

RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_camera_Camera_callback
  (JNIEnv *env, jclass, jstring callback, jstring filePath, jstring error, jboolean cancelled)
{
    rho_rhodesapp_callCameraCallback(rho_cast<std::string>(callback).c_str(),
        rho_cast<std::string>(filePath).c_str(), rho_cast<std::string>(error).c_str(), cancelled);
}

RHO_GLOBAL void take_picture(char* callback_url)
{
    JNIEnv *env = jnienv();
    jclass cls = getJNIClass(RHODES_JAVA_CLASS_CAMERA);
    if (!cls) return;
    jmethodID mid = getJNIClassStaticMethod(env, cls, "takePicture", "(Ljava/lang/String;)V");
    if (!mid) return;
    jstring objCallback = rho_cast<jstring>(callback_url);
    env->CallStaticVoidMethod(cls, mid, objCallback);
    env->DeleteLocalRef(objCallback);
}

RHO_GLOBAL void choose_picture(char* callback_url)
{
    JNIEnv *env = jnienv();
    jclass cls = getJNIClass(RHODES_JAVA_CLASS_CAMERA);
    if (!cls) return;
    jmethodID mid = getJNIClassStaticMethod(env, cls, "choosePicture", "(Ljava/lang/String;)V");
    if (!mid) return;
    jstring objCallback = rho_cast<jstring>(callback_url);
    env->CallStaticVoidMethod(cls, mid, objCallback);
    env->DeleteLocalRef(objCallback);
}

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
rhodes-2.2.6 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.6.beta.1 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.5 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.5.beta.3 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.5.beta.2 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.5.beta.1 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.4.beta.1 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.3 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.3.beta.1 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.2 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.2.beta.1 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.1 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.1.beta.2 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.1.beta.1 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.0 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.0.beta.3 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.0.beta.2 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.2.0.beta.1 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.1.0 platform/android/Rhodes/jni/src/camera.cpp
rhodes-2.0.3 platform/android/Rhodes/jni/src/camera.cpp