• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ KNI_GetParameterAsInt函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中KNI_GetParameterAsInt函数的典型用法代码示例。如果您正苦于以下问题:C++ KNI_GetParameterAsInt函数的具体用法?C++ KNI_GetParameterAsInt怎么用?C++ KNI_GetParameterAsInt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了KNI_GetParameterAsInt函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Java_com_sun_j2me_location_PlatformLocationProvider_getLastLocationImpl

/* JAVADOC COMMENT ELIDED */
KNIEXPORT KNI_RETURNTYPE_INT
    Java_com_sun_j2me_location_PlatformLocationProvider_getLastLocationImpl() {

    jint provider;
    jboolean ret;

    KNI_StartHandles(2);
    KNI_DeclareHandle(string_obj);
    KNI_DeclareHandle(locationInfo);

    provider = KNI_GetParameterAsInt(1);
    KNI_GetParameterAsObject(2, locationInfo);

    ret = getLocation(locationInfo, string_obj, getProviderInfo(provider));    

    KNI_EndHandles();
    KNI_ReturnBoolean(ret);
}
开发者ID:sfsy1989,项目名称:j2me,代码行数:19,代码来源:jsr179_locationProvider_kni.c


示例2: Java_javax_microedition_khronos_egl_EGL10Impl__1putWindowContents

/* private native void _putWindowContents( Graphics winGraphics , int pixmapPointer ) ; */
KNIEXPORT KNI_RETURNTYPE_VOID
Java_javax_microedition_khronos_egl_EGL10Impl__1putWindowContents() {
    
    jint pixmap = KNI_GetParameterAsInt(2);

    KNI_StartHandles(1);
    KNI_DeclareHandle(graphicsHandle);
    KNI_GetParameterAsObject(1, graphicsHandle);

#ifdef DEBUG
    printf("JSR239_putWindowContents(0x%x, 0x%x)\n",
	   graphicsHandle, pixmap);
#endif
    JSR239_putWindowContents(graphicsHandle, (JSR239_Pixmap *)pixmap, 0);

    KNI_EndHandles();
    KNI_ReturnVoid();
}
开发者ID:jiangxilong,项目名称:yari,代码行数:19,代码来源:JSR239-KNIEGL11Impl.c


示例3: Java_javax_microedition_lcdui_DateFieldLFImpl_setDate0

/**
 * 
 * The datetime parameter coming from java is in milliseconds since the
 * epoch 00:00 1/1/1970. It is needed to translate this value to the native
 * date/time representation. (for example, QT uses the same epoch, but in
 * resolution of seconds rather than milliseconds).
 *
 * private native void setDate0 ( int nativeId , long date ) ; 
 * @param date in milliseconds since 00:00 1/1/1970
 */
KNIEXPORT KNI_RETURNTYPE_VOID
Java_javax_microedition_lcdui_DateFieldLFImpl_setDate0() {
    MidpItem *dfPtr = NULL;
    MidpError err;

    jint nativeId = KNI_GetParameterAsInt(1);
    jlong date = KNI_GetParameterAsLong(2); /* Long occupies two parameters */

    dfPtr = (MidpItem *)nativeId;

    err = lfpport_datefield_set_date(dfPtr,(long)(date/1000));

    if (err != KNI_OK) {
      KNI_ThrowNew(midpOutOfMemoryError, NULL);
    }

    KNI_ReturnVoid();
}
开发者ID:jiangxilong,项目名称:yari,代码行数:28,代码来源:lfp_datefield.c


示例4: KNIDECL

/**
 * Native connection registry method to check in connections that are in
 * launch pending state for a specific MIDlet.
 *
 * @param suiteId Suite ID of the MIDlet as zero terminated ASCII byte array
 * @param className Class name of the MIDlet as zero terminated ASCII byte
 *                  array
 */
KNIEXPORT void
KNIDECL(com_sun_midp_io_j2me_push_ConnectionRegistry_checkInByMidlet0) {
    SuiteIdType suiteId;

    KNI_StartHandles(1);
    KNI_DeclareHandle(classNameObj);

    suiteId = KNI_GetParameterAsInt(1);
    KNI_GetParameterAsObject(2, classNameObj);

    SNI_BEGIN_RAW_POINTERS;
    pushcheckinbymidlet(/*(char*)JavaByteArray(suiteIdObj)*/ suiteId,
                        (char*)JavaByteArray(classNameObj));
    SNI_END_RAW_POINTERS;

    KNI_EndHandles();
    KNI_ReturnVoid();
}
开发者ID:jiangxilong,项目名称:yari,代码行数:26,代码来源:midp_connection_registry_kni.c


示例5: KNIDECL

/* JAVADOC COMMENT ELIDED */
KNIEXPORT KNI_RETURNTYPE_VOID
    KNIDECL(com_sun_j2me_location_LocationPersistentStorage_updateLandmarkImpl) {
    
    jint landmarkID;
    javacall_result res;
    javacall_landmarkstore_landmark *landmark;
    jint numAddressFields;
    
    KNI_StartHandles(3);
    KNI_DeclareHandle(landmarkObj);
    KNI_DeclareHandle(stringObj);
    GET_PARAMETER_AS_UTF16_STRING(1, storeName)
    landmarkID = KNI_GetParameterAsInt(2);
    KNI_GetParameterAsObject(3, landmarkObj);
    numAddressFields = KNI_GetIntField(landmarkObj, 
            landmarkImplFieldID.numAddressInfoFields);
    landmark = JAVAME_MALLOC(SIZE_OF_LANDMARK_INFO(numAddressFields));

    if (landmark != NULL) {
        if (fill_landmark(landmarkObj, landmark, stringObj) == KNI_TRUE) {
            res = javacall_landmarkstore_landmark_update(storeName, 
                                    (javacall_handle)landmarkID, landmark);
            switch (res) {
                case JAVACALL_OK:
                    /* Landmark updated successfully */
                    break;
                case JAVACALL_INVALID_ARGUMENT:
                    /* wrong landmark ID */
                    KNI_ThrowNew(jsropIllegalArgumentException, 
                                "Landmark does not belong to this store");
                    break;
                default:
                    /* operation Failed */
                    KNI_ThrowNew(jsropIOException, "I/O error");
                    break;
            }
        }
        JAVAME_FREE(landmark);
    }

    RELEASE_UTF16_STRING_PARAMETER
    KNI_EndHandles();
    KNI_ReturnVoid();
}
开发者ID:hbao,项目名称:phonemefeaturedevices,代码行数:45,代码来源:locationPersistentStorage_kni.c


示例6: Java_com_sun_j2me_location_PlatformLocationProvider_getStateImpl

/* JAVADOC COMMENT ELIDED */
KNIEXPORT KNI_RETURNTYPE_INT
    Java_com_sun_j2me_location_PlatformLocationProvider_getStateImpl() {

    jsr179_state state = JSR179_OUT_OF_SERVICE;
    jint provider = KNI_GetParameterAsInt(1);
    jint ret=0; /* out of service */
    
    if (stateValue.filled == KNI_FALSE) {

        KNI_StartHandles(1);
        KNI_DeclareHandle(clazz);
    
        KNI_FindClass("javax/microedition/location/LocationProvider", clazz);
        if(!KNI_IsNullHandle(clazz)) {
            stateValue.available = KNI_GetStaticIntField(clazz, 
                KNI_GetStaticFieldID(clazz, "AVAILABLE", "I"));
            stateValue.temporarilyUnavailable = KNI_GetStaticIntField(clazz, 
                KNI_GetStaticFieldID(clazz, "TEMPORARILY_UNAVAILABLE", "I"));
            stateValue.outOfService = KNI_GetStaticIntField(clazz, 
                KNI_GetStaticFieldID(clazz, "OUT_OF_SERVICE", "I"));
            stateValue.filled = KNI_TRUE;
        }
        KNI_EndHandles();

    }        

    if (stateValue.filled == KNI_TRUE) {
        jsr179_provider_state((jsr179_handle)provider, &state);
        switch(state) {
            case JSR179_AVAILABLE:
                ret = stateValue.available;
                break;
            case JSR179_TEMPORARILY_UNAVAILABLE:
                ret = stateValue.temporarilyUnavailable;
                break;
            case JSR179_OUT_OF_SERVICE:
            default:
                ret = stateValue.outOfService;
                break;
        }
    }

    KNI_ReturnInt(ret);
}
开发者ID:sfsy1989,项目名称:j2me,代码行数:45,代码来源:jsr179_locationProvider_kni.c


示例7: KNIDECL

/**
 * Gets the MIDlet name for the given registered push connection.
 * <p>
 * Java declaration:
 * <pre>
 *     getEntry0([B[BI)I
 * </pre>
 *
 * @param connection The connection to add to the push registry
 * @param midlet A byte array to store the MIDlet name
 * @param midletsize The size of <tt>midlet</tt>
 *
 * @return <tt>0</tt> if successful, otherwise <tt>-1</tt>
 *
 * @throw IOException if the registry entry is too long.
 */
KNIEXPORT KNI_RETURNTYPE_INT
KNIDECL(com_sun_midp_io_j2me_push_ConnectionRegistry_getEntry0) {
    int midletsize;
    char *regentry;
    int regsize ;
    int ret = -1;
    int connLen;
    char *szConn = NULL;

    midletsize = KNI_GetParameterAsInt(3);

    KNI_StartHandles(2);
    KNI_DeclareHandle(conn);
    KNI_DeclareHandle(regObject);

    KNI_GetParameterAsObject(1, conn);
    connLen = KNI_GetArrayLength(conn);
    ret = -1;
    if ((szConn = midpMalloc(connLen)) != NULL) {
        KNI_GetRawArrayRegion(conn, 0, connLen, (jbyte*)szConn);

        KNI_GetParameterAsObject(2, regObject);

        regentry = pushfindconn(szConn);
        if (NULL != regentry) {
            regsize = strlen(regentry) + 1;
            if (regsize < midletsize) {
                KNI_SetRawArrayRegion(regObject, 0, regsize,
                                      (jbyte*)regentry);
                ret = 0;
            }
            else {
                KNI_ThrowNew(midpIOException, "registration too long");
            }
        }
        midpFree(szConn);
    }
    else {
        KNI_ThrowNew(midpOutOfMemoryError, NULL);
    }
    KNI_EndHandles();

    KNI_ReturnInt(ret);
}
开发者ID:sfsy1989,项目名称:j2me,代码行数:60,代码来源:midp_connection_registry_kni.c


示例8: KNIDECL

KNIEXPORT KNI_RETURNTYPE_VOID
KNIDECL(com_sun_midp_midletsuite_MIDletSuiteImpl_lockMIDletSuite) {
    jboolean isUpdate;
    SuiteIdType suiteId;
    int status;

    suiteId  = KNI_GetParameterAsInt(1);
    isUpdate = KNI_GetParameterAsBoolean(2);
    /* Throw an exception here if we have an error */
    status = lock_storage(suiteId, isUpdate);
    if (status < 0) {
        if (status == OUT_OF_MEM_LEN) {
            KNI_ThrowNew(midpOutOfMemoryError, NULL);
        } else if (status == SUITE_LOCKED) {
            KNI_ThrowNew(midletsuiteLocked, NULL);
        }
    }
    KNI_ReturnVoid();
}
开发者ID:AllBinary,项目名称:phoneme-components-midp,代码行数:19,代码来源:suitestore_midletsuiteimpl_kni.c


示例9: Java_com_sun_jsr082_bluetooth_btspp_BTSPPNotifierImpl_pushCheckout

/*
 * Checks out (takes ownership of) an active server connection maintained
 * by push subsystem.
 *
 * @param url URL used during registration of the push entry
 * @param suiteId suite id
 * @return true if the operation succeeds, false otherwise
 */
KNIEXPORT KNI_RETURNTYPE_BOOLEAN
Java_com_sun_jsr082_bluetooth_btspp_BTSPPNotifierImpl_pushCheckout(void)
{
    jboolean retval = KNI_FALSE;
    MidpString wsUrl;
    SuiteIdType suiteId;
    char *szUrl;
    bt_port_t port;
    jfieldID notifHandleID = NULL;
    jfieldID pushHandleID  = NULL;

    KNI_StartHandles(3);
    KNI_DeclareHandle(thisHandle);
    KNI_DeclareHandle(urlHandle);
    KNI_DeclareHandle(classHandle);
    KNI_GetClassPointer(classHandle);

    GET_FIELDID(classHandle, "handle", "I", notifHandleID)
    GET_FIELDID(classHandle, "pushHandle", "I", pushHandleID)

    KNI_GetThisPointer(thisHandle);
    KNI_GetParameterAsObject(1, urlHandle);
    suiteId = KNI_GetParameterAsInt(2);
    wsUrl = midpNewString(urlHandle);
    szUrl = midpJcharsToChars(wsUrl);
    if (bt_push_parse_url(szUrl, &port, NULL) == JAVACALL_OK) {
        if (pushcheckout(szUrl, 0, (char*)midp_suiteid2chars(suiteId)) == -2) {
            KNI_ThrowNew(midpIOException, "Port already in use.");
        } else {
            javacall_handle handle;
            bt_pushid_t pushid = bt_push_checkout_server(&port, &handle, NULL);
            if (pushid != BT_INVALID_PUSH_HANDLE) {
                KNI_SetIntField(thisHandle, pushHandleID, (jint)pushid);
                KNI_SetIntField(thisHandle, notifHandleID, (jint)handle);
                retval = KNI_TRUE;
            }
        }
    }
    midpFree(szUrl);
    MIDP_FREE_STRING(wsUrl);
    KNI_EndHandles();
    KNI_ReturnBoolean(retval);
}
开发者ID:Sektor,项目名称:phoneme-qtopia,代码行数:51,代码来源:btSPPNotifierGlue.c


示例10: Java_com_sun_midp_jsr82emul_DeviceEmul_initDevice

KNIEXPORT KNI_RETURNTYPE_INT
Java_com_sun_midp_jsr82emul_DeviceEmul_initDevice() {
    LOG("DeviceEmul_initDevice()");
    
    KNI_StartHandles(1);
    KNI_DeclareHandle(buf);
    KNI_GetParameterAsObject(1, buf);
    memcpy(emul_data.local_addr, JavaByteArray(buf), BT_ADDRESS_SIZE);
    KNI_EndHandles();
    
    emul_data.device_class_base = DEFAULT_COD;
    emul_data.device_class = loadCod();
    emul_data.access_code = KNI_GetParameterAsInt(2);

    state |= DEVICE_INITED;
    midp_thread_signal(JSR82_SIGNAL, BTE_SIGNAL_HANDLE, 0);

    KNI_ReturnInt((jint)emul_data.device_class);
}
开发者ID:sfsy1989,项目名称:j2me,代码行数:19,代码来源:emul.c


示例11: KNIDECL

/**
 * Gets an ARGB integer array from this <tt>ImmutableImage</tt>. The
 * array consists of values in the form of 0xAARRGGBB.
 * <p>
 * Java declaration:
 * <pre>
 *     getRGB([IIIIIII)V
 * </pre>
 *
 * @param rgbData The target integer array for the ARGB data
 * @param offset Zero-based index of first ARGB pixel to be saved
 * @param scanlen Number of intervening pixels between pixels in
 *                the same column but in adjacent rows
 * @param x The x coordinate of the upper left corner of the
 *          selected region
 * @param y The y coordinate of the upper left corner of the
 *          selected region
 * @param width The width of the selected region
 * @param height The height of the selected region
 */
KNIEXPORT KNI_RETURNTYPE_VOID
KNIDECL(javax_microedition_lcdui_ImageData_getRGB) {
    int height = KNI_GetParameterAsInt(7);
    int width = KNI_GetParameterAsInt(6);
    int y = KNI_GetParameterAsInt(5);
    int x = KNI_GetParameterAsInt(4);
    int scanlength = KNI_GetParameterAsInt(3);
    int offset = KNI_GetParameterAsInt(2);
    int *rgbBuffer;
    java_imagedata *srcImageDataPtr;
    gxpport_mutableimage_native_handle srcImageNativeData;
    img_native_error_codes error = IMG_NATIVE_IMAGE_NO_ERROR;

    KNI_StartHandles(2);
    KNI_DeclareHandle(rgbData);
    KNI_DeclareHandle(thisObject);

    KNI_GetParameterAsObject(1, rgbData);
    KNI_GetThisPointer(thisObject);


    SNI_BEGIN_RAW_POINTERS;
    
    rgbBuffer = JavaIntArray(rgbData);

    srcImageDataPtr = IMGAPI_GET_IMAGEDATA_PTR(thisObject);
    srcImageNativeData =
      (gxpport_mutableimage_native_handle)srcImageDataPtr->nativeImageData;    

    if (srcImageDataPtr->isMutable) {
        gxpport_get_mutable_argb(srcImageNativeData,
                                 rgbBuffer, offset, scanlength,
                                 x, y, width, height, 
                                 &error);
    } else {
        gxpport_get_immutable_argb(srcImageNativeData,
                                   rgbBuffer, offset, scanlength,
                                   x, y, width, height, 
                                   &error);
    }

    SNI_END_RAW_POINTERS;
    
    if (error != IMG_NATIVE_IMAGE_NO_ERROR) {
      KNI_ThrowNew(midpOutOfMemoryError, NULL);
    }

    KNI_EndHandles();
    KNI_ReturnVoid();
}
开发者ID:AllBinary,项目名称:phoneme-components-midp,代码行数:70,代码来源:imgp_imagedata_kni.c


示例12: KNIDECL

/*  protected native int nGetVolume ( int mediaType ) ; */
KNIEXPORT KNI_RETURNTYPE_INT
KNIDECL(com_sun_mmedia_DirectVolume_nGetVolume) {
    jint handle = KNI_GetParameterAsInt(1);
    javacall_result ret = JAVACALL_FAIL;
    long volume;
    KNIPlayerInfo* pKniInfo = (KNIPlayerInfo*)handle;

    MMP_DEBUG_STR("[kni_volume] +nGetVolume\n");

    if (pKniInfo && pKniInfo->pNativeHandle) {
        ret = javacall_media_get_volume(pKniInfo->pNativeHandle, &volume);
    } else {
        MMP_DEBUG_STR("[nGetVolume] Invalid native handle");
    }
    if (ret != JAVACALL_OK) {
        volume = -1;
    }

    KNI_ReturnInt((int)volume);
}
开发者ID:Sektor,项目名称:phoneme-qtopia,代码行数:21,代码来源:KNIDirectVolume.c


示例13: KNIDECL

/**
 * Native method void removeComponent(int componentId) of
 * com.sun.midp.midletsuite.DynamicComponentStorage.
 * <p>
 * Removes a dynamic component given its ID.
 * <p>
 * If the component is in use it must continue to be available
 * to the other components that are using it.
 *
 * @param componentId ID of the component ot remove
 *
 * @throws IllegalArgumentException if the component cannot be found
 * @throws MIDletSuiteLockedException is thrown, if the component is
 *                                    locked
 */
KNIEXPORT KNI_RETURNTYPE_VOID
KNIDECL(com_sun_midp_midletsuite_DynamicComponentStorage_removeComponent) {
    MIDPError status;
    MidletSuiteData* pData;
    ComponentIdType componentId = KNI_GetParameterAsInt(1);

    do {
        /* check that the component exists */
        pData = get_component_data(componentId);
        if (pData == NULL) {
            status = NOT_FOUND;
            break;
        }

        status = begin_transaction(TRANSACTION_REMOVE_COMPONENT,
                                   componentId, NULL);
        if (status != ALL_OK) {
            break;
        }

        status = delete_components_files(pData->suiteId, componentId);
        if (status != ALL_OK) {
            break;
        }

        (void)remove_from_component_list_and_save(pData->suiteId, componentId);
    } while(0);

    (void)finish_transaction();

    if (status == SUITE_LOCKED) {
        KNI_ThrowNew(midletsuiteLocked, NULL);
    } else if (status == BAD_PARAMS || status == NOT_FOUND) {
        KNI_ThrowNew(midpIllegalArgumentException, "bad component ID");
    } else if (status != ALL_OK) {
        KNI_ThrowNew(midpRuntimeException,
            (status == OUT_OF_MEMORY) ? "Out of memory!" : "Remove failed");
    }

    KNI_ReturnVoid();
}
开发者ID:Sektor,项目名称:phoneme-qtopia,代码行数:56,代码来源:components_storage_kni.c


示例14: Java_javax_microedition_lcdui_DateFieldLFImpl_getDate0

/**
 * The datetime parameter returned to java must be in milliseconds since the
 * epoch 00:00 1/1/1970. 
 * It is needed to translate the native value to the java date/time
 * representation. (for example, QT uses the same epoch, but in
 * resolution of seconds rather than milliseconds, so it is needed to multiply
 * the value by 1000 to pass to java).
 *
 * private native long getDate0 ( int nativeId ) ; 
 * @return date in milliseconds since 00:00 1/1/1970
 */
KNIEXPORT KNI_RETURNTYPE_LONG
Java_javax_microedition_lcdui_DateFieldLFImpl_getDate0() {
    MidpItem *dfPtr = NULL;
    MidpError err;

    jint nativeId = KNI_GetParameterAsInt(1);

    jlong returnValue = 0L ;
    
    dfPtr = (MidpItem *)nativeId;

    err = lfpport_datefield_get_date((long*)(void*)&returnValue, dfPtr);

    if (err != KNI_OK) {
      KNI_ThrowNew(midpOutOfMemoryError, NULL);
    }

    returnValue *= 1000;

    KNI_ReturnLong(returnValue);
}
开发者ID:jiangxilong,项目名称:yari,代码行数:32,代码来源:lfp_datefield.c


示例15: KNIDECL

/**
 * Delete all messages registered against specified suite ID.
 *
 * @param msid The MIDlet suite ID.
 *
 */
KNIEXPORT KNI_RETURNTYPE_VOID
KNIDECL(com_sun_midp_wma_WMACleanupMonitor_deleteMessages0) { 

    /** The MIDP String version of the Midlet suite ID. */
    int msid = UNUSED_APP_ID;

    /* Pick up the Midlet Suite ID string. */
    msid = KNI_GetParameterAsInt(1);

    /*
     * Invoke a native function that will delete all messages
     * registered against msid.
     */
    jsr120_sms_cleanup_midlet_suite(msid);
    jsr120_cbs_delete_midlet_suite_msg(msid);
#if ENABLE_JSR_205
    jsr205_mms_delete_midlet_suite_msg(msid);
#endif

    KNI_ReturnVoid();
}
开发者ID:Sektor,项目名称:phoneme-qtopia,代码行数:27,代码来源:jsr120_msg_cleanup.c


示例16: Java_com_sun_pisces_AbstractSurface_drawRGBImpl

KNIEXPORT KNI_RETURNTYPE_VOID
Java_com_sun_pisces_AbstractSurface_drawRGBImpl() {
    KNI_StartHandles(2);
    KNI_DeclareHandle(objectHandle);
    KNI_DeclareHandle(arrayHandle);

    jint offset = KNI_GetParameterAsInt(2);
    jint scanLength = KNI_GetParameterAsInt(3);
    jint x = KNI_GetParameterAsInt(4);
    jint y = KNI_GetParameterAsInt(5);
    jint width = KNI_GetParameterAsInt(6);
    jint height = KNI_GetParameterAsInt(7);
    jfloat opacity = KNI_GetParameterAsFloat(8);

    jint srcX = 0;
    jint srcY = 0;

    Surface* surface;

    KNI_GetParameterAsObject(1, arrayHandle);

    KNI_GetThisPointer(objectHandle);
    surface = (Surface*)JLongToPointer(
                  KNI_GetLongField(objectHandle, fieldIds[SURFACE_NATIVE_PTR]));

    CORRECT_DIMS(surface, x, y, width, height, srcX, srcY);

    if ((width > 0) && (height > 0)) {
        jint* tempArray;
        offset += srcY * scanLength + srcX;

        SNI_BEGIN_RAW_POINTERS;

        tempArray = &JavaIntArray(arrayHandle)[offset];

        ACQUIRE_SURFACE(surface, objectHandle);
        surface_drawRGB(surface, x, y, width, height, tempArray, scanLength,
                        opacity);
        RELEASE_SURFACE(surface, objectHandle);

        SNI_END_RAW_POINTERS;
    }

    KNI_EndHandles();
    KNI_ReturnVoid();
}
开发者ID:sfsy1989,项目名称:j2me,代码行数:46,代码来源:JAbstractSurface.c


示例17: Java_com_sun_perseus_platform_ResourceHandler_getRomizedResource

/**
 * Stores the romized byte array in corresponding Java array
 * @param the required resource (initialFont or defaultFont)
 *
 */
KNIEXPORT KNI_RETURNTYPE_VOID
Java_com_sun_perseus_platform_ResourceHandler_getRomizedResource() {

	jbyte *font_data;
    int font_type = -1;
    int buflen = -1;
	int size = -1;
    KNI_StartHandles(2);
    KNI_DeclareHandle(clazz);
    KNI_DeclareHandle(bufHandle);
    KNI_GetClassPointer(clazz);
    
    font_type = KNI_GetParameterAsInt(1);
    if (font_type == DEFAULT_FONT) {
        KNI_GetStaticObjectField(clazz, KNI_GetStaticFieldID(clazz, "defaultFont", "[B"), bufHandle);
		size = sizeof(defaultFont);
		font_data = defaultFont;
    } else {
        KNI_GetStaticObjectField(clazz, KNI_GetStaticFieldID(clazz, "initialFont", "[B"), bufHandle);
		size = sizeof(initialFont);
		font_data = initialFont;
    }
    
    if (KNI_IsNullHandle(bufHandle)) {
        KNI_ThrowNew(midpNullPointerException, 0);
    } else {
        buflen = KNI_GetArrayLength(bufHandle);
        if (buflen < size) {
			//REPORT_ERROR(LC_HIGHUI, "java array too small");
            KNI_ThrowNew(midpArrayIndexOutOfBoundsException, 0);
        } else {
			KNI_SetRawArrayRegion(bufHandle, 0, size, (jbyte*)font_data);
        }
    }

    KNI_EndHandles();
    KNI_ReturnVoid();
}
开发者ID:Sektor,项目名称:phoneme-qtopia,代码行数:43,代码来源:romizedFonts.c


示例18: KNIDECL

KNIEXPORT KNI_RETURNTYPE_VOID
KNIDECL(com_sun_amms_DirectSoundSource3D_nAddPlayer)
{
    javacall_audio3d_soundsource3d_t *src = getNativePtr(KNIPASSARGS 0);
    KNIPlayerInfo* pKniInfo = (KNIPlayerInfo*)KNI_GetParameterAsInt( 1 );
    javacall_handle player = ( javacall_handle )( pKniInfo->pNativeHandle );
    javacall_result result = JAVACALL_FAIL;

    result = javacall_audio3d_soundsource3d_add_player( src, player );

    if( result == JAVACALL_INVALID_ARGUMENT )
    {
        KNI_ThrowNew( "java/lang/IllegalArgumentException",
"\nInvalid arguments were passed to the native part of \
SoundSource3D.addPlayer\n"
                );
        KNI_ReturnVoid();
    }

    if( result == JAVACALL_NOT_IMPLEMENTED )
    {
        KNI_ThrowNew( "javax/microedition/media/MediaException",
                "\nAdding the Player to SoundSource3D is not supported\n"
            );
        KNI_ReturnVoid();
    }

    if( result != JAVACALL_OK )
    {
        KNI_ThrowNew( "java/lang/RuntimeException",
"\nNative error occurred while adding the Player to SoundSource3D\n"
            );
        KNI_ReturnVoid();
    }


    KNI_ReturnVoid();
}
开发者ID:Sektor,项目名称:phoneme-qtopia,代码行数:38,代码来源:KNIDirectSoundSource3D.c


示例19: Java_com_sun_midp_io_j2me_datagram_Protocol_addrToString

/**
 * Get a hostname for the given raw IPv4 address.
 * <p>
 * Java declaration:
 * <pre>
 *     static addrToString(I)Ljava/lang/String;
 * </pre>
 *
 * @param ipn raw IPv4 address
 * @return The hostname or <tt>ipn</tt> as a dotted-quad if
 *         no hostname was found
 */
KNIEXPORT KNI_RETURNTYPE_OBJECT
Java_com_sun_midp_io_j2me_datagram_Protocol_addrToString(void) {
    jint ipn;
    jchar* result;
    int resultLen;
    int status;

    ipn = KNI_GetParameterAsInt(1);

    status = pcsl_network_addrToString((unsigned char*)&ipn, &result,
                                       &resultLen);
    KNI_StartHandles(1);
    KNI_DeclareHandle(resultObj);

    if (PCSL_NET_SUCCESS == status) {
        KNI_NewString(result, (jsize)resultLen, resultObj);
        pcsl_mem_free(result);
    } else {
        KNI_ThrowNew(midpOutOfMemoryError, NULL);
    }

    KNI_EndHandlesAndReturnObject(resultObj);
}
开发者ID:jiangxilong,项目名称:yari,代码行数:35,代码来源:datagramProtocol.c


示例20: Java_com_sun_cldc_isolate_Isolate_stop

/* void stop(int exit_code, int exit_reason); */
void Java_com_sun_cldc_isolate_Isolate_stop(JVM_SINGLE_ARG_TRAPS) {
  UsingFastOops fast_oops;
  IsolateObj::Fast isolate_obj = GET_PARAMETER_AS_OOP(0);
  Task::Fast task = isolate_obj().task();
  const int exit_code = KNI_GetParameterAsInt(1);
  const int exit_reason = KNI_GetParameterAsBoolean(2);

  switch (isolate_obj().status()) {
  case Task::TASK_NEW:
    isolate_obj().terminate(exit_code JVM_NO_CHECK_AT_BOTTOM);
    // Isolate was never started, so no threads to kill.
    break;

  case Task::TASK_STARTED:
    GUARANTEE(task.not_null(), "Task must exist for running Isolate");
    task().stop(exit_code, exit_reason JVM_NO_CHECK_AT_BOTTOM);
    break;

  default:
    // OK to call stop() multiple times. Just ignore it.
    break;
  }
}
开发者ID:sfsy1989,项目名称:j2me,代码行数:24,代码来源:IsolateNatives.cpp



注:本文中的KNI_GetParameterAsInt函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ KNI_IsNullHandle函数代码示例发布时间:2022-05-30
下一篇:
C++ KNI_EndHandles函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap