void QAndroidOffscreenEditText::setLineSpacing(float add, float mult)
{
	if (QJniObject * view = offscreenView())
	{
		view->callParamVoid("setLineSpacing", "FF", jfloat(add), jfloat(mult));
	}
}
void QAndroidOffscreenEditText::setTextScaleX(float size)
{
	if (QJniObject * view = offscreenView())
	{
		view->callVoid("setTextScaleX", jfloat(size));
	}
}
void QAndroidOffscreenEditText::setTextSize(float size, int unit)
{
	if (QJniObject * view = offscreenView())
	{
		view->callParamVoid("setTextSize", "FI", jfloat(size), jint(unit));
	}
}
Example #4
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;
}
Example #5
0
static void testProxy0ReturnFloat(CuTest* tc) {
    handler = testProxy0ReturnFloat_handler;
    jfloat (*f)(jfloat) = (jfloat (*)(jfloat)) _proxy0;
    jfloat result = f(3.14f);
    CuAssertTrue(tc, result == 3.14f * 3.14f);
}
Example #6
0
JNIEXPORT void JNICALL Java_org_openscenegraph_osg_viewer_OffScreenViewer_nativeSetView(JNIEnv* env, jclass, jlong cptr, jint width, jint height, jfloat fov)
{
    osgViewer::Viewer *viewer = reinterpret_cast<osgViewer::Viewer*> (cptr);
    if (viewer == NULL)
        return;

    viewer->getCamera()->setProjectionMatrix(osg::Matrixd::perspective(osg::RadiansToDegrees(fov), jfloat(width)/jfloat(height), 0.1, 1500.0));
    osg::Matrixd lookat_matrix = osg::Matrixd::lookAt(osg::Vec3d(0.0, 0.0, -1.0), osg::Vec3d(0.0, 0.0, 1.0), osg::Vec3d(0.0, 1.0, 0.0));
    viewer->getCamera()->setViewMatrix(lookat_matrix);
}