From: k.zverev Date: Fri, 8 Nov 2013 07:56:25 +0000 (+0200) Subject: ui-core: added physics application for linux. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=607a3f6fc28d49b058e2a674a7a0a8c1b7bbcb8d;p=framework%2Fosp%2Fuifw.git ui-core: added physics application for linux. Change-Id: I7f290ab57e422159548f2ea520c5d47ba0480bcb Signed-off-by: k.zverev --- diff --git a/src/ui-core/CMakeLists.txt b/src/ui-core/CMakeLists.txt index c40c375..f9aa6f7 100644 --- a/src/ui-core/CMakeLists.txt +++ b/src/ui-core/CMakeLists.txt @@ -29,4 +29,5 @@ ADD_SUBDIRECTORY(example/Plugin) ELSEIF(LINUX) ADD_SUBDIRECTORY(example/Linux) ADD_SUBDIRECTORY(example/Plugin) +ADD_SUBDIRECTORY(example/Physics) ENDIF(_WIN32) diff --git a/src/ui-core/example/Linux/CMakeLists.txt b/src/ui-core/example/Linux/CMakeLists.txt index 733e2bb..d194ff1 100644 --- a/src/ui-core/example/Linux/CMakeLists.txt +++ b/src/ui-core/example/Linux/CMakeLists.txt @@ -7,6 +7,9 @@ INCLUDE_DIRECTORIES( ../../src/base/inc/runtime ../../src/graphics/inc ${UIFW_DIRECTORY}/inc + ${UIFW_DIRECTORY}/src/ui/inc + ${UIFW_DIRECTORY}/src/ui/animations + ) SET(${this_target}_SOURCE_FILES @@ -15,6 +18,13 @@ SET(${this_target}_SOURCE_FILES SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../lib) + +IF(LINUX) +ADD_DEFINITIONS("-DVE_X_GL -DBUILD_UI_CORE") +ELSEIF(_WIN32) +ADD_DEFINITIONS("-DVE_WIN32_GL -DBUILD_UI_CORE") +ENDIF(LINUX) + ADD_EXECUTABLE(${this_target} ${${this_target}_SOURCE_FILES}) ADD_DEPENDENCIES(${this_target} ui-core) diff --git a/src/ui-core/example/Linux/TestApplication.cpp b/src/ui-core/example/Linux/TestApplication.cpp index 02ea041..80d90b4 100644 --- a/src/ui-core/example/Linux/TestApplication.cpp +++ b/src/ui-core/example/Linux/TestApplication.cpp @@ -3,25 +3,63 @@ #include #include #include -#include +#include +#include +#include +#include +//#include +#include +#include + using namespace UiCore; using namespace Tizen::Graphics; using namespace Tizen::Ui::Animations; +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Media; + +static Application application; +const char g_szClassName[] = "myWindowClass"; + +static const char strVertexShader_texture[] = + "uniform mat4 u_mvp;\n" + //"uniform mat4 u_inv_mvp;\n" + "attribute vec4 a_position;\n" + "attribute vec4 a_normal;\n" + "varying vec4 v_normal;\n" + "void main()\n" + "{\n" + " v_normal = a_normal;" + " gl_Position = u_mvp * a_position;\n" +// " gl_Position = a_position;\n" + "}\n"; + +static const char strFragmentShader_texture[] = + "precision highp float;\n" + "varying vec4 v_normal;\n" + "void main()\n" + "{\n" + " gl_FragColor = vec4(0.5, 0.5, 0.5, 1) * max( dot(vec4(0, 0, 0, 1), normalize(v_normal)) , 0.0);\n" +// " gl_FragColor = vec4(1., 0., 0., 1);\n" + "}\n"; + int main(void) { - printf("HELLO!!!!"); + printf("HELLO!!!!\n"); Application application; application.CreateLayer(); VisualElement* pRoot = application.GetRootVisualElement(); if (pRoot) - { +#if 0 +{ + VisualElement* pElement1 = new VisualElement(); pElement1->Construct(); pElement1->SetShowState(true); - pElement1->SetBounds(FloatRectangle(0, 0, 100, 100)); + pElement1->SetBounds(FloatRectangle(0, 0, 1000, 1000)); pRoot->AttachChild(pElement1); VisualElementSurface* pSurface = new VisualElementSurface(); @@ -30,7 +68,7 @@ int main(void) BufferInfo bufferInfo; pSurface->GetBufferInfo(bufferInfo); - memset(bufferInfo.pPixels, 0xFF, bufferInfo.width * bufferInfo.height * 4); + memset(bufferInfo.pPixels, 0x0F, bufferInfo.width * bufferInfo.height * 4); pElement1->SetSurface(pSurface); @@ -50,10 +88,133 @@ int main(void) application.UpdateLayer(); } +#endif +{ + FloatRectangle clientRect = application.GetLayerBounds(); + application.GetRootVisualElement()->SetShowState(true); + application.GetRootVisualElement()->SetOpacity(1.0f); + +// Tizen::Ui::Animations::Camera* __pCamera = new Tizen::Ui::Animations::Camera(); +// __pCamera->SetPerspective(60.0 ,0.01, 400); +// __pCamera->LookAt(Tizen::Graphics::FloatPoint3(0,0,50), Tizen::Graphics::FloatPoint3(0,0,0),Tizen::Graphics::FloatPoint3(0,1,0)); + + +// VisualElement* pCameraVE = new (std::nothrow) VisualElement(); +// pCameraVE->Construct(); +// pCameraVE->SetName(L"CameraVE"); +// pCameraVE->SetShowState(true); +// pCameraVE->SetImplicitAnimationEnabled(false); +// pCameraVE->SetChildrenTransformMatrix(__pCamera->GetMatrix()); +// application.GetRootVisualElement()->AttachChild(pCameraVE); + + VisualElement* pElement = new VisualElement(); + pElement->Construct(); + pElement->SetShowState(true); + pElement->SetOpacity(1.0f); + //pElement->SetBounds(FloatRectangle(1, 1, 0.f, 0.f)); + pElement->SetBounds(FloatRectangle(clientRect.width / 2, clientRect.height / 2, 100, 100)); + pElement->SetImplicitAnimationEnabled(false); +// pCameraVE->AttachChild(pElement); +// application.GetRootVisualElement()->AttachChild(pElement); + + // VisualElementSurface* pSurface = new VisualElementSurface(); + // pSurface->Construct(*application.GetDisplayContext(), FloatDimension(100, 100)); + // BufferInfo bufferInfo; + // pSurface->GetBufferInfo(bufferInfo); + + // memset(bufferInfo.pPixels, 0xFF, bufferInfo.width * bufferInfo.height * 4); + //pElement->SetSurface(pSurface); +// pElement->SetSurface(LoadTextureInSurface("scorpio_UV.png")); + +// Mesh* pMesh = ModelImporter::LoadMeshN(ModelImporter::COLLADA, "scorpion_.DAE", "", true); + Mesh* pMesh = ModelImporter::LoadMeshN(ModelImporter::COLLADA, "scorpion_.DAE", ""); +// Mesh* pMesh = ModelImporter::LoadMeshN(ModelImporter::COLLADA, "lizard_animation_1.DAE", ""); + + Mesh* pTriangleMesh = new (std::nothrow) Mesh(); + pTriangleMesh->SetGeometryType(Mesh::GEO_TYPE_TRIANGLES); + + FloatRectangle rect(0,0,500,500);// = pElement->GetBounds(); + pTriangleMesh->ReserveVertices(4); + pTriangleMesh->SetVertex(0, FloatPoint3(rect.x, rect.y, -100.)); + pTriangleMesh->SetVertex(1, FloatPoint3(rect.x, rect.y + rect.height, -100.0)); + pTriangleMesh->SetVertex(2, FloatPoint3(rect.x + rect.width, rect.y, -100.0)); + pTriangleMesh->SetVertex(3, FloatPoint3(rect.x + rect.width, rect.y + rect.height, -100.0)); + + pTriangleMesh->ReserveIndices(6); + pTriangleMesh->SetIndex(0, 0); + pTriangleMesh->SetIndex(1, 1); + pTriangleMesh->SetIndex(2, 2); + pTriangleMesh->SetIndex(3, 1); + pTriangleMesh->SetIndex(4, 3); + pTriangleMesh->SetIndex(5, 2); + + pTriangleMesh->ReserveTextureCoordinates(); + pTriangleMesh->SetTextureCoord(0,FloatPoint(0,0)); + pTriangleMesh->SetTextureCoord(1,FloatPoint(0,1)); + pTriangleMesh->SetTextureCoord(2,FloatPoint(1,0)); + pTriangleMesh->SetTextureCoord(3,FloatPoint(1,1)); + + + pTriangleMesh->ReserveColors(); + pTriangleMesh->SetColor(0, Color(255, 0, 0, 255)); + pTriangleMesh->SetColor(1, Color(0, 255, 0, 255)); + pTriangleMesh->SetColor(2, Color(0, 0, 255, 255)); + pTriangleMesh->SetColor(2, Color(0, 255, 255, 255)); + + + pTriangleMesh->ReserveNormals(); + pTriangleMesh->SetNormal(0, FloatPoint3(0., 0., 1.)); + pTriangleMesh->SetNormal(1, FloatPoint3(0., 0., 1.)); + pTriangleMesh->SetNormal(2, FloatPoint3(0., 0., 1.)); + pTriangleMesh->SetNormal(3, FloatPoint3(0., 0., 1.)); + + VisualElement* pTringleVE = new VisualElement(); + pTringleVE->Construct(); + pTringleVE->SetShowState(true); + pTringleVE->SetOpacity(1.0f); +// pTringleVE->SetBounds(FloatRectangle(100, 150, 0.f, 0.f)); + pTringleVE->SetBounds(FloatRectangle(0, 0, 1, 1)); + //pTringleVE->SetBounds(FloatRectangle(clientRect.width / 2, clientRect.height / 2, 100, 100)); + pTringleVE->SetImplicitAnimationEnabled(false); +// pCameraVE->AttachChild(pElement); + pTringleVE->AttachChild(pElement); + application.GetRootVisualElement()->AttachChild(pTringleVE); + + + ShaderProgram* __pShader = new ShaderProgram(); + Shader vert; + vert.Construct(Shader::SHADER_VERTEX,strVertexShader_texture); + Shader frag; + frag.Construct(Shader::SHADER_FRAGMENT,strFragmentShader_texture); + __pShader->Construct(vert, frag); + + pElement->SetMesh(pMesh); + //__pShader->SetUniform("u_mvps", __pCamera->GetMatrix()); + pElement->SetShaderProgram(__pShader); + + pTringleVE->SetMesh(pTriangleMesh); +// pTringleVE->SetShaderProgram(__pShader); + + + float scale = 4.f; + pElement->SetProperty(L"transform.scale.x", scale); + pElement->SetProperty(L"transform.scale.y", scale); + pElement->SetProperty(L"transform.scale.z", scale); + + float x = 230; + float y = 100; + //pElement->SetProperty(L"transform.translation.x", x); +// pElement->SetProperty(L"transform.translation.y", y); +// pElement->SetProperty(L"transform.scale.z", scale); + + printf("x=%f, y=%f\n", pElement->GetBounds().x, pElement->GetBounds().y); + } for (;;) { application.IterateMainLoop(); + application.UpdateLayer(); + nanosleep((struct timespec[]){{1, 500000000}}, null); } return 0; diff --git a/src/ui-core/example/Physics/CMakeLists.txt b/src/ui-core/example/Physics/CMakeLists.txt new file mode 100644 index 0000000..ec231c9 --- /dev/null +++ b/src/ui-core/example/Physics/CMakeLists.txt @@ -0,0 +1,31 @@ +SET(this_target physics) + +INCLUDE_DIRECTORIES( + ./ + ../../inc + ../../src/base/inc + ../../src/base/inc/collection + ../../src/base/inc/runtime + ../../src/graphics/inc + ${UIFW_DIRECTORY}/inc + ${UIFW_DIRECTORY}/src/ui/inc + ${UIFW_DIRECTORY}/src/ui/animations + +) + +SET(${this_target}_SOURCE_FILES + Physics.cpp +) + +IF(LINUX) +ADD_DEFINITIONS("-DVE_X_GL -DBUILD_UI_CORE") +ELSEIF(_WIN32) +ADD_DEFINITIONS("-DVE_WIN32_GL -DBUILD_UI_CORE") +ENDIF(LINUX) + +SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../lib) + +ADD_EXECUTABLE(${this_target} ${${this_target}_SOURCE_FILES}) +ADD_DEPENDENCIES(${this_target} ui-core) + +TARGET_LINK_LIBRARIES(${this_target} "-lui-core") diff --git a/src/ui-core/example/Physics/Physics.cpp b/src/ui-core/example/Physics/Physics.cpp new file mode 100644 index 0000000..3fae802 --- /dev/null +++ b/src/ui-core/example/Physics/Physics.cpp @@ -0,0 +1,241 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include + +#include +#include +#include +//#include + +#ifdef LINUX +#include +#else _WIN32 +#include +#endif + +using namespace UiCore; +using namespace Tizen::Graphics; +using namespace Tizen::Ui::Animations; +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Media; + +static Application application; +static RawHandler rawHandler; +static VisualElement* pVE; + +static const int STONES_COUNT = 12; +const char g_szClassName[] = "myWindowClass"; + +static const char strVertexShader_texture[] = + "uniform mat4 u_mvp;\n" + //"uniform mat4 u_inv_mvp;\n" + "attribute vec4 a_position;\n" + "attribute vec4 a_normal;\n" + "varying vec4 v_normal;\n" + "void main()\n" + "{\n" + " v_normal = a_normal;" + " gl_Position = u_mvp * a_position;\n" +// " gl_Position = a_position;\n" + "}\n"; + +static const char strFragmentShader_texture[] = + "precision highp float;\n" + "varying vec4 v_normal;\n" + "void main()\n" + "{\n" + " gl_FragColor = vec4(0.5, 0.5, 0.5, 1) * max( dot(vec4(0, 0, 0, 1), normalize(v_normal )) , 0.0);\n" +// " gl_FragColor = vec4(1., 0., 0., 1);\n" + "}\n"; + + +RawHandler::RawHandler(void) +{ + _Looper* pLooper = _Looper::GetInstance(); + if (pLooper != null) + { + pLooper->AddRawEventHandler(this); + } + else + { + printf("Application:Looper is null!!\n"); + } +} + +bool +RawHandler::ProcessRawEvent(const Tizen::Ui::Animations::_RawEvent& rawEvent) +{ + int x,y; + switch(rawEvent.type) + { + case _RawEvent::RAWEVENT_TOUCHMOVE: + x = rawEvent.data.touchPress.x; + y = rawEvent.data.touchPress.y; + printf("Touch Move (%i;%i)\n", x, y); + break; + case _RawEvent::RAWEVENT_TOUCHPRESS: + x = rawEvent.data.touchPress.x; + y = rawEvent.data.touchPress.y; + printf("Touch Press (%i;%i)\n", x, y); + + pVE->SetProperty(L"transform.translation.x", x - 100.f); + pVE->SetProperty(L"transform.translation.y", y - 75.f); + break; + case _RawEvent::RAWEVENT_TOUCHRELEASE: + x = rawEvent.data.touchPress.x; + y = rawEvent.data.touchPress.y; + printf("Touch Release (%i;%i)\n", x, y); + break; + case _RawEvent::RAWEVENT_KEYPRESS: + break; + case _RawEvent::RAWEVENT_KEYRELEASE: + break; + case _RawEvent::RAWEVENT_TIMER: + break; + case _RawEvent::RAWEVENT_DRAW: + printf("Draw\n"); + break; + case _RawEvent::RAWEVENT_FLUSH: + printf("Flush\n"); + break; + case _RawEvent::RAWEVENT_ANIMATE: + break; + case _RawEvent::RAWEVENT_TRANSACTION_FINISHED: + break; + case _RawEvent::RAWEVENT_END: + break; + } + + return true; +} + + + +int main(void) +{ + application.CreateLayer(); + + VisualElement* pRoot = application.GetRootVisualElement(); + if (pRoot) + { + FloatRectangle clientRect = application.GetLayerBounds(); + pRoot->SetShowState(true); + pRoot->SetOpacity(1.0f); + + Tizen::Ui::Animations::Camera* __pCamera = new Tizen::Ui::Animations::Camera(); +// __pCamera->SetPerspective(60.0 ,0.01, 400); +// __pCamera->LookAt(Tizen::Graphics::FloatPoint3(0,0,50), Tizen::Graphics::FloatPoint3(0,0,0),Tizen::Graphics::FloatPoint3(0,1,0)); + __pCamera->SetOrthogonal(-1280, 1280); + + VisualElement* pCameraVE = new (std::nothrow) VisualElement(); + pCameraVE->Construct(); + pCameraVE->SetName(L"CameraVE"); + pCameraVE->SetShowState(true); + pCameraVE->SetImplicitAnimationEnabled(false); + pCameraVE->SetChildrenTransformMatrix(__pCamera->GetMatrix()); + pRoot->AttachChild(pCameraVE); + + + Shader vert; + vert.Construct(Shader::SHADER_VERTEX,strVertexShader_texture); + Shader frag; + frag.Construct(Shader::SHADER_FRAGMENT,strFragmentShader_texture); + + ShaderProgram* pShader = new ShaderProgram(); + pShader->Construct(vert, frag); + + pVE = new VisualElement(); + pVE->Construct(); + pVE->SetName(L"VE"); + // pCameraVE->SetProperty(L"transform.scale.x", -1.0f); + // pCameraVE->SetProperty(L"transform.rotate.y", 180.0f); + pVE->SetBounds(FloatRectangle(clientRect.width / 2, clientRect.height / 2, 1, 1)); + pVE->SetShowState(true); + pVE->SetImplicitAnimationEnabled(true); + pCameraVE->AttachChild(pVE); + + Tizen::Base::String fileName("ColladaModels/stones_01.DAE"); + + Tizen::Ui::Animations::Scene* pScene = ModelImporter::LoadSceneN(fileName, "MaxScene", *pVE); + if (pScene != null) + { + // VisualElementSurface* t1 = LoadTextureInSurface(resPath + "Textures/" + "blue.jpg"); + // VisualElementSurface* t2 = LoadTextureInSurface(resPath + "Textures/" + "blue.jpg"); + // VisualElementSurface* t1 = LoadTextureInSurface(resPath + "Textures/" + "stone_DIFF.jpg"); + // VisualElementSurface* t2 = LoadTextureInSurface(resPath + "Textures/" + "background_DIFF_.jpg"); + + Tizen::Base::Collection::IList* children = pScene->GetRootVisualElement()->GetChildrenN(); + for (unsigned int i = 0; i < children->GetCount(); i++){ + VisualElement* ve = static_cast(children->GetAt(i)); + Mesh* mesh = ve->GetMeshN(); + Tizen::Base::String meshName = mesh->GetName(); + + if (meshName.Contains("stone")) + { + ve->SetShaderProgram(pShader); +// ve->SetSurface(t1); + } + + if (meshName.Contains("background")) + { + ve->SetShaderProgram(pShader); +// ve->SetSurface(t2); + } + delete mesh; + } + delete children; + } + + float s = 10.f; + pVE->SetProperty(L"transform.scale.x", s); + pVE->SetProperty(L"transform.scale.y", s); + pVE->SetProperty(L"transform.scale.z", s); + + float x = -100.f; + float y = -75.f; + //pElement->SetProperty(L"transform.translation.x", x); +// pElement->SetProperty(L"transform.translation.y", y); + pVE->SetProperty(L"transform.translation.x", x); + pVE->SetProperty(L"transform.translation.y", y); + + + // __pScene->GetRootVisualElement()->SetTransformMatrix(perspectiveMat); + +// pScene->GetRootVisualElement()->SetImplicitAnimationEnabled(true); + +// pVE->AttachChild(pScene->GetRootVisualElement()); + + } + + Display* pDis; + XEvent event; + KeySym key; + char text[255]; + for (;;) + { + application.IterateMainLoop(); + application.UpdateLayer(); + +#ifdef LINUX + nanosleep((struct timespec[]){{0, 10000000}}, null); +#elif _WIN32 +// ::Sleep(1000); +#endif + + } + + return 0; +} diff --git a/src/ui-core/example/Physics/RawHandler.h b/src/ui-core/example/Physics/RawHandler.h new file mode 100644 index 0000000..59f1227 --- /dev/null +++ b/src/ui-core/example/Physics/RawHandler.h @@ -0,0 +1,15 @@ +#ifndef _RAW_HANDLER_H_ +#define _RAW_HANDLER_H_ + +#include + +class RawHandler + : public Tizen::Ui::Animations::_IRawEventHandler +{ +public: + RawHandler(); + virtual bool ProcessRawEvent(const Tizen::Ui::Animations::_RawEvent& rawEvent); +}; + + +#endif //_RAW_HANDLER_H_ diff --git a/src/ui-core/example/Plugin/CMakeLists.txt b/src/ui-core/example/Plugin/CMakeLists.txt index 559920a..38ea529 100644 --- a/src/ui-core/example/Plugin/CMakeLists.txt +++ b/src/ui-core/example/Plugin/CMakeLists.txt @@ -1,7 +1,9 @@ SET(this_target visual-element) +IF(LINUX) INCLUDE_DIRECTORIES( ./ + ./ubuntu ../../inc ../../src/base/inc ../../src/graphics/inc @@ -9,14 +11,35 @@ INCLUDE_DIRECTORIES( ../../src/base/inc/runtime ../../src/graphics/inc ${UIFW_DIRECTORY}/inc + ${UIFW_DIRECTORY}/src/ui/inc + ${UIFW_DIRECTORY}/src/ui/animations ) +ELSEIF(_WIN32) +INCLUDE_DIRECTORIES( + ./ + ./win + ../../inc + ../../src/base/inc + ../../src/graphics/inc + ../../src/base/inc/collection + ../../src/base/inc/runtime + ../../src/graphics/inc + ${UIFW_DIRECTORY}/inc +) +ENDIF(LINUX) SET(${this_target}_SOURCE_FILES j_utils.cpp org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor.cpp ) +IF(LINUX) +ADD_DEFINITIONS("-DVE_X_GL -DBUILD_UI_CORE") +ELSEIF(_WIN32) +ADD_DEFINITIONS("-DVE_WIN32_GL -DBUILD_UI_CORE") +ENDIF(LINUX) + ADD_LIBRARY(${this_target} SHARED ${${this_target}_SOURCE_FILES}) -SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--kill-at") +#SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--kill-at") TARGET_LINK_LIBRARIES(${this_target} "-lui-core") diff --git a/src/ui-core/example/Plugin/org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor.cpp b/src/ui-core/example/Plugin/org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor.cpp index 686f004..c3a0b59 100644 --- a/src/ui-core/example/Plugin/org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor.cpp +++ b/src/ui-core/example/Plugin/org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor.cpp @@ -1,836 +1,438 @@ -// jniSceneEditor.cpp : Defines the entry point for the console application. -// - - -#include "stdafx.h" - -#include -#include "org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor.h" -#include -#include -#include - -#include "Scene.h" -#include "ModelBuilder.h" -#include "NodeScene.h" - -#include "RenderSystem.h" -#include "GpuProgram.h" -#include "Surface.h" -#include "Material.h" -#include "Camera.h" -#include "Vector3.h" -#include "resource-manager/ResourceManager.h" -#include "PrefabBox.h" -#include "j_utils.h" -#include "at-entities/GizmoManager.h" - -using namespace Tizen::Ui::Renderer; -using namespace Tizen::Ui::Animations::VisualScenes::_Interactive3DModel; -using namespace Tizen::Ui::Animations::VisualScenes::_Scene; -using namespace Tizen::Ui::Animations::VisualScenes::_ResourceManager; -using namespace Tizen::Ui::Animations::VisualScenes::_Math; -using namespace Tizen::Ui::Core; - - -class Tmp : public Application -{ -}; -REG_CLASS(Tmp); - -HDC gg_hDC; // the device context (DC) - -Scene* __pScene = NULL; -Tizen::Ui::Renderer::RenderSystem* __pRenderSystem; - -Uint width; -Uint height; - -Mesh* __mesh1; -NodeScene* __pMeshNode1; -Grid __pGrid; - - -//--------------------------------- -Tizen::Ui::Animations::VisualScenes::_Scene::NodeScene* __pPicking; -int lastMouseDownX = -1; -int lastMouseDownY = -1; -bool isGizmoDraging = false; -//--------------------------------- -//Material* __pMaterial; - - - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setDataPath - (JNIEnv *env, jobject obj, jstring currentPath){ - setJenv(env); - if(currentPath != NULL){ - const char *currentDir = (env)->GetStringUTFChars(currentPath, 0); - int res = _chdir(currentDir); - (env)->ReleaseStringUTFChars(currentPath, currentDir); - } -} - - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_init - (JNIEnv *, jobject, jint handle, jint width, jint height){ - CreateContext ( (HWND)handle, width, height ); - - // get the device context (DC) - gg_hDC = GetDC( (HWND)handle ); - - //OnInit - ResourceManager* resourceManager = ResourceManager::GetInstance(); - __pScene = new Scene("Scene"); - - __pRenderSystem = new Tizen::Ui::Renderer::RenderSystem(); - __pRenderSystem->Create(); - __pRenderSystem->SetBackgroundColor(1.0f, 0.2f, 0.2f, 0.2f); - __pRenderSystem->InitViewport(0, 0, width, height, 45.0f, 0.1f, 1000.0f); - __pRenderSystem->UpdateScreen(); - - __pRenderSystem->GetCamera()->Perspective(45.0f, (float)width / height, 0.1f, 1000.0f); - __pRenderSystem->GetCamera()->LookAt(Vector3(0, 0, 100), Vector3(0, 0, 0), Vector3(0, 1, 0)); - - __pScene->Update(); - - - //Tizen::Ui::Renderer:: __Config::ShaderPath = "Shaders/";//"../Data/Shaders/"; - //Tizen::Ui::Renderer::__Config::MaterialPath = "Materials/";//"../Data/Materials/"; - FileSystem::ShaderPath = "Shaders/"; - FileSystem::MaterialPath = "Materials/"; - FileSystem::TexturePath = "Textures/"; - - - std::string ModelFileName1 = "ColladaModels/ColorCube.dae";//"../../../Demos/ColladaModels/ColorCube.dae"; - std::string ModelFileName2 = "ColladaModels/scorpion_.DAE";//"../../../Demos/ColladaModels/scorpion_.DAE"; - std::string ModelFileName3 = "ColladaModels/lizard_animation_1.DAE";//"../../../Demos/ColladaModels/lizard_animation_1.DAE"; - std::string ModelFileName4 = "ColladaModels/astroBoy_walk_Maya.dae";//"../../../Demos/ColladaModels/astroBoy_walk_Maya.dae"; - - __pGrid.SetLines ( 5.0f, 10.0f, 50.0f ); - __pGrid.Create ( __pRenderSystem ); - GizmoManager::Setting(__pScene,__pRenderSystem); - - /*std::string materialFileName = Tizen::Ui::Fs::FileSystem::MaterialPath + "light.xml"; - __pMaterial = ResourceManager::GetInstance()->LoadMaterial( materialFileName, "" ); - __pMaterial->Create ();*/ - - glEnable(GL_DEPTH_TEST); -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_resize - (JNIEnv *, jobject, jint width, jint height){ - __pRenderSystem->InitViewport ( 0, 0, width, height); - __pRenderSystem->GetCamera()->Perspective(45.0f, (float)width / height, 0.1f, 1000.0f); -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_repaint - (JNIEnv *, jobject, jfloat dt){ - //////////////////////////////Update//////////////////////////////////////////////////// - float fElapsedTime = dt; -// static float angle = 0; -// angle += fElapsedTime; - -// __pRenderSystem->SetViewMatrix(__pRenderSystem->GetCamera()->GetView()); - __pRenderSystem->SetProjectionMatrix(__pRenderSystem->GetCamera()->GetProjection()); - __pScene->Update(); - - Matrix4 mat; - mat.Identity(); - __pGrid.WorldMatrix = mat; - __pGrid.Update( fElapsedTime ); - - - ///////////////////// Draw ////////////////////////////////////////////////////////////////////// - __pRenderSystem->Clear(ClearFlag::COLOR | ClearFlag::ZBUFFER | ClearFlag::STENCIL); - - __pScene->FindVisible(__pRenderSystem, __pScene->GetRootNodeScene()); - - __pRenderSystem->BeginRender(); - __pRenderSystem->RenderStages(); - __pRenderSystem->EndRender(); - - GizmoManager::Render(); - SwapBuffers(gg_hDC); -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseUp - (JNIEnv *, jobject, jint mouseX, jint mouseY, jint){ - //logMessage(__pPicking->); - /*__pPicking = __pScene->PickNodeScene(mouseX, mouseY,__pRenderSystem->GetCamera()->GetProjectionViewInv(),__pRenderSystem->GetFrame()); - if(__pPicking != null) - { - logMessage( __pPicking->GetName().c_str()); - - }else{ - logMessage("Empty picking"); - } - - if(isGizmoDraging){*/ - isGizmoDraging = false; - /*}else{ - GizmoManager::AttachGizmo(__pPicking); - }*/ - - - //-------------------------------- - lastMouseDownX = -1; - lastMouseDownY = -1; - GizmoManager::Reset(); -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseDown - (JNIEnv *, jobject, jint mouseX, jint mouseY, jint){ - lastMouseDownX = mouseX; - lastMouseDownY = mouseY; - - __pPicking = __pScene->PickNodeScene(mouseX, mouseY,__pRenderSystem->GetCamera()->GetProjectionViewInv(),__pRenderSystem->GetFrame()); - if(__pPicking != null) - { - logMessage( __pPicking->GetName().c_str()); - - }else{ - logMessage("Empty picking"); - } - - if(!isGizmoDraging){ - GizmoManager::AttachGizmo(__pPicking); - } -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_dispose - (JNIEnv *, jobject){ -// delete __pScene; -// __pScene = NULL; - SafeDelete(__pScene); - -// delete __pRenderSystem; -// __pRenderSystem = NULL; - SafeDelete(__pRenderSystem); - - ResourceManager* resourceManager = ResourceManager::GetInstance(); - resourceManager->UnloadAllMaterials(); - resourceManager->UnloadAllMeshes(); - GizmoManager::Destroy(); -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_addModel - (JNIEnv * env, jobject, jstring filePath, jstring modelName, jstring materialName, jstring nodeName, jint x, jint y){ -// setJenv(env); - if ( filePath == NULL || modelName == NULL || nodeName == NULL) { - logMessage("NULL!!!"); - return; - } - - std::string fileName = toCString(filePath); - std::string modelID = toCString(modelName); - std::string materialID = toCString(materialName); - std::string nodeID = toCString(nodeName); - - std::string materialFileName = FileSystem::MaterialPath + materialID; - ResourceManager* resourceManager = ResourceManager::GetInstance(); - MaterialDescription* __pMaterial = resourceManager->LoadMaterial( materialFileName, "" ); - __pMaterial->Create (); - - Vector3 Normal(0,1,0); - - Vector3 P1 = __pScene->ConvertScreenToWorld(Vector3(x, y, 1.0f), __pRenderSystem->GetCamera()->GetProjectionView().GetInversed(), __pRenderSystem->GetFrame()); - Vector3 P2 = __pScene->ConvertScreenToWorld(Vector3(x, y, 0.0f), __pRenderSystem->GetCamera()->GetProjectionView().GetInversed(), __pRenderSystem->GetFrame()); - Vector3 Ray = P1 - P2; - Vector3 Rayt; - float num = -(Normal.x * P1.x + Normal.y * P1.y + Normal.z * P1.z); - - float denum = (Normal.x * Ray.x + Normal.y * Ray.y + Normal.z * Ray.z); - float t = num / denum; - if (fabs(denum) < 0.1) - { - //TODO - } - else - { - Rayt = P1 + Ray*t; - } - - - - NodeScene* rootNode = __pScene->GetRootNodeScene(); -// logMessage(nodeID.c_str()); -// logMessage(fileName.c_str()); - - __mesh1 = resourceManager->LoadMesh(fileName, modelID); -// __mesh1->Create(__pRenderSystem); - __mesh1->SetMaterial(__pMaterial); - - __pMeshNode1 = rootNode->CreateChildNodeScene(nodeID); - __pMeshNode1->AddAttachable(__mesh1); - //Rayt.z = -Rayt.z; - __pMeshNode1->SetPosition(Rayt); - __pMeshNode1->SetOrientation(0, 1, 1, 1); - __pMeshNode1->SetScale(Vector3(3, 3, 3)); -} - -/*JNIEXPORT jobjectArray JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getChildrenList - (JNIEnv * env, jobject, jstring name){ - std::string nodeName = toCString(name); - jobjectArray ret; - int n = 0; - - jstring names[50]; - - if (nodeName == ""){ - NodeScene* rootNode = __pScene->GetRootNodeScene(); - Node::ChildrenIt itEnd = rootNode->GetChildrenEnd(); - for (Node::ChildrenIt it = rootNode->GetChildrenBegin(); it != itEnd; ++it) - { - NodeScene* ns = static_cast(it->second); - - const std::string& name = ns->GetName(); - names[n++] = toJString(name); - } - } - - ret= (jobjectArray)env->NewObjectArray(n, - env->FindClass("java/lang/String"), - env->NewStringUTF("")); - - for (int i=0;iSetObjectArrayElement(ret,i, names[i]); - } - return(ret); -}*/ - - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseScrolled - (JNIEnv * env, jobject, jint counts){ - setJenv(env); -// logMessage("Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseScrolled"); - __pRenderSystem->GetCamera()->Zoom(counts); - - -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_dragDetected - (JNIEnv *, jobject, jint, jint, jint, jint){ - -} - - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseMove - (JNIEnv *, jobject, jint x, jint y, jint, jint){ - - - //-------------------------------------------------------------- - //----------------Work with Gizmo------------------------------ - - if((lastMouseDownX != -1)|| (lastMouseDownY != -1)) - { - isGizmoDraging = true; - GizmoManager::ApplyGizmo(x,y,lastMouseDownX,lastMouseDownY); - - if(lastMouseDownX != x) - lastMouseDownX = x; - - if(lastMouseDownY != y) - lastMouseDownY = y; - } - else - { - GizmoManager::Reset(); - } - //-------------------------------------------------------------- - //-------------------------------------------------------------- - - - -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_moveSceneCamera - (JNIEnv * env, jobject, jint deltaX, jint deltaY, jint stateMask){ - setJenv(env); -// logMessage("Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_moveSceneCamera"); - float magicNumder = -0.1f; - __pRenderSystem->GetCamera()->Pan(magicNumder * deltaX, magicNumder * deltaY); - - -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_rotateSceneCamera - (JNIEnv * env, jobject, jint x, jint y, jint stateMask){ - setJenv(env); -// logMessage("Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_rotateSceneCamera"); - float magicNumder = -0.5f; - /*Vector3 tempVector = __pRenderSystem->GetCamera()->GetPosition(); - tempVector += Vector3((float)x, 0.0f, 0.0f); - - __pRenderSystem->GetCamera()->LookAt(tempVector, Vector3(0, 0, 0), Vector3(0, 1, 0));*/ - __pRenderSystem->GetCamera()->Rotate(DegToRad(magicNumder * x),DegToRad(magicNumder * y)); - -} - -JNIEXPORT jintArray JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getChildrenListRef - (JNIEnv * env, jobject, jint handle){ - //std::string nodeName = toCString(name); - jintArray ret; - int n = 0; - jint handles[50]; - - if (handle == 0){ - NodeScene* rootNode = __pScene->GetRootNodeScene(); - Node::ChildrenIt itEnd = rootNode->GetChildrenEnd(); - for (Node::ChildrenIt it = rootNode->GetChildrenBegin(); it != itEnd; ++it) - { - NodeScene* ns = static_cast(it->second); - int test = (int)ns; - - handles[n++] = test; - } - } else { - NodeScene* ns = (NodeScene*)handle; - Node::ChildrenIt itEnd = ns->GetChildrenEnd(); - for (Node::ChildrenIt it = ns->GetChildrenBegin(); it != itEnd; ++it) - { - NodeScene* ns = static_cast(it->second); - int test = (int)ns; - - handles[n++] = test; - } - } - - ret = env->NewIntArray(n); - env->SetIntArrayRegion(ret, 0, n, handles); - - return(ret); -} - - -JNIEXPORT jstring JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getName - (JNIEnv * env, jobject, jint handle){ - NodeScene* ns = (NodeScene*)handle; - const std::string& name = ns->GetName(); - return toJString(name); -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_addNode - (JNIEnv *, jobject, jstring nodeName, jint handle){ - std::string name = toCString(nodeName); - - ResourceManager* resourceManager = ResourceManager::GetInstance(); - NodeScene* rootNode = __pScene->GetRootNodeScene(); - - if (handle == 0) { - __pMeshNode1 = rootNode->CreateChildNodeScene(name); - } else { - NodeScene* ns = (NodeScene*)handle; - ns->CreateChildNodeScene(name); - } -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_deleteNode - (JNIEnv *, jobject, jint handle){ - NodeScene* ns = (NodeScene*)handle; - // ns->DestroyAllChildren(); - //Node* ps = ns->GetParent(); - //ps->RemoveChild(ns->GetName()); - - __pScene->DestroyNodeScene(ns->GetName()); -// SafeDelete(ns); -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_moveNode - (JNIEnv *, jobject, jint elhandle, jint desthandle){ - NodeScene* node = (NodeScene*)elhandle; - - Node* parent = node->GetParent(); - parent->RemoveChild(node->GetName()); - - NodeScene* dest; - if (desthandle == 0){ - dest = __pScene->GetRootNodeScene(); - } else { - dest = (NodeScene*)desthandle; - } - dest->AddChild(node); -} - -/* - Show selection on parts in aray -*/ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setSelection - (JNIEnv * env, jobject, jintArray handles){ - //GizmoManager::Deattach(); - - jint *inCArray = env->GetIntArrayElements( handles, NULL); - //if (NULL == inCArray) return NULL; - jsize length = env->GetArrayLength(handles); - - NodeScene* node = (NodeScene*)inCArray[0]; - - GizmoManager::AttachGizmo(node); - - env->ReleaseIntArrayElements(handles, inCArray, 0); -} - -/* -Get node's describing matrix -*/ -JNIEXPORT jfloatArray JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getNodeTransform - (JNIEnv * env, jobject, jint handle){ - NodeScene* node = (NodeScene*)handle; - - jfloatArray ret; - int n = 9; - jfloat retint[9]; - - Vector3 __Tmp; - Matrix4 __TmpM; - bool __Local=true; - float __XangleRAD; - float __YangleRAD; - float __ZangleRAD; - float __XangleDEG; - float __YangleDEG; - float __ZangleDEG; - - if(__Local) - { - __Tmp = node->GetPosition(); - retint[0] = __Tmp.x; - retint[1] = __Tmp.y; - retint[2] = __Tmp.z; - - __TmpM = node->GetOrientation(); - __TmpM.GetRotationAngles(__XangleRAD,__YangleRAD,__ZangleRAD); - - __XangleDEG = FRadians2Degrees(__XangleRAD); - __YangleDEG = FRadians2Degrees(__YangleRAD); - __ZangleDEG = FRadians2Degrees(__ZangleRAD); - - retint[3] = __XangleDEG; - retint[4] = __YangleDEG; - retint[5] = __ZangleDEG; - - __Tmp = node->GetScale(); - retint[6] = __Tmp.x; - retint[7] = __Tmp.y; - retint[8] = __Tmp.z; - } - else - { - __Tmp = node->GetDerivedPosition(); - retint[0] = __Tmp.x; - retint[1] = __Tmp.y; - retint[2] = __Tmp.z; - - __TmpM = node->GetDerivedOrientation(); - __TmpM.GetRotationAngles(__XangleRAD,__YangleRAD,__ZangleRAD); - - __XangleDEG = FRadians2Degrees(__XangleRAD); - __YangleDEG = FRadians2Degrees(__YangleRAD); - __ZangleDEG = FRadians2Degrees(__ZangleRAD); - - retint[3] = __XangleDEG; - retint[4] = __YangleDEG; - retint[5] = __ZangleDEG; - - __Tmp = node->GetDerivedScale(); - retint[6] = __Tmp.x; - retint[7] = __Tmp.y; - retint[8] = __Tmp.z; - } - - ret = env->NewFloatArray(n); - env->SetFloatArrayRegion(ret, 0, n, retint); - return(ret); -} - -/* -Get node's mesh name -*/ -JNIEXPORT jstring JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getMeshName - (JNIEnv *, jobject, jint handle){ - NodeScene* node = (NodeScene*)handle; - - string name = node->GetName(); - - return toJString(name); -} - -/* -Get node's mesh string -*/ -JNIEXPORT jstring JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getMeshMaterial - (JNIEnv *, jobject, jint handle){ - NodeScene* node = (NodeScene*)handle; - - - return toJString("TEST"); -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setName - (JNIEnv *, jobject, jint handle, jstring name) { - NodeScene* node = (NodeScene*)handle; - std::string cname = toCString(name); - - node->SetName(cname); -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setNodePosition - (JNIEnv * env, jobject, jint handle, jfloatArray vec){ - NodeScene* node = (NodeScene*)handle; - jfloat* flt1 = env->GetFloatArrayElements( vec,0); - - Vector3 * pos = new Vector3(flt1[0], flt1[1], flt1[2]); - node->SetPosition(*pos); - - env->ReleaseFloatArrayElements(vec, flt1, 0); -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setNodeRotation - (JNIEnv * env, jobject, jint handle, jfloatArray vec){ - NodeScene* node = (NodeScene*)handle; - jfloat* flt1 = env->GetFloatArrayElements( vec,0); - Matrix4 __TmpM; - float __XangleRAD; - float __YangleRAD; - float __ZangleRAD; - - //Vector3 * rotation = new Vector3(flt1[0], flt1[1], flt1[2]); - //????????????????????????????????????????????????????????????????? - __TmpM = node->GetOrientation(); - __TmpM.GetRotationAngles(__XangleRAD,__YangleRAD,__ZangleRAD); - - //node->Rotate(-__XangleRAD,1,0,0); - //node->Rotate(-__YangleRAD,0,1,0); - //node->Rotate(-__ZangleRAD,0,0,1); - - node->Rotate(-__ZangleRAD,0,0,1); - node->Rotate(-__YangleRAD,0,1,0); - node->Rotate(-__XangleRAD,1,0,0); - - __XangleRAD = FDegrees2Radians(flt1[0]); - __YangleRAD = FDegrees2Radians(flt1[1]); - __ZangleRAD = FDegrees2Radians(flt1[2]); - - node->Rotate(__XangleRAD,1,0,0); - node->Rotate(__YangleRAD,0,1,0); - node->Rotate(__ZangleRAD,0,0,1); - - env->ReleaseFloatArrayElements(vec, flt1, 0); -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setNodeScale - (JNIEnv * env, jobject, jint handle, jfloatArray vec){ - NodeScene* node = (NodeScene*)handle; - jfloat* flt1 = env->GetFloatArrayElements( vec,0); - - Vector3 * scale = new Vector3(flt1[0], flt1[1], flt1[2]); - node->SetScale(*scale); - - env->ReleaseFloatArrayElements(vec, flt1, 0); -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setMeshName - (JNIEnv *, jobject, jint handle, jstring name){ - NodeScene* node = (NodeScene*)handle; - std::string cname = toCString(name); - -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setMeshMaterial - (JNIEnv *, jobject, jint handle, jstring material){ - NodeScene* node = (NodeScene*)handle; - std::string cmaterial = toCString(material); - -} - - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setGizmoMode - (JNIEnv *, jobject, jint mode, jboolean isOrientationLocal){ - - GizmoOrientation newGizmoOrientation = GIZMO_ORIENTATION_GLOBAL; - if(isOrientationLocal){ - newGizmoOrientation = GIZMO_ORIENTATION_LOCAL; - } - - GizmoManager::SetMode((GizmoType)mode, newGizmoOrientation); -} - -JNIEXPORT jobjectArray JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getAttachablesList - (JNIEnv* env, jobject _jobj, jint handle){ - NodeScene* node_scene = (NodeScene*)handle; - node_scene->GetPropertyList(); - int size=std::distance(node_scene->GetAttachablesBegin(), node_scene->GetAttachablesEnd()); - - jclass classString = (*env).FindClass("java/lang/String"); - - jobjectArray outJNIArray = (*env).NewObjectArray(size, classString, NULL); - - if (NULL == outJNIArray) - { - return NULL; - } - - size=0; - for(std::map::iterator itr=node_scene->GetAttachablesBegin(); itr!=node_scene->GetAttachablesEnd();itr++) - { - (*env).SetObjectArrayElement(outJNIArray, size, (*env).NewStringUTF(itr->first.c_str())); - size++; - } - - return outJNIArray; - -} - -JNIEXPORT jobject JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getAttachableProperties - (JNIEnv * env, jobject jobj, jint handle, jstring _jstr){ - logMessage("0"); - jclass clsH = env->FindClass("org/tizen/tools/areditor/sceneeditor/transfer/Mesh"); - if (clsH == NULL) - { - logMessage("clsHNULL"); - } - logMessage("1"); - jclass clsH_surf = env->FindClass("org/tizen/tools/areditor/sceneeditor/transfer/Surface"); - if (clsH_surf == NULL) - { - logMessage("clsH_surfNULL"); - } - logMessage("2"); - jclass clsH_mater = env->FindClass("org/tizen/tools/areditor/sceneeditor/transfer/Material"); - if (clsH_mater == NULL) - { - logMessage("clsH_materNULL"); - } - logMessage("3"); - jclass clsH_color = env->FindClass("org/tizen/tools/areditor/sceneeditor/transfer/Color"); - if (clsH_color == NULL) - { - logMessage("clsH_colorNULL"); - } - logMessage("4"); - NodeScene* node_scene = (NodeScene*)handle; - logMessage(""); - jmethodID MeshInit = (*env).GetMethodID(clsH, "", "(Ljava/lang/String;)V"); - if(MeshInit==NULL) - { - logMessage("MeshInitNULL"); - } - logMessage("5"); - jmethodID MeshAddSurf = (*env).GetMethodID(clsH, "addSurface", "(Lorg/tizen/tools/areditor/sceneeditor/transfer/Surface;)V"); - if(MeshAddSurf==NULL) - { - logMessage("MeshAddSurfNULL"); - } - logMessage("6"); - jmethodID SurfInit = (*env).GetMethodID(clsH_surf, "", "(Ljava/lang/String;)V"); - if(SurfInit==NULL) - { - logMessage("SurfInitNULL"); - } - logMessage("7"); - jmethodID SurfSetMat = (*env).GetMethodID(clsH_surf, "setMaterial", "(Lorg/tizen/tools/areditor/sceneeditor/transfer/Material;)V"); - if(SurfSetMat==NULL) - { - logMessage("SurfSetMatSurNULL"); - } - logMessage("8"); - jmethodID MatInit = (*env).GetMethodID(clsH_mater, "", "(Ljava/lang/String;ZZZZIF)V"); - if(MatInit==NULL) - { - logMessage("MatInitNULL"); - } - logMessage("9"); - jmethodID MatSetColor = (*env).GetMethodID(clsH_mater, "setColor", "(Lorg/tizen/tools/areditor/sceneeditor/transfer/Color;)V"); - if(MatSetColor==NULL) - { - logMessage("MatSetColorNULL"); - } - logMessage("1"); - jmethodID ColorInit = (*env).GetMethodID(clsH_color, "", "(FF)V"); - if(ColorInit==NULL) - { - logMessage("ColorInitNULL"); - } - logMessage("2"); - jmethodID ColorAmbient = (*env).GetMethodID(clsH_color, "setAmbient", "(IIII)V"); - if(ColorAmbient==NULL) - { - logMessage("ColorAmbientNULL"); - } - logMessage("3"); - jmethodID ColorDiffusive = (*env).GetMethodID(clsH_color, "setDiffuse", "(IIII)V"); - if(ColorDiffusive==NULL) - { - logMessage("ColorDiffusiveNULL"); - } - logMessage("4"); - jmethodID ColorSpecular = (*env).GetMethodID(clsH_color, "setSpecular", "(IIII)V"); - if(ColorSpecular==NULL) - { - logMessage("ColorSpecularNULL"); - } - logMessage("5"); - jmethodID ColorEmissive = (*env).GetMethodID(clsH_color, "setEmissive", "(IIII)V"); - if(ColorEmissive==NULL) - { - logMessage("ColorEmissiveNULL"); - } - logMessage("6"); - jobject MaterObj=NULL; - jobject SurObj=NULL; - jobject MeshObj=NULL; - jobject ColorObj=NULL; - Attachable* _atchb = NULL; - logMessage("7"); - for(std::map::iterator itr=node_scene->GetAttachablesBegin(); itr!=node_scene->GetAttachablesEnd(); itr++) - { - if(std::string(itr->first.c_str()) == std::string(toCString(_jstr))) - { - _atchb = itr->second; - Mesh* _msh = (Mesh*)(_atchb); - std::vector _srf =_msh->GetSurfaces(); - MeshObj = (*env).NewObject(clsH, MeshInit, _jstr); - for(int i = 0; i<_srf.size(); i++) - { - MaterialDescription* _mtrdesc = _srf[i]->GetMaterialPtr(); - - ColorObj = (*env).NewObject(clsH_color, ColorInit, _mtrdesc->GetEmissiveFactor(), _mtrdesc->GetSpecularPower()); - if(ColorObj==NULL) - { - logMessage("Color NULL"); - } - - MaterObj = (*env).NewObject(clsH_mater, MatInit, env->NewStringUTF(_mtrdesc->GetName().c_str()), _mtrdesc->GetTransparent(), _mtrdesc->GetZBuffer(), _mtrdesc->GetZWrite(), _mtrdesc->GetAlphaTest(), _mtrdesc->GetAlphaTestRef(), _mtrdesc->GetOpacity()); - if(MaterObj==NULL) - { - logMessage("Mater NULL"); - } - - SurObj = (*env).NewObject(clsH_surf, SurfInit, env->NewStringUTF(_srf[0]->GetName().c_str())); - if(SurObj==NULL) - { - logMessage("SurNULL"); - } - env->CallVoidMethod(ColorObj, ColorAmbient, _mtrdesc->GetAmbient().a, _mtrdesc->GetAmbient().b, _mtrdesc->GetAmbient().g, _mtrdesc->GetAmbient().r); - env->CallVoidMethod(ColorObj, ColorDiffusive, _mtrdesc->GetDiffuse().a, _mtrdesc->GetDiffuse().b, _mtrdesc->GetDiffuse().g, _mtrdesc->GetDiffuse().r); - env->CallVoidMethod(ColorObj, ColorSpecular, _mtrdesc->GetSpecular().a, _mtrdesc->GetSpecular().b, _mtrdesc->GetSpecular().g, _mtrdesc->GetSpecular().r); - env->CallVoidMethod(ColorObj, ColorEmissive, _mtrdesc->GetEmissive().a, _mtrdesc->GetEmissive().b, _mtrdesc->GetEmissive().g, _mtrdesc->GetEmissive().r); - env->CallVoidMethod(MaterObj, MatSetColor, ColorObj); - env->CallVoidMethod(SurObj, SurfSetMat, MaterObj); - env->CallVoidMethod(MeshObj, MeshAddSurf, SurObj); - } - } - } - logMessage("end"); - return MeshObj; -} - -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setAttachableIntProperty - (JNIEnv *, jobject, jint, jstring, jstring, jstring, jint) -{ -} - -T void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setAttachableStringProperty - (JNIEnv *, jobject, jint, jstring, jstring, jstring, jstring) -{ -} +#include "org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +//#include +#include +#include + +#ifdef LINUX +#define _chdir chdir +#endif + +using namespace UiCore; +using namespace Tizen::Base::Collection; +using namespace Tizen::Graphics; +using namespace Tizen::Ui::Animations; + +Application* pApplication; +VisualElement* pElement; + +/*static const char strVertexShader_texture[] = + "uniform mat4 u_mvp;\n" + "attribute vec4 a_position;\n" + "void main()\n" + "{\n" + " gl_Position = u_mvp * a_position;\n" + "}\n"; + +static const char strFragmentShader_texture[] = + "precision highp float;\n" + "void main()\n" + "{\n" + " gl_FragColor = vec4(1.0,0.0,0.0,1.0);\n" + "}\n";*/ + +static const char strVertexShader_texture[] = + "uniform mat4 u_mvp;\n" + //"uniform mat4 u_inv_mvp;\n" + "attribute vec4 a_position;\n" + "attribute vec4 a_normal;\n" + "varying vec4 v_normal;\n" + "void main()\n" + "{\n" + " v_normal = a_normal;" + " gl_Position = u_mvp * a_position;\n" +// " gl_Position = a_position;\n" + "}\n"; + +static const char strFragmentShader_texture[] = + "precision highp float;\n" + "varying vec4 v_normal;\n" + "void main()\n" + "{\n" + " gl_FragColor = vec4(0.5, 0.5, 0.5, 1) * max( dot(vec4(0, 0, 0, 1), normalize(v_normal)) , 0.0);\n" + "}\n"; + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setDataPath + (JNIEnv *env, jobject obj, jstring currentPath){ + setJenv(env); + logMessage("SetDataPath"); + if(currentPath != NULL){ + const char *currentDir = (env)->GetStringUTFChars(currentPath, 0); + logMessage(currentDir); + int res = _chdir(currentDir); + (env)->ReleaseStringUTFChars(currentPath, currentDir); + } + logMessage("Set OK"); +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_init(JNIEnv * en, jobject, jint handle, jint width, jint height) +{ + setJenv(en); + logMessage("Entry"); + pApplication = new Application(); + pApplication->CreateLayer(handle); + logMessage("Init OK"); + + FloatRectangle clientRect = pApplication->GetLayerBounds(); + +/* Tizen::Ui::Animations::Camera* __pCamera = new Tizen::Ui::Animations::Camera(); + __pCamera->SetPerspective(60.0 ,0.01, 400); + __pCamera->LookAt(Tizen::Graphics::FloatPoint3(0,0,50), Tizen::Graphics::FloatPoint3(0,0,0),Tizen::Graphics::FloatPoint3(0,1,0)); + + + pCameraVE = new (std::nothrow) VisualElement(); + pCameraVE->Construct(); + pCameraVE->SetName(L"CameraVE"); + pCameraVE->SetShowState(true); + pCameraVE->SetImplicitAnimationEnabled(false); + pCameraVE->SetChildrenTransformMatrix(__pCamera->GetMatrix()); + application.GetRootVisualElement()->AttachChild(pCameraVE); +*/ + logMessage("Init Finished"); +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_resize(JNIEnv *, jobject, jint width, jint height) +{ + pApplication->SetLayerSize(FloatDimension(width, height)); +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_repaint(JNIEnv *, jobject, jfloat dt) +{ + pApplication->UpdateLayer(); +// logMessage("Update OK"); +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_addModel + (JNIEnv * env, jobject, jstring filePath, jstring modelName, jstring materialName, jstring nodeName, jint x, jint y){ + logMessage("Add start"); + pElement = new VisualElement(); + pElement->Construct(); + pElement->SetShowState(true); + pElement->SetImplicitAnimationEnabled(false); + pApplication->GetRootVisualElement()->AttachChild(pElement); + logMessage("pElement Attached"); + std::string fileName = toCString(filePath); + const Tizen::Base::String* fff = new Tizen::Base::String(fileName.c_str()); //Konvertim v gavno +// Mesh* pMesh = ModelImporter::LoadMeshN(ModelImporter::COLLADA, "ColladaModels/scorpion_.DAE", ""); + Mesh* pMesh = ModelImporter::LoadMeshN(ModelImporter::COLLADA, *fff, ""); + if (pMesh == null) { + logMessage("Mesh NOT loaded"); + return; + } else { + logMessage("Mesh loaded"); + } + pElement->SetBounds(FloatRectangle((float)x, (float)y, 0.f, 0.f)); + + ShaderProgram* __pShader = new ShaderProgram(); + Shader vert; + vert.Construct(Shader::SHADER_VERTEX,strVertexShader_texture); + Shader frag; + frag.Construct(Shader::SHADER_FRAGMENT,strFragmentShader_texture); + __pShader->Construct(vert, frag); + logMessage("Shader constructed"); + pElement->SetMesh(pMesh); + logMessage("Mesh set"); + pElement->SetShaderProgram(__pShader); + logMessage("Add OK"); + pElement->SetName(Tizen::Base::String(toCString(nodeName).c_str())); +// float scale = 5.f; +// pElement->SetProperty(L"transform.scale.x", scale); +// pElement->SetProperty(L"transform.scale.y", scale); +// pElement->SetProperty(L"transform.scale.z", scale); + +// float x = 100; +// float y = 100; +// pElement->SetProperty(L"transform.translation.x", x); +// pElement->SetProperty(L"transform.translation.y", y); +// pElement->SetProperty(L"transform.scale.z", scale); + +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_dispose + (JNIEnv *, jobject) +{ + delete pApplication; + pApplication = null; +} + +JNIEXPORT jintArray JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getChildrenListRef + (JNIEnv * env, jobject, jint handle) + { + jintArray ret; + int n = 0; + jint handles[50]; + + VisualElement* pRootVE = null; + if (handle == 0) + { + pRootVE = pApplication->GetRootVisualElement(); + } + else + { + pRootVE = (VisualElement*)handle; + } + + IList* pChildren = pRootVE->GetChildrenN(); + + for (int i = 0; i < pChildren->GetCount(); i++) + { + VisualElement* pVE = static_cast(pChildren->GetAt(i)); + int test = (int)pVE; + handles[n++] = test; + } + + delete pChildren; + + ret = env->NewIntArray(n); + env->SetIntArrayRegion(ret, 0, n, handles); + + return(ret); +} + + +JNIEXPORT jstring JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getName + (JNIEnv * env, jobject, jint handle) +{ + VisualElement* pVE = (VisualElement*)handle; + std::wstring wName(pVE->GetName().GetPointer()); + const std::string name(wName.begin(), wName.end()); + return toJString(name); +} + +JNIEXPORT jfloatArray JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getNodeTransform + (JNIEnv * env, jobject, jint handle) +{ + VisualElement* pVE = (VisualElement*)handle; + jfloatArray ret; + + int n = 9; + jfloat retint[9]; + + //translation + retint[0] = pVE->GetProperty(L"transform.translation.x").ToFloat(); + retint[1] = pVE->GetProperty(L"transform.translation.y").ToFloat(); + retint[2] = pVE->GetProperty(L"transform.translation.z").ToFloat(); + + //rotation + retint[3] = pVE->GetProperty(L"transform.rotation.x").ToFloat(); + retint[4] = pVE->GetProperty(L"transform.rotation.y").ToFloat(); + retint[5] = pVE->GetProperty(L"transform.rotation.z").ToFloat(); + + //scale + retint[6] = pVE->GetProperty(L"transform.scale.x").ToFloat(); + retint[7] = pVE->GetProperty(L"transform.scale.y").ToFloat(); + retint[8] = pVE->GetProperty(L"transform.scale.z").ToFloat(); + + ret = env->NewFloatArray(n); + env->SetFloatArrayRegion(ret, 0, n, retint); + return(ret); +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setNodePosition + (JNIEnv * env, jobject, jint handle, jfloatArray vec) +{ + VisualElement* pVE = (VisualElement*)handle; + jfloat* flt1 = env->GetFloatArrayElements( vec,0); + + pVE->SetProperty(L"transform.translation.x", flt1[0]); + pVE->SetProperty(L"transform.translation.y", flt1[1]); + pVE->SetProperty(L"transform.translation.z", flt1[2]); + + env->ReleaseFloatArrayElements(vec, flt1, 0); +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setNodeRotation + (JNIEnv * env, jobject, jint handle, jfloatArray vec) +{ + VisualElement* pVE = (VisualElement*)handle; + jfloat* flt1 = env->GetFloatArrayElements( vec,0); + + pVE->SetProperty(L"transform.rotation.x", flt1[0]); + pVE->SetProperty(L"transform.rotation.y", flt1[1]); + pVE->SetProperty(L"transform.rotation.z", flt1[2]); + + env->ReleaseFloatArrayElements(vec, flt1, 0); +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setNodeScale + (JNIEnv * env, jobject, jint handle, jfloatArray vec) +{ + VisualElement* pVE = (VisualElement*)handle; + jfloat* flt1 = env->GetFloatArrayElements( vec,0); + + pVE->SetProperty(L"transform.scale.x", flt1[0]); + pVE->SetProperty(L"transform.scale.y", flt1[1]); + pVE->SetProperty(L"transform.scale.z", flt1[2]); + + env->ReleaseFloatArrayElements(vec, flt1, 0); +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_moveSceneCamera + (JNIEnv * env, jobject, jint deltaX, jint deltaY, jint stateMask){ + +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_rotateSceneCamera + (JNIEnv * env, jobject, jint x, jint y, jint stateMask){ + +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_addNode + (JNIEnv *, jobject, jstring nodeName, jint handle){ + +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_deleteNode + (JNIEnv *, jobject, jint handle){ + +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_moveNode + (JNIEnv *, jobject, jint elhandle, jint desthandle){ + +} + +JNIEXPORT jint JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getNodeMesh + (JNIEnv *, jobject, jint handle){ + +} + +JNIEXPORT jint JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getNodeMaterial + (JNIEnv *, jobject, jint handle){ + +} + +JNIEXPORT jint JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getNodeLight + (JNIEnv *, jobject, jint handle){ + +} + +JNIEXPORT jint JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getNodeShaderProgram + (JNIEnv *, jobject, jint handle){ + +} + +JNIEXPORT jobject JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getMesh + (JNIEnv *, jobject, jint handle){ + +} + +JNIEXPORT jobject JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getMaterial + (JNIEnv *, jobject, jint handle){ + +} + +JNIEXPORT jobject JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getLight + (JNIEnv *, jobject, jint handle){ + +} + +JNIEXPORT jobject JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getShaderProgram + (JNIEnv *, jobject, jint handle){ + +} +//-------------------------------------- + + + + + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseUp + (JNIEnv *, jobject, jint mouseX, jint mouseY, jint){ + +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseDown + (JNIEnv *, jobject, jint mouseX, jint mouseY, jint){ + +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseScrolled + (JNIEnv * env, jobject, jint counts){ + +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_dragDetected + (JNIEnv *, jobject, jint, jint, jint, jint){ + +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseMove + (JNIEnv *, jobject, jint x, jint y, jint, jint){ + float xf = x; + float yf = y; + pElement->SetProperty(L"transform.translation.x", xf); + pElement->SetProperty(L"transform.translation.y", yf); +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setSelection + (JNIEnv * env, jobject, jintArray handles){ + +} + + +JNIEXPORT jstring JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getMeshName + (JNIEnv *, jobject, jint handle){ + +} + +JNIEXPORT jstring JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getMeshMaterial + (JNIEnv *, jobject, jint handle){ + +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setName + (JNIEnv *, jobject, jint handle, jstring name) { + +} + + + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setMeshName + (JNIEnv *, jobject, jint handle, jstring name){ + + +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setMeshMaterial + (JNIEnv *, jobject, jint handle, jstring material){ + +} + + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setGizmoMode + (JNIEnv *, jobject, jint mode, jboolean isOrientationLocal){ + +} + +JNIEXPORT jobjectArray JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getAttachablesList + (JNIEnv* env, jobject _jobj, jint handle){ + +} + +JNIEXPORT jobject JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getAttachableProperties + (JNIEnv * env, jobject jobj, jint handle, jstring _jstr){ + +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setAttachableIntProperty + (JNIEnv *, jobject, jint, jstring, jstring, jstring, jint) +{ +} + +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setAttachableStringProperty + (JNIEnv *, jobject, jint, jstring, jstring, jstring, jstring) +{ +} diff --git a/src/ui-core/example/Plugin/org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor.h b/src/ui-core/example/Plugin/org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor.h index 1a6edcf..103387c 100644 --- a/src/ui-core/example/Plugin/org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor.h +++ b/src/ui-core/example/Plugin/org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor.h @@ -41,19 +41,11 @@ JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_Native /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: mouseUp - * Signature: (III)V - */ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseUp - (JNIEnv *, jobject, jint, jint, jint); - -/* - * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: mouseDown - * Signature: (III)V + * Method: addModel + * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;II)V */ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseDown - (JNIEnv *, jobject, jint, jint, jint); +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_addModel + (JNIEnv *, jobject, jstring, jstring, jstring, jstring, jint, jint); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor @@ -65,67 +57,67 @@ JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_Native /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: addModel - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;II)V + * Method: getChildrenListRef + * Signature: (I)[I */ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_addModel - (JNIEnv *, jobject, jstring, jstring, jstring, jstring, jint, jint); +JNIEXPORT jintArray JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getChildrenListRef + (JNIEnv *, jobject, jint); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: dragDetected - * Signature: (IIII)V + * Method: getName + * Signature: (I)Ljava/lang/String; */ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_dragDetected - (JNIEnv *, jobject, jint, jint, jint, jint); +JNIEXPORT jstring JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getName + (JNIEnv *, jobject, jint); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: mouseScrolled - * Signature: (I)V + * Method: getNodeTransform + * Signature: (I)[F */ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseScrolled +JNIEXPORT jfloatArray JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getNodeTransform (JNIEnv *, jobject, jint); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: mouseMove - * Signature: (IIII)V + * Method: setNodePosition + * Signature: (I[F)V */ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseMove - (JNIEnv *, jobject, jint, jint, jint, jint); +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setNodePosition + (JNIEnv *, jobject, jint, jfloatArray); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: moveSceneCamera - * Signature: (III)V + * Method: setNodeRotation + * Signature: (I[F)V */ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_moveSceneCamera - (JNIEnv *, jobject, jint, jint, jint); +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setNodeRotation + (JNIEnv *, jobject, jint, jfloatArray); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: rotateSceneCamera - * Signature: (III)V + * Method: setNodeScale + * Signature: (I[F)V */ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_rotateSceneCamera - (JNIEnv *, jobject, jint, jint, jint); +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setNodeScale + (JNIEnv *, jobject, jint, jfloatArray); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: getChildrenListRef - * Signature: (I)[I + * Method: moveSceneCamera + * Signature: (III)V */ -JNIEXPORT jintArray JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getChildrenListRef - (JNIEnv *, jobject, jint); +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_moveSceneCamera + (JNIEnv *, jobject, jint, jint, jint); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: getName - * Signature: (I)Ljava/lang/String; + * Method: rotateSceneCamera + * Signature: (III)V */ -JNIEXPORT jstring JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getName - (JNIEnv *, jobject, jint); +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_rotateSceneCamera + (JNIEnv *, jobject, jint, jint, jint); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor @@ -153,67 +145,139 @@ JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_Native /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: setSelection - * Signature: ([I)V + * Method: getNodeMesh + * Signature: (I)I */ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setSelection - (JNIEnv *, jobject, jintArray); +JNIEXPORT jint JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getNodeMesh + (JNIEnv *, jobject, jint); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: getNodeTransform - * Signature: (I)[F + * Method: getNodeMaterial + * Signature: (I)I */ -JNIEXPORT jfloatArray JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getNodeTransform +JNIEXPORT jint JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getNodeMaterial (JNIEnv *, jobject, jint); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: getMeshName - * Signature: (I)Ljava/lang/String; + * Method: getNodeLight + * Signature: (I)I */ -JNIEXPORT jstring JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getMeshName +JNIEXPORT jint JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getNodeLight (JNIEnv *, jobject, jint); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: getMeshMaterial - * Signature: (I)Ljava/lang/String; + * Method: getNodeShaderProgram + * Signature: (I)I */ -JNIEXPORT jstring JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getMeshMaterial +JNIEXPORT jint JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getNodeShaderProgram (JNIEnv *, jobject, jint); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: setName - * Signature: (ILjava/lang/String;)V + * Method: getMesh + * Signature: (I)Ljava/lang/Object; */ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setName - (JNIEnv *, jobject, jint, jstring); +JNIEXPORT jobject JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getMesh + (JNIEnv *, jobject, jint); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: setNodePosition - * Signature: (I[F)V + * Method: getMaterial + * Signature: (I)Ljava/lang/Object; */ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setNodePosition - (JNIEnv *, jobject, jint, jfloatArray); +JNIEXPORT jobject JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getMaterial + (JNIEnv *, jobject, jint); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: setNodeRotation - * Signature: (I[F)V + * Method: getLight + * Signature: (I)Ljava/lang/Object; */ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setNodeRotation - (JNIEnv *, jobject, jint, jfloatArray); +JNIEXPORT jobject JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getLight + (JNIEnv *, jobject, jint); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor - * Method: setNodeScale - * Signature: (I[F)V + * Method: getShaderProgram + * Signature: (I)Ljava/lang/Object; */ -JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setNodeScale - (JNIEnv *, jobject, jint, jfloatArray); +JNIEXPORT jobject JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getShaderProgram + (JNIEnv *, jobject, jint); + +/* + * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor + * Method: mouseUp + * Signature: (III)V + */ +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseUp + (JNIEnv *, jobject, jint, jint, jint); + +/* + * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor + * Method: mouseDown + * Signature: (III)V + */ +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseDown + (JNIEnv *, jobject, jint, jint, jint); + +/* + * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor + * Method: dragDetected + * Signature: (IIII)V + */ +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_dragDetected + (JNIEnv *, jobject, jint, jint, jint, jint); + +/* + * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor + * Method: mouseScrolled + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseScrolled + (JNIEnv *, jobject, jint); + +/* + * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor + * Method: mouseMove + * Signature: (IIII)V + */ +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_mouseMove + (JNIEnv *, jobject, jint, jint, jint, jint); + +/* + * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor + * Method: setSelection + * Signature: ([I)V + */ +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setSelection + (JNIEnv *, jobject, jintArray); + +/* + * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor + * Method: getMeshName + * Signature: (I)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getMeshName + (JNIEnv *, jobject, jint); + +/* + * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor + * Method: getMeshMaterial + * Signature: (I)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_getMeshMaterial + (JNIEnv *, jobject, jint); + +/* + * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor + * Method: setName + * Signature: (ILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_setName + (JNIEnv *, jobject, jint, jstring); /* * Class: org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor diff --git a/src/ui-core/example/Plugin/jni.h b/src/ui-core/example/Plugin/ubuntu/jni.h similarity index 100% rename from src/ui-core/example/Plugin/jni.h rename to src/ui-core/example/Plugin/ubuntu/jni.h diff --git a/src/ui-core/example/Plugin/ubuntu/jni_md.h b/src/ui-core/example/Plugin/ubuntu/jni_md.h new file mode 100644 index 0000000..9438dc3 --- /dev/null +++ b/src/ui-core/example/Plugin/ubuntu/jni_md.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved. + * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +#ifndef _JAVASOFT_JNI_MD_H_ +#define _JAVASOFT_JNI_MD_H_ + +#define JNIEXPORT +#define JNIIMPORT +#define JNICALL + +typedef int jint; +#ifdef _LP64 /* 64-bit Solaris */ +typedef long jlong; +#else +typedef long long jlong; +#endif + +typedef signed char jbyte; + +#endif /* !_JAVASOFT_JNI_MD_H_ */ diff --git a/src/ui-core/example/Plugin/win/jni.h b/src/ui-core/example/Plugin/win/jni.h new file mode 100644 index 0000000..ab9a693 --- /dev/null +++ b/src/ui-core/example/Plugin/win/jni.h @@ -0,0 +1,1959 @@ +/* + * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +/* + * We used part of Netscape's Java Runtime Interface (JRI) as the starting + * point of our design and implementation. + */ + +/****************************************************************************** + * Java Runtime Interface + * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved. + *****************************************************************************/ + +#ifndef _JAVASOFT_JNI_H_ +#define _JAVASOFT_JNI_H_ + +#include +#include + +/* jni_md.h contains the machine-dependent typedefs for jbyte, jint + and jlong */ + +#include "jni_md.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * JNI Types + */ + +#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H + +typedef unsigned char jboolean; +typedef unsigned short jchar; +typedef short jshort; +typedef float jfloat; +typedef double jdouble; + +typedef jint jsize; + +#ifdef __cplusplus + +class _jobject {}; +class _jclass : public _jobject {}; +class _jthrowable : public _jobject {}; +class _jstring : public _jobject {}; +class _jarray : public _jobject {}; +class _jbooleanArray : public _jarray {}; +class _jbyteArray : public _jarray {}; +class _jcharArray : public _jarray {}; +class _jshortArray : public _jarray {}; +class _jintArray : public _jarray {}; +class _jlongArray : public _jarray {}; +class _jfloatArray : public _jarray {}; +class _jdoubleArray : public _jarray {}; +class _jobjectArray : public _jarray {}; + +typedef _jobject *jobject; +typedef _jclass *jclass; +typedef _jthrowable *jthrowable; +typedef _jstring *jstring; +typedef _jarray *jarray; +typedef _jbooleanArray *jbooleanArray; +typedef _jbyteArray *jbyteArray; +typedef _jcharArray *jcharArray; +typedef _jshortArray *jshortArray; +typedef _jintArray *jintArray; +typedef _jlongArray *jlongArray; +typedef _jfloatArray *jfloatArray; +typedef _jdoubleArray *jdoubleArray; +typedef _jobjectArray *jobjectArray; + +#else + +struct _jobject; + +typedef struct _jobject *jobject; +typedef jobject jclass; +typedef jobject jthrowable; +typedef jobject jstring; +typedef jobject jarray; +typedef jarray jbooleanArray; +typedef jarray jbyteArray; +typedef jarray jcharArray; +typedef jarray jshortArray; +typedef jarray jintArray; +typedef jarray jlongArray; +typedef jarray jfloatArray; +typedef jarray jdoubleArray; +typedef jarray jobjectArray; + +#endif + +typedef jobject jweak; + +typedef union jvalue { + jboolean z; + jbyte b; + jchar c; + jshort s; + jint i; + jlong j; + jfloat f; + jdouble d; + jobject l; +} jvalue; + +struct _jfieldID; +typedef struct _jfieldID *jfieldID; + +struct _jmethodID; +typedef struct _jmethodID *jmethodID; + +/* Return values from jobjectRefType */ +typedef enum _jobjectType { + JNIInvalidRefType = 0, + JNILocalRefType = 1, + JNIGlobalRefType = 2, + JNIWeakGlobalRefType = 3 +} jobjectRefType; + + +#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */ + +/* + * jboolean constants + */ + +#define JNI_FALSE 0 +#define JNI_TRUE 1 + +/* + * possible return values for JNI functions. + */ + +#define JNI_OK 0 /* success */ +#define JNI_ERR (-1) /* unknown error */ +#define JNI_EDETACHED (-2) /* thread detached from the VM */ +#define JNI_EVERSION (-3) /* JNI version error */ +#define JNI_ENOMEM (-4) /* not enough memory */ +#define JNI_EEXIST (-5) /* VM already created */ +#define JNI_EINVAL (-6) /* invalid arguments */ + +/* + * used in ReleaseScalarArrayElements + */ + +#define JNI_COMMIT 1 +#define JNI_ABORT 2 + +/* + * used in RegisterNatives to describe native method name, signature, + * and function pointer. + */ + +typedef struct { + char *name; + char *signature; + void *fnPtr; +} JNINativeMethod; + +/* + * JNI Native Method Interface. + */ + +struct JNINativeInterface_; + +struct JNIEnv_; + +#ifdef __cplusplus +typedef JNIEnv_ JNIEnv; +#else +typedef const struct JNINativeInterface_ *JNIEnv; +#endif + +/* + * JNI Invocation Interface. + */ + +struct JNIInvokeInterface_; + +struct JavaVM_; + +#ifdef __cplusplus +typedef JavaVM_ JavaVM; +#else +typedef const struct JNIInvokeInterface_ *JavaVM; +#endif + +struct JNINativeInterface_ { + void *reserved0; + void *reserved1; + void *reserved2; + + void *reserved3; + jint (JNICALL *GetVersion)(JNIEnv *env); + + jclass (JNICALL *DefineClass) + (JNIEnv *env, const char *name, jobject loader, const jbyte *buf, + jsize len); + jclass (JNICALL *FindClass) + (JNIEnv *env, const char *name); + + jmethodID (JNICALL *FromReflectedMethod) + (JNIEnv *env, jobject method); + jfieldID (JNICALL *FromReflectedField) + (JNIEnv *env, jobject field); + + jobject (JNICALL *ToReflectedMethod) + (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic); + + jclass (JNICALL *GetSuperclass) + (JNIEnv *env, jclass sub); + jboolean (JNICALL *IsAssignableFrom) + (JNIEnv *env, jclass sub, jclass sup); + + jobject (JNICALL *ToReflectedField) + (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic); + + jint (JNICALL *Throw) + (JNIEnv *env, jthrowable obj); + jint (JNICALL *ThrowNew) + (JNIEnv *env, jclass clazz, const char *msg); + jthrowable (JNICALL *ExceptionOccurred) + (JNIEnv *env); + void (JNICALL *ExceptionDescribe) + (JNIEnv *env); + void (JNICALL *ExceptionClear) + (JNIEnv *env); + void (JNICALL *FatalError) + (JNIEnv *env, const char *msg); + + jint (JNICALL *PushLocalFrame) + (JNIEnv *env, jint capacity); + jobject (JNICALL *PopLocalFrame) + (JNIEnv *env, jobject result); + + jobject (JNICALL *NewGlobalRef) + (JNIEnv *env, jobject lobj); + void (JNICALL *DeleteGlobalRef) + (JNIEnv *env, jobject gref); + void (JNICALL *DeleteLocalRef) + (JNIEnv *env, jobject obj); + jboolean (JNICALL *IsSameObject) + (JNIEnv *env, jobject obj1, jobject obj2); + jobject (JNICALL *NewLocalRef) + (JNIEnv *env, jobject ref); + jint (JNICALL *EnsureLocalCapacity) + (JNIEnv *env, jint capacity); + + jobject (JNICALL *AllocObject) + (JNIEnv *env, jclass clazz); + jobject (JNICALL *NewObject) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *NewObjectV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jobject (JNICALL *NewObjectA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jclass (JNICALL *GetObjectClass) + (JNIEnv *env, jobject obj); + jboolean (JNICALL *IsInstanceOf) + (JNIEnv *env, jobject obj, jclass clazz); + + jmethodID (JNICALL *GetMethodID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *CallObjectMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jobject (JNICALL *CallObjectMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jobject (JNICALL *CallObjectMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); + + jboolean (JNICALL *CallBooleanMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jboolean (JNICALL *CallBooleanMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jboolean (JNICALL *CallBooleanMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); + + jbyte (JNICALL *CallByteMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jbyte (JNICALL *CallByteMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jbyte (JNICALL *CallByteMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jchar (JNICALL *CallCharMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jchar (JNICALL *CallCharMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jchar (JNICALL *CallCharMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jshort (JNICALL *CallShortMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jshort (JNICALL *CallShortMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jshort (JNICALL *CallShortMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jint (JNICALL *CallIntMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jint (JNICALL *CallIntMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jint (JNICALL *CallIntMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jlong (JNICALL *CallLongMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jlong (JNICALL *CallLongMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jlong (JNICALL *CallLongMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jfloat (JNICALL *CallFloatMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jfloat (JNICALL *CallFloatMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jfloat (JNICALL *CallFloatMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jdouble (JNICALL *CallDoubleMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jdouble (JNICALL *CallDoubleMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jdouble (JNICALL *CallDoubleMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + void (JNICALL *CallVoidMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + void (JNICALL *CallVoidMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + void (JNICALL *CallVoidMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); + + jobject (JNICALL *CallNonvirtualObjectMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *CallNonvirtualObjectMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jobject (JNICALL *CallNonvirtualObjectMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue * args); + + jboolean (JNICALL *CallNonvirtualBooleanMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jboolean (JNICALL *CallNonvirtualBooleanMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jboolean (JNICALL *CallNonvirtualBooleanMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue * args); + + jbyte (JNICALL *CallNonvirtualByteMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jbyte (JNICALL *CallNonvirtualByteMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jbyte (JNICALL *CallNonvirtualByteMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jchar (JNICALL *CallNonvirtualCharMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jchar (JNICALL *CallNonvirtualCharMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jchar (JNICALL *CallNonvirtualCharMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jshort (JNICALL *CallNonvirtualShortMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jshort (JNICALL *CallNonvirtualShortMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jshort (JNICALL *CallNonvirtualShortMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jint (JNICALL *CallNonvirtualIntMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jint (JNICALL *CallNonvirtualIntMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jint (JNICALL *CallNonvirtualIntMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jlong (JNICALL *CallNonvirtualLongMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jlong (JNICALL *CallNonvirtualLongMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jlong (JNICALL *CallNonvirtualLongMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jfloat (JNICALL *CallNonvirtualFloatMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jfloat (JNICALL *CallNonvirtualFloatMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jfloat (JNICALL *CallNonvirtualFloatMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jdouble (JNICALL *CallNonvirtualDoubleMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jdouble (JNICALL *CallNonvirtualDoubleMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jdouble (JNICALL *CallNonvirtualDoubleMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + void (JNICALL *CallNonvirtualVoidMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + void (JNICALL *CallNonvirtualVoidMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + void (JNICALL *CallNonvirtualVoidMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue * args); + + jfieldID (JNICALL *GetFieldID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *GetObjectField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jboolean (JNICALL *GetBooleanField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jbyte (JNICALL *GetByteField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jchar (JNICALL *GetCharField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jshort (JNICALL *GetShortField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jint (JNICALL *GetIntField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jlong (JNICALL *GetLongField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jfloat (JNICALL *GetFloatField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jdouble (JNICALL *GetDoubleField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + + void (JNICALL *SetObjectField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val); + void (JNICALL *SetBooleanField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val); + void (JNICALL *SetByteField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val); + void (JNICALL *SetCharField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val); + void (JNICALL *SetShortField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val); + void (JNICALL *SetIntField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jint val); + void (JNICALL *SetLongField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val); + void (JNICALL *SetFloatField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val); + void (JNICALL *SetDoubleField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val); + + jmethodID (JNICALL *GetStaticMethodID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *CallStaticObjectMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *CallStaticObjectMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jobject (JNICALL *CallStaticObjectMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jboolean (JNICALL *CallStaticBooleanMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jboolean (JNICALL *CallStaticBooleanMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jboolean (JNICALL *CallStaticBooleanMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jbyte (JNICALL *CallStaticByteMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jbyte (JNICALL *CallStaticByteMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jbyte (JNICALL *CallStaticByteMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jchar (JNICALL *CallStaticCharMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jchar (JNICALL *CallStaticCharMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jchar (JNICALL *CallStaticCharMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jshort (JNICALL *CallStaticShortMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jshort (JNICALL *CallStaticShortMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jshort (JNICALL *CallStaticShortMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jint (JNICALL *CallStaticIntMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jint (JNICALL *CallStaticIntMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jint (JNICALL *CallStaticIntMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jlong (JNICALL *CallStaticLongMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jlong (JNICALL *CallStaticLongMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jlong (JNICALL *CallStaticLongMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jfloat (JNICALL *CallStaticFloatMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jfloat (JNICALL *CallStaticFloatMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jfloat (JNICALL *CallStaticFloatMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jdouble (JNICALL *CallStaticDoubleMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jdouble (JNICALL *CallStaticDoubleMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jdouble (JNICALL *CallStaticDoubleMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + void (JNICALL *CallStaticVoidMethod) + (JNIEnv *env, jclass cls, jmethodID methodID, ...); + void (JNICALL *CallStaticVoidMethodV) + (JNIEnv *env, jclass cls, jmethodID methodID, va_list args); + void (JNICALL *CallStaticVoidMethodA) + (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args); + + jfieldID (JNICALL *GetStaticFieldID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + jobject (JNICALL *GetStaticObjectField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jboolean (JNICALL *GetStaticBooleanField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jbyte (JNICALL *GetStaticByteField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jchar (JNICALL *GetStaticCharField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jshort (JNICALL *GetStaticShortField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jint (JNICALL *GetStaticIntField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jlong (JNICALL *GetStaticLongField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jfloat (JNICALL *GetStaticFloatField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jdouble (JNICALL *GetStaticDoubleField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + + void (JNICALL *SetStaticObjectField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value); + void (JNICALL *SetStaticBooleanField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value); + void (JNICALL *SetStaticByteField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value); + void (JNICALL *SetStaticCharField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value); + void (JNICALL *SetStaticShortField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value); + void (JNICALL *SetStaticIntField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value); + void (JNICALL *SetStaticLongField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value); + void (JNICALL *SetStaticFloatField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value); + void (JNICALL *SetStaticDoubleField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value); + + jstring (JNICALL *NewString) + (JNIEnv *env, const jchar *unicode, jsize len); + jsize (JNICALL *GetStringLength) + (JNIEnv *env, jstring str); + const jchar *(JNICALL *GetStringChars) + (JNIEnv *env, jstring str, jboolean *isCopy); + void (JNICALL *ReleaseStringChars) + (JNIEnv *env, jstring str, const jchar *chars); + + jstring (JNICALL *NewStringUTF) + (JNIEnv *env, const char *utf); + jsize (JNICALL *GetStringUTFLength) + (JNIEnv *env, jstring str); + const char* (JNICALL *GetStringUTFChars) + (JNIEnv *env, jstring str, jboolean *isCopy); + void (JNICALL *ReleaseStringUTFChars) + (JNIEnv *env, jstring str, const char* chars); + + + jsize (JNICALL *GetArrayLength) + (JNIEnv *env, jarray array); + + jobjectArray (JNICALL *NewObjectArray) + (JNIEnv *env, jsize len, jclass clazz, jobject init); + jobject (JNICALL *GetObjectArrayElement) + (JNIEnv *env, jobjectArray array, jsize index); + void (JNICALL *SetObjectArrayElement) + (JNIEnv *env, jobjectArray array, jsize index, jobject val); + + jbooleanArray (JNICALL *NewBooleanArray) + (JNIEnv *env, jsize len); + jbyteArray (JNICALL *NewByteArray) + (JNIEnv *env, jsize len); + jcharArray (JNICALL *NewCharArray) + (JNIEnv *env, jsize len); + jshortArray (JNICALL *NewShortArray) + (JNIEnv *env, jsize len); + jintArray (JNICALL *NewIntArray) + (JNIEnv *env, jsize len); + jlongArray (JNICALL *NewLongArray) + (JNIEnv *env, jsize len); + jfloatArray (JNICALL *NewFloatArray) + (JNIEnv *env, jsize len); + jdoubleArray (JNICALL *NewDoubleArray) + (JNIEnv *env, jsize len); + + jboolean * (JNICALL *GetBooleanArrayElements) + (JNIEnv *env, jbooleanArray array, jboolean *isCopy); + jbyte * (JNICALL *GetByteArrayElements) + (JNIEnv *env, jbyteArray array, jboolean *isCopy); + jchar * (JNICALL *GetCharArrayElements) + (JNIEnv *env, jcharArray array, jboolean *isCopy); + jshort * (JNICALL *GetShortArrayElements) + (JNIEnv *env, jshortArray array, jboolean *isCopy); + jint * (JNICALL *GetIntArrayElements) + (JNIEnv *env, jintArray array, jboolean *isCopy); + jlong * (JNICALL *GetLongArrayElements) + (JNIEnv *env, jlongArray array, jboolean *isCopy); + jfloat * (JNICALL *GetFloatArrayElements) + (JNIEnv *env, jfloatArray array, jboolean *isCopy); + jdouble * (JNICALL *GetDoubleArrayElements) + (JNIEnv *env, jdoubleArray array, jboolean *isCopy); + + void (JNICALL *ReleaseBooleanArrayElements) + (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode); + void (JNICALL *ReleaseByteArrayElements) + (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode); + void (JNICALL *ReleaseCharArrayElements) + (JNIEnv *env, jcharArray array, jchar *elems, jint mode); + void (JNICALL *ReleaseShortArrayElements) + (JNIEnv *env, jshortArray array, jshort *elems, jint mode); + void (JNICALL *ReleaseIntArrayElements) + (JNIEnv *env, jintArray array, jint *elems, jint mode); + void (JNICALL *ReleaseLongArrayElements) + (JNIEnv *env, jlongArray array, jlong *elems, jint mode); + void (JNICALL *ReleaseFloatArrayElements) + (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode); + void (JNICALL *ReleaseDoubleArrayElements) + (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode); + + void (JNICALL *GetBooleanArrayRegion) + (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf); + void (JNICALL *GetByteArrayRegion) + (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf); + void (JNICALL *GetCharArrayRegion) + (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf); + void (JNICALL *GetShortArrayRegion) + (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf); + void (JNICALL *GetIntArrayRegion) + (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf); + void (JNICALL *GetLongArrayRegion) + (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf); + void (JNICALL *GetFloatArrayRegion) + (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf); + void (JNICALL *GetDoubleArrayRegion) + (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf); + + void (JNICALL *SetBooleanArrayRegion) + (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf); + void (JNICALL *SetByteArrayRegion) + (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf); + void (JNICALL *SetCharArrayRegion) + (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf); + void (JNICALL *SetShortArrayRegion) + (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf); + void (JNICALL *SetIntArrayRegion) + (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf); + void (JNICALL *SetLongArrayRegion) + (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf); + void (JNICALL *SetFloatArrayRegion) + (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf); + void (JNICALL *SetDoubleArrayRegion) + (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf); + + jint (JNICALL *RegisterNatives) + (JNIEnv *env, jclass clazz, const JNINativeMethod *methods, + jint nMethods); + jint (JNICALL *UnregisterNatives) + (JNIEnv *env, jclass clazz); + + jint (JNICALL *MonitorEnter) + (JNIEnv *env, jobject obj); + jint (JNICALL *MonitorExit) + (JNIEnv *env, jobject obj); + + jint (JNICALL *GetJavaVM) + (JNIEnv *env, JavaVM **vm); + + void (JNICALL *GetStringRegion) + (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf); + void (JNICALL *GetStringUTFRegion) + (JNIEnv *env, jstring str, jsize start, jsize len, char *buf); + + void * (JNICALL *GetPrimitiveArrayCritical) + (JNIEnv *env, jarray array, jboolean *isCopy); + void (JNICALL *ReleasePrimitiveArrayCritical) + (JNIEnv *env, jarray array, void *carray, jint mode); + + const jchar * (JNICALL *GetStringCritical) + (JNIEnv *env, jstring string, jboolean *isCopy); + void (JNICALL *ReleaseStringCritical) + (JNIEnv *env, jstring string, const jchar *cstring); + + jweak (JNICALL *NewWeakGlobalRef) + (JNIEnv *env, jobject obj); + void (JNICALL *DeleteWeakGlobalRef) + (JNIEnv *env, jweak ref); + + jboolean (JNICALL *ExceptionCheck) + (JNIEnv *env); + + jobject (JNICALL *NewDirectByteBuffer) + (JNIEnv* env, void* address, jlong capacity); + void* (JNICALL *GetDirectBufferAddress) + (JNIEnv* env, jobject buf); + jlong (JNICALL *GetDirectBufferCapacity) + (JNIEnv* env, jobject buf); + + /* New JNI 1.6 Features */ + + jobjectRefType (JNICALL *GetObjectRefType) + (JNIEnv* env, jobject obj); +}; + +/* + * We use inlined functions for C++ so that programmers can write: + * + * env->FindClass("java/lang/String") + * + * in C++ rather than: + * + * (*env)->FindClass(env, "java/lang/String") + * + * in C. + */ + +struct JNIEnv_ { + const struct JNINativeInterface_ *functions; +#ifdef __cplusplus + + jint GetVersion() { + return functions->GetVersion(this); + } + jclass DefineClass(const char *name, jobject loader, const jbyte *buf, + jsize len) { + return functions->DefineClass(this, name, loader, buf, len); + } + jclass FindClass(const char *name) { + return functions->FindClass(this, name); + } + jmethodID FromReflectedMethod(jobject method) { + return functions->FromReflectedMethod(this,method); + } + jfieldID FromReflectedField(jobject field) { + return functions->FromReflectedField(this,field); + } + + jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) { + return functions->ToReflectedMethod(this, cls, methodID, isStatic); + } + + jclass GetSuperclass(jclass sub) { + return functions->GetSuperclass(this, sub); + } + jboolean IsAssignableFrom(jclass sub, jclass sup) { + return functions->IsAssignableFrom(this, sub, sup); + } + + jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) { + return functions->ToReflectedField(this,cls,fieldID,isStatic); + } + + jint Throw(jthrowable obj) { + return functions->Throw(this, obj); + } + jint ThrowNew(jclass clazz, const char *msg) { + return functions->ThrowNew(this, clazz, msg); + } + jthrowable ExceptionOccurred() { + return functions->ExceptionOccurred(this); + } + void ExceptionDescribe() { + functions->ExceptionDescribe(this); + } + void ExceptionClear() { + functions->ExceptionClear(this); + } + void FatalError(const char *msg) { + functions->FatalError(this, msg); + } + + jint PushLocalFrame(jint capacity) { + return functions->PushLocalFrame(this,capacity); + } + jobject PopLocalFrame(jobject result) { + return functions->PopLocalFrame(this,result); + } + + jobject NewGlobalRef(jobject lobj) { + return functions->NewGlobalRef(this,lobj); + } + void DeleteGlobalRef(jobject gref) { + functions->DeleteGlobalRef(this,gref); + } + void DeleteLocalRef(jobject obj) { + functions->DeleteLocalRef(this, obj); + } + + jboolean IsSameObject(jobject obj1, jobject obj2) { + return functions->IsSameObject(this,obj1,obj2); + } + + jobject NewLocalRef(jobject ref) { + return functions->NewLocalRef(this,ref); + } + jint EnsureLocalCapacity(jint capacity) { + return functions->EnsureLocalCapacity(this,capacity); + } + + jobject AllocObject(jclass clazz) { + return functions->AllocObject(this,clazz); + } + jobject NewObject(jclass clazz, jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args, methodID); + result = functions->NewObjectV(this,clazz,methodID,args); + va_end(args); + return result; + } + jobject NewObjectV(jclass clazz, jmethodID methodID, + va_list args) { + return functions->NewObjectV(this,clazz,methodID,args); + } + jobject NewObjectA(jclass clazz, jmethodID methodID, + const jvalue *args) { + return functions->NewObjectA(this,clazz,methodID,args); + } + + jclass GetObjectClass(jobject obj) { + return functions->GetObjectClass(this,obj); + } + jboolean IsInstanceOf(jobject obj, jclass clazz) { + return functions->IsInstanceOf(this,obj,clazz); + } + + jmethodID GetMethodID(jclass clazz, const char *name, + const char *sig) { + return functions->GetMethodID(this,clazz,name,sig); + } + + jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallObjectMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jobject CallObjectMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallObjectMethodV(this,obj,methodID,args); + } + jobject CallObjectMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallObjectMethodA(this,obj,methodID,args); + } + + jboolean CallBooleanMethod(jobject obj, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallBooleanMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jboolean CallBooleanMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallBooleanMethodV(this,obj,methodID,args); + } + jboolean CallBooleanMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallBooleanMethodA(this,obj,methodID, args); + } + + jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallByteMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jbyte CallByteMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallByteMethodV(this,obj,methodID,args); + } + jbyte CallByteMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallByteMethodA(this,obj,methodID,args); + } + + jchar CallCharMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallCharMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jchar CallCharMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallCharMethodV(this,obj,methodID,args); + } + jchar CallCharMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallCharMethodA(this,obj,methodID,args); + } + + jshort CallShortMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallShortMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jshort CallShortMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallShortMethodV(this,obj,methodID,args); + } + jshort CallShortMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallShortMethodA(this,obj,methodID,args); + } + + jint CallIntMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallIntMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jint CallIntMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallIntMethodV(this,obj,methodID,args); + } + jint CallIntMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallIntMethodA(this,obj,methodID,args); + } + + jlong CallLongMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallLongMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jlong CallLongMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallLongMethodV(this,obj,methodID,args); + } + jlong CallLongMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallLongMethodA(this,obj,methodID,args); + } + + jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallFloatMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jfloat CallFloatMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallFloatMethodV(this,obj,methodID,args); + } + jfloat CallFloatMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallFloatMethodA(this,obj,methodID,args); + } + + jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallDoubleMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jdouble CallDoubleMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallDoubleMethodV(this,obj,methodID,args); + } + jdouble CallDoubleMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallDoubleMethodA(this,obj,methodID,args); + } + + void CallVoidMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallVoidMethodV(this,obj,methodID,args); + va_end(args); + } + void CallVoidMethodV(jobject obj, jmethodID methodID, + va_list args) { + functions->CallVoidMethodV(this,obj,methodID,args); + } + void CallVoidMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + functions->CallVoidMethodA(this,obj,methodID,args); + } + + jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallNonvirtualObjectMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualObjectMethodV(this,obj,clazz, + methodID,args); + } + jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualObjectMethodA(this,obj,clazz, + methodID,args); + } + + jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualBooleanMethodV(this,obj,clazz, + methodID,args); + } + jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualBooleanMethodA(this,obj,clazz, + methodID, args); + } + + jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallNonvirtualByteMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualByteMethodV(this,obj,clazz, + methodID,args); + } + jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualByteMethodA(this,obj,clazz, + methodID,args); + } + + jchar CallNonvirtualCharMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallNonvirtualCharMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualCharMethodV(this,obj,clazz, + methodID,args); + } + jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualCharMethodA(this,obj,clazz, + methodID,args); + } + + jshort CallNonvirtualShortMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallNonvirtualShortMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualShortMethodV(this,obj,clazz, + methodID,args); + } + jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualShortMethodA(this,obj,clazz, + methodID,args); + } + + jint CallNonvirtualIntMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallNonvirtualIntMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jint CallNonvirtualIntMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualIntMethodV(this,obj,clazz, + methodID,args); + } + jint CallNonvirtualIntMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualIntMethodA(this,obj,clazz, + methodID,args); + } + + jlong CallNonvirtualLongMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallNonvirtualLongMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualLongMethodV(this,obj,clazz, + methodID,args); + } + jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualLongMethodA(this,obj,clazz, + methodID,args); + } + + jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallNonvirtualFloatMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + return functions->CallNonvirtualFloatMethodV(this,obj,clazz, + methodID,args); + } + jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz, + jmethodID methodID, + const jvalue * args) { + return functions->CallNonvirtualFloatMethodA(this,obj,clazz, + methodID,args); + } + + jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + return functions->CallNonvirtualDoubleMethodV(this,obj,clazz, + methodID,args); + } + jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz, + jmethodID methodID, + const jvalue * args) { + return functions->CallNonvirtualDoubleMethodA(this,obj,clazz, + methodID,args); + } + + void CallNonvirtualVoidMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); + va_end(args); + } + void CallNonvirtualVoidMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); + } + void CallNonvirtualVoidMethodA(jobject obj, jclass clazz, + jmethodID methodID, + const jvalue * args) { + functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args); + } + + jfieldID GetFieldID(jclass clazz, const char *name, + const char *sig) { + return functions->GetFieldID(this,clazz,name,sig); + } + + jobject GetObjectField(jobject obj, jfieldID fieldID) { + return functions->GetObjectField(this,obj,fieldID); + } + jboolean GetBooleanField(jobject obj, jfieldID fieldID) { + return functions->GetBooleanField(this,obj,fieldID); + } + jbyte GetByteField(jobject obj, jfieldID fieldID) { + return functions->GetByteField(this,obj,fieldID); + } + jchar GetCharField(jobject obj, jfieldID fieldID) { + return functions->GetCharField(this,obj,fieldID); + } + jshort GetShortField(jobject obj, jfieldID fieldID) { + return functions->GetShortField(this,obj,fieldID); + } + jint GetIntField(jobject obj, jfieldID fieldID) { + return functions->GetIntField(this,obj,fieldID); + } + jlong GetLongField(jobject obj, jfieldID fieldID) { + return functions->GetLongField(this,obj,fieldID); + } + jfloat GetFloatField(jobject obj, jfieldID fieldID) { + return functions->GetFloatField(this,obj,fieldID); + } + jdouble GetDoubleField(jobject obj, jfieldID fieldID) { + return functions->GetDoubleField(this,obj,fieldID); + } + + void SetObjectField(jobject obj, jfieldID fieldID, jobject val) { + functions->SetObjectField(this,obj,fieldID,val); + } + void SetBooleanField(jobject obj, jfieldID fieldID, + jboolean val) { + functions->SetBooleanField(this,obj,fieldID,val); + } + void SetByteField(jobject obj, jfieldID fieldID, + jbyte val) { + functions->SetByteField(this,obj,fieldID,val); + } + void SetCharField(jobject obj, jfieldID fieldID, + jchar val) { + functions->SetCharField(this,obj,fieldID,val); + } + void SetShortField(jobject obj, jfieldID fieldID, + jshort val) { + functions->SetShortField(this,obj,fieldID,val); + } + void SetIntField(jobject obj, jfieldID fieldID, + jint val) { + functions->SetIntField(this,obj,fieldID,val); + } + void SetLongField(jobject obj, jfieldID fieldID, + jlong val) { + functions->SetLongField(this,obj,fieldID,val); + } + void SetFloatField(jobject obj, jfieldID fieldID, + jfloat val) { + functions->SetFloatField(this,obj,fieldID,val); + } + void SetDoubleField(jobject obj, jfieldID fieldID, + jdouble val) { + functions->SetDoubleField(this,obj,fieldID,val); + } + + jmethodID GetStaticMethodID(jclass clazz, const char *name, + const char *sig) { + return functions->GetStaticMethodID(this,clazz,name,sig); + } + + jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID, + ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallStaticObjectMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID, + va_list args) { + return functions->CallStaticObjectMethodV(this,clazz,methodID,args); + } + jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID, + const jvalue *args) { + return functions->CallStaticObjectMethodA(this,clazz,methodID,args); + } + + jboolean CallStaticBooleanMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jboolean CallStaticBooleanMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticBooleanMethodV(this,clazz,methodID,args); + } + jboolean CallStaticBooleanMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticBooleanMethodA(this,clazz,methodID,args); + } + + jbyte CallStaticByteMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallStaticByteMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jbyte CallStaticByteMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticByteMethodV(this,clazz,methodID,args); + } + jbyte CallStaticByteMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticByteMethodA(this,clazz,methodID,args); + } + + jchar CallStaticCharMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallStaticCharMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jchar CallStaticCharMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticCharMethodV(this,clazz,methodID,args); + } + jchar CallStaticCharMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticCharMethodA(this,clazz,methodID,args); + } + + jshort CallStaticShortMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallStaticShortMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jshort CallStaticShortMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticShortMethodV(this,clazz,methodID,args); + } + jshort CallStaticShortMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticShortMethodA(this,clazz,methodID,args); + } + + jint CallStaticIntMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallStaticIntMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jint CallStaticIntMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticIntMethodV(this,clazz,methodID,args); + } + jint CallStaticIntMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticIntMethodA(this,clazz,methodID,args); + } + + jlong CallStaticLongMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallStaticLongMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jlong CallStaticLongMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticLongMethodV(this,clazz,methodID,args); + } + jlong CallStaticLongMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticLongMethodA(this,clazz,methodID,args); + } + + jfloat CallStaticFloatMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallStaticFloatMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jfloat CallStaticFloatMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticFloatMethodV(this,clazz,methodID,args); + } + jfloat CallStaticFloatMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticFloatMethodA(this,clazz,methodID,args); + } + + jdouble CallStaticDoubleMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jdouble CallStaticDoubleMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticDoubleMethodV(this,clazz,methodID,args); + } + jdouble CallStaticDoubleMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticDoubleMethodA(this,clazz,methodID,args); + } + + void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallStaticVoidMethodV(this,cls,methodID,args); + va_end(args); + } + void CallStaticVoidMethodV(jclass cls, jmethodID methodID, + va_list args) { + functions->CallStaticVoidMethodV(this,cls,methodID,args); + } + void CallStaticVoidMethodA(jclass cls, jmethodID methodID, + const jvalue * args) { + functions->CallStaticVoidMethodA(this,cls,methodID,args); + } + + jfieldID GetStaticFieldID(jclass clazz, const char *name, + const char *sig) { + return functions->GetStaticFieldID(this,clazz,name,sig); + } + jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticObjectField(this,clazz,fieldID); + } + jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticBooleanField(this,clazz,fieldID); + } + jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticByteField(this,clazz,fieldID); + } + jchar GetStaticCharField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticCharField(this,clazz,fieldID); + } + jshort GetStaticShortField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticShortField(this,clazz,fieldID); + } + jint GetStaticIntField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticIntField(this,clazz,fieldID); + } + jlong GetStaticLongField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticLongField(this,clazz,fieldID); + } + jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticFloatField(this,clazz,fieldID); + } + jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticDoubleField(this,clazz,fieldID); + } + + void SetStaticObjectField(jclass clazz, jfieldID fieldID, + jobject value) { + functions->SetStaticObjectField(this,clazz,fieldID,value); + } + void SetStaticBooleanField(jclass clazz, jfieldID fieldID, + jboolean value) { + functions->SetStaticBooleanField(this,clazz,fieldID,value); + } + void SetStaticByteField(jclass clazz, jfieldID fieldID, + jbyte value) { + functions->SetStaticByteField(this,clazz,fieldID,value); + } + void SetStaticCharField(jclass clazz, jfieldID fieldID, + jchar value) { + functions->SetStaticCharField(this,clazz,fieldID,value); + } + void SetStaticShortField(jclass clazz, jfieldID fieldID, + jshort value) { + functions->SetStaticShortField(this,clazz,fieldID,value); + } + void SetStaticIntField(jclass clazz, jfieldID fieldID, + jint value) { + functions->SetStaticIntField(this,clazz,fieldID,value); + } + void SetStaticLongField(jclass clazz, jfieldID fieldID, + jlong value) { + functions->SetStaticLongField(this,clazz,fieldID,value); + } + void SetStaticFloatField(jclass clazz, jfieldID fieldID, + jfloat value) { + functions->SetStaticFloatField(this,clazz,fieldID,value); + } + void SetStaticDoubleField(jclass clazz, jfieldID fieldID, + jdouble value) { + functions->SetStaticDoubleField(this,clazz,fieldID,value); + } + + jstring NewString(const jchar *unicode, jsize len) { + return functions->NewString(this,unicode,len); + } + jsize GetStringLength(jstring str) { + return functions->GetStringLength(this,str); + } + const jchar *GetStringChars(jstring str, jboolean *isCopy) { + return functions->GetStringChars(this,str,isCopy); + } + void ReleaseStringChars(jstring str, const jchar *chars) { + functions->ReleaseStringChars(this,str,chars); + } + + jstring NewStringUTF(const char *utf) { + return functions->NewStringUTF(this,utf); + } + jsize GetStringUTFLength(jstring str) { + return functions->GetStringUTFLength(this,str); + } + const char* GetStringUTFChars(jstring str, jboolean *isCopy) { + return functions->GetStringUTFChars(this,str,isCopy); + } + void ReleaseStringUTFChars(jstring str, const char* chars) { + functions->ReleaseStringUTFChars(this,str,chars); + } + + jsize GetArrayLength(jarray array) { + return functions->GetArrayLength(this,array); + } + + jobjectArray NewObjectArray(jsize len, jclass clazz, + jobject init) { + return functions->NewObjectArray(this,len,clazz,init); + } + jobject GetObjectArrayElement(jobjectArray array, jsize index) { + return functions->GetObjectArrayElement(this,array,index); + } + void SetObjectArrayElement(jobjectArray array, jsize index, + jobject val) { + functions->SetObjectArrayElement(this,array,index,val); + } + + jbooleanArray NewBooleanArray(jsize len) { + return functions->NewBooleanArray(this,len); + } + jbyteArray NewByteArray(jsize len) { + return functions->NewByteArray(this,len); + } + jcharArray NewCharArray(jsize len) { + return functions->NewCharArray(this,len); + } + jshortArray NewShortArray(jsize len) { + return functions->NewShortArray(this,len); + } + jintArray NewIntArray(jsize len) { + return functions->NewIntArray(this,len); + } + jlongArray NewLongArray(jsize len) { + return functions->NewLongArray(this,len); + } + jfloatArray NewFloatArray(jsize len) { + return functions->NewFloatArray(this,len); + } + jdoubleArray NewDoubleArray(jsize len) { + return functions->NewDoubleArray(this,len); + } + + jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) { + return functions->GetBooleanArrayElements(this,array,isCopy); + } + jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) { + return functions->GetByteArrayElements(this,array,isCopy); + } + jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) { + return functions->GetCharArrayElements(this,array,isCopy); + } + jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) { + return functions->GetShortArrayElements(this,array,isCopy); + } + jint * GetIntArrayElements(jintArray array, jboolean *isCopy) { + return functions->GetIntArrayElements(this,array,isCopy); + } + jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) { + return functions->GetLongArrayElements(this,array,isCopy); + } + jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) { + return functions->GetFloatArrayElements(this,array,isCopy); + } + jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) { + return functions->GetDoubleArrayElements(this,array,isCopy); + } + + void ReleaseBooleanArrayElements(jbooleanArray array, + jboolean *elems, + jint mode) { + functions->ReleaseBooleanArrayElements(this,array,elems,mode); + } + void ReleaseByteArrayElements(jbyteArray array, + jbyte *elems, + jint mode) { + functions->ReleaseByteArrayElements(this,array,elems,mode); + } + void ReleaseCharArrayElements(jcharArray array, + jchar *elems, + jint mode) { + functions->ReleaseCharArrayElements(this,array,elems,mode); + } + void ReleaseShortArrayElements(jshortArray array, + jshort *elems, + jint mode) { + functions->ReleaseShortArrayElements(this,array,elems,mode); + } + void ReleaseIntArrayElements(jintArray array, + jint *elems, + jint mode) { + functions->ReleaseIntArrayElements(this,array,elems,mode); + } + void ReleaseLongArrayElements(jlongArray array, + jlong *elems, + jint mode) { + functions->ReleaseLongArrayElements(this,array,elems,mode); + } + void ReleaseFloatArrayElements(jfloatArray array, + jfloat *elems, + jint mode) { + functions->ReleaseFloatArrayElements(this,array,elems,mode); + } + void ReleaseDoubleArrayElements(jdoubleArray array, + jdouble *elems, + jint mode) { + functions->ReleaseDoubleArrayElements(this,array,elems,mode); + } + + void GetBooleanArrayRegion(jbooleanArray array, + jsize start, jsize len, jboolean *buf) { + functions->GetBooleanArrayRegion(this,array,start,len,buf); + } + void GetByteArrayRegion(jbyteArray array, + jsize start, jsize len, jbyte *buf) { + functions->GetByteArrayRegion(this,array,start,len,buf); + } + void GetCharArrayRegion(jcharArray array, + jsize start, jsize len, jchar *buf) { + functions->GetCharArrayRegion(this,array,start,len,buf); + } + void GetShortArrayRegion(jshortArray array, + jsize start, jsize len, jshort *buf) { + functions->GetShortArrayRegion(this,array,start,len,buf); + } + void GetIntArrayRegion(jintArray array, + jsize start, jsize len, jint *buf) { + functions->GetIntArrayRegion(this,array,start,len,buf); + } + void GetLongArrayRegion(jlongArray array, + jsize start, jsize len, jlong *buf) { + functions->GetLongArrayRegion(this,array,start,len,buf); + } + void GetFloatArrayRegion(jfloatArray array, + jsize start, jsize len, jfloat *buf) { + functions->GetFloatArrayRegion(this,array,start,len,buf); + } + void GetDoubleArrayRegion(jdoubleArray array, + jsize start, jsize len, jdouble *buf) { + functions->GetDoubleArrayRegion(this,array,start,len,buf); + } + + void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len, + const jboolean *buf) { + functions->SetBooleanArrayRegion(this,array,start,len,buf); + } + void SetByteArrayRegion(jbyteArray array, jsize start, jsize len, + const jbyte *buf) { + functions->SetByteArrayRegion(this,array,start,len,buf); + } + void SetCharArrayRegion(jcharArray array, jsize start, jsize len, + const jchar *buf) { + functions->SetCharArrayRegion(this,array,start,len,buf); + } + void SetShortArrayRegion(jshortArray array, jsize start, jsize len, + const jshort *buf) { + functions->SetShortArrayRegion(this,array,start,len,buf); + } + void SetIntArrayRegion(jintArray array, jsize start, jsize len, + const jint *buf) { + functions->SetIntArrayRegion(this,array,start,len,buf); + } + void SetLongArrayRegion(jlongArray array, jsize start, jsize len, + const jlong *buf) { + functions->SetLongArrayRegion(this,array,start,len,buf); + } + void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len, + const jfloat *buf) { + functions->SetFloatArrayRegion(this,array,start,len,buf); + } + void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len, + const jdouble *buf) { + functions->SetDoubleArrayRegion(this,array,start,len,buf); + } + + jint RegisterNatives(jclass clazz, const JNINativeMethod *methods, + jint nMethods) { + return functions->RegisterNatives(this,clazz,methods,nMethods); + } + jint UnregisterNatives(jclass clazz) { + return functions->UnregisterNatives(this,clazz); + } + + jint MonitorEnter(jobject obj) { + return functions->MonitorEnter(this,obj); + } + jint MonitorExit(jobject obj) { + return functions->MonitorExit(this,obj); + } + + jint GetJavaVM(JavaVM **vm) { + return functions->GetJavaVM(this,vm); + } + + void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) { + functions->GetStringRegion(this,str,start,len,buf); + } + void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) { + functions->GetStringUTFRegion(this,str,start,len,buf); + } + + void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) { + return functions->GetPrimitiveArrayCritical(this,array,isCopy); + } + void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) { + functions->ReleasePrimitiveArrayCritical(this,array,carray,mode); + } + + const jchar * GetStringCritical(jstring string, jboolean *isCopy) { + return functions->GetStringCritical(this,string,isCopy); + } + void ReleaseStringCritical(jstring string, const jchar *cstring) { + functions->ReleaseStringCritical(this,string,cstring); + } + + jweak NewWeakGlobalRef(jobject obj) { + return functions->NewWeakGlobalRef(this,obj); + } + void DeleteWeakGlobalRef(jweak ref) { + functions->DeleteWeakGlobalRef(this,ref); + } + + jboolean ExceptionCheck() { + return functions->ExceptionCheck(this); + } + + jobject NewDirectByteBuffer(void* address, jlong capacity) { + return functions->NewDirectByteBuffer(this, address, capacity); + } + void* GetDirectBufferAddress(jobject buf) { + return functions->GetDirectBufferAddress(this, buf); + } + jlong GetDirectBufferCapacity(jobject buf) { + return functions->GetDirectBufferCapacity(this, buf); + } + jobjectRefType GetObjectRefType(jobject obj) { + return functions->GetObjectRefType(this, obj); + } + +#endif /* __cplusplus */ +}; + +typedef struct JavaVMOption { + char *optionString; + void *extraInfo; +} JavaVMOption; + +typedef struct JavaVMInitArgs { + jint version; + + jint nOptions; + JavaVMOption *options; + jboolean ignoreUnrecognized; +} JavaVMInitArgs; + +typedef struct JavaVMAttachArgs { + jint version; + + char *name; + jobject group; +} JavaVMAttachArgs; + +/* These will be VM-specific. */ + +#define JDK1_2 +#define JDK1_4 + +/* End VM-specific. */ + +struct JNIInvokeInterface_ { + void *reserved0; + void *reserved1; + void *reserved2; + + jint (JNICALL *DestroyJavaVM)(JavaVM *vm); + + jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args); + + jint (JNICALL *DetachCurrentThread)(JavaVM *vm); + + jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version); + + jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args); +}; + +struct JavaVM_ { + const struct JNIInvokeInterface_ *functions; +#ifdef __cplusplus + + jint DestroyJavaVM() { + return functions->DestroyJavaVM(this); + } + jint AttachCurrentThread(void **penv, void *args) { + return functions->AttachCurrentThread(this, penv, args); + } + jint DetachCurrentThread() { + return functions->DetachCurrentThread(this); + } + + jint GetEnv(void **penv, jint version) { + return functions->GetEnv(this, penv, version); + } + jint AttachCurrentThreadAsDaemon(void **penv, void *args) { + return functions->AttachCurrentThreadAsDaemon(this, penv, args); + } +#endif +}; + +#ifdef _JNI_IMPLEMENTATION_ +#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT +#else +#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT +#endif +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_GetDefaultJavaVMInitArgs(void *args); + +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args); + +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *); + +/* Defined by native libraries. */ +JNIEXPORT jint JNICALL +JNI_OnLoad(JavaVM *vm, void *reserved); + +JNIEXPORT void JNICALL +JNI_OnUnload(JavaVM *vm, void *reserved); + +#define JNI_VERSION_1_1 0x00010001 +#define JNI_VERSION_1_2 0x00010002 +#define JNI_VERSION_1_4 0x00010004 +#define JNI_VERSION_1_6 0x00010006 + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !_JAVASOFT_JNI_H_ */ diff --git a/src/ui-core/example/Plugin/jni_md.h b/src/ui-core/example/Plugin/win/jni_md.h similarity index 100% rename from src/ui-core/example/Plugin/jni_md.h rename to src/ui-core/example/Plugin/win/jni_md.h diff --git a/src/ui-core/example/Win32/TestApplication.cpp b/src/ui-core/example/Win32/TestApplication.cpp index 066c972..9bb998d 100644 --- a/src/ui-core/example/Win32/TestApplication.cpp +++ b/src/ui-core/example/Win32/TestApplication.cpp @@ -8,7 +8,7 @@ #include #include #include -//#include +#include #include @@ -70,25 +70,27 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) application.GetRootVisualElement()->SetShowState(true); application.GetRootVisualElement()->SetOpacity(1.0f); -// Tizen::Ui::Animations::Camera* __pCamera = new Tizen::Ui::Animations::Camera(); -// __pCamera->SetPerspective(60.0 ,0.01, 400); -// __pCamera->LookAt(Tizen::Graphics::FloatPoint3(0,0,50), Tizen::Graphics::FloatPoint3(0,0,0),Tizen::Graphics::FloatPoint3(0,1,0)); - + Tizen::Ui::Animations::Camera* __pCamera = new Tizen::Ui::Animations::Camera(); + __pCamera->SetPerspective(60.0 ,0.01, 400); + __pCamera->LookAt(Tizen::Graphics::FloatPoint3(0,0,50), Tizen::Graphics::FloatPoint3(0,0,0),Tizen::Graphics::FloatPoint3(0,1,0)); +// __pCamera->SetOrthogonal(1280, -1280); -// VisualElement* pCameraVE = new (std::nothrow) VisualElement(); -// pCameraVE->Construct(); -// pCameraVE->SetName(L"CameraVE"); -// pCameraVE->SetShowState(true); -// pCameraVE->SetImplicitAnimationEnabled(false); -// pCameraVE->SetChildrenTransformMatrix(__pCamera->GetMatrix()); -// application.GetRootVisualElement()->AttachChild(pCameraVE); + VisualElement* pCameraVE = new (std::nothrow) VisualElement(); + pCameraVE->Construct(); + pCameraVE->SetName(L"CameraVE"); + pCameraVE->SetShowState(true); + pCameraVE->SetImplicitAnimationEnabled(false); + pCameraVE->SetChildrenTransformMatrix(__pCamera->GetMatrix()); + application.GetRootVisualElement()->AttachChild(pCameraVE); VisualElement* pElement = new VisualElement(); pElement->Construct(); pElement->SetShowState(true); pElement->SetOpacity(1.0f); //pElement->SetBounds(FloatRectangle(1, 1, 0.f, 0.f)); - pElement->SetBounds(FloatRectangle(clientRect.width / 2, clientRect.height / 2, 100, 100)); +// pElement->SetBounds(FloatRectangle(clientRect.width / 2, clientRect.height / 2, 100, 100)); + pElement->SetBounds(FloatRectangle(0, 0, 100, 100)); + pElement->SetImplicitAnimationEnabled(false); // pCameraVE->AttachChild(pElement); // application.GetRootVisualElement()->AttachChild(pElement); @@ -110,7 +112,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) Mesh* pTriangleMesh = new (std::nothrow) Mesh(); pTriangleMesh->SetGeometryType(Mesh::GEO_TYPE_TRIANGLES); - FloatRectangle rect(0,0,500,500);// = pElement->GetBounds(); + FloatRectangle rect(-clientRect.width / 2, -clientRect.height / 2,500,500);// = pElement->GetBounds(); pTriangleMesh->ReserveVertices(4); pTriangleMesh->SetVertex(0, FloatPoint3(rect.x, rect.y, -100.)); pTriangleMesh->SetVertex(1, FloatPoint3(rect.x, rect.y + rect.height, -100.0)); @@ -155,8 +157,8 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) pTringleVE->SetImplicitAnimationEnabled(false); // pCameraVE->AttachChild(pElement); pTringleVE->AttachChild(pElement); - application.GetRootVisualElement()->AttachChild(pTringleVE); - + //application.GetRootVisualElement()->AttachChild(pTringleVE); + pCameraVE->AttachChild(pTringleVE); ShaderProgram* __pShader = new ShaderProgram(); Shader vert; @@ -173,15 +175,15 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) pTringleVE->SetShaderProgram(__pShader); - float scale = 1.f; - pElement->SetProperty(L"transform.scale.x", scale); - pElement->SetProperty(L"transform.scale.y", scale); - pElement->SetProperty(L"transform.scale.z", scale); + float scale = 1.1f; + pTringleVE->SetProperty(L"transform.scale.x", scale); + pTringleVE->SetProperty(L"transform.scale.y", scale); + pTringleVE->SetProperty(L"transform.scale.z", scale); - float x = 230; - float y = 100; - //pElement->SetProperty(L"transform.translation.x", x); -// pElement->SetProperty(L"transform.translation.y", y); +// float x = 100; +// float y = 300; +// pTringleVE->SetProperty(L"transform.translation.x", x); +// pTringleVE->SetProperty(L"transform.translation.y", y); // pElement->SetProperty(L"transform.scale.z", scale); printf("x=%f, y=%f\n", pElement->GetBounds().x, pElement->GetBounds().y); @@ -212,7 +214,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine WNDCLASSEX wc; HWND hwnd; MSG Msg; - wc.cbSize = sizeof(WNDCLASSEX); wc.style = 0; wc.lpfnWndProc = WndProc; diff --git a/src/ui-core/src/CMakeLists.txt b/src/ui-core/src/CMakeLists.txt index fdde5ef..cab5493 100644 --- a/src/ui-core/src/CMakeLists.txt +++ b/src/ui-core/src/CMakeLists.txt @@ -12,12 +12,19 @@ INCLUDE_DIRECTORIES( ${UIFW_DIRECTORY}/src/ui/inc ${UIFW_DIRECTORY}/src/ui/animations ${UIFW_DIRECTORY}/src/ui/animations/platform - ${UIFW_DIRECTORY}/src/ui/animations/math + ${UIFW_DIRECTORY}/src/ui/animations/math ${UIFW_DIRECTORY}/src/ui/animations/import-collada + ${UIFW_DIRECTORY}/../osp-appfw/inc ${RSA_DEV_DIRECTORY}/external/boost + # ${RSA_DEV_DIRECTORY}/external/icu/include + # ${RSA_DEV_DIRECTORY}/external/libxml2/src/include + ${UIFW_DIRECTORY}/src/ui-core/example/Plugin/ubuntu + ${UIFW_DIRECTORY}/src/ui-core/example/Plugin /usr/include/cairo /usr/include/pixman-1 /usr/include/libxml2 + /usr/include/glib-2.0/ + /usr/lib/i386-linux-gnu/glib-2.0/include/ ) ELSEIF(_WIN32) INCLUDE_DIRECTORIES( @@ -51,7 +58,9 @@ INCLUDE_DIRECTORIES( ${RSA_DEV_DIRECTORY}/external/libxml2/src/include ../inc/cairo ../inc/pixman-1 + ${UIFW_DIRECTORY}/src/ui-core/example/Plugin/win ${UIFW_DIRECTORY}/src/ui-core/example/Plugin + ) ENDIF(LINUX) @@ -78,7 +87,7 @@ SET(${this_target}_SOURCE_FILES base/FBaseDouble.cpp base/FBaseFloat.cpp base/FBase_StringConverter.cpp - base/utility/FBaseUtil_IcuConverter.cpp +# base/utility/FBaseUtil_IcuConverter.cpp base/runtime/FBaseRtIEventListener.cpp base/collection/FBaseColMapEntry.cpp base/collection/FBaseColQueue.cpp @@ -271,8 +280,8 @@ SET(${this_target}_SOURCE_FILES ${UIFW_DIRECTORY}/src/ui/animations/FUiAnim_SceneImpl.cpp ${UIFW_DIRECTORY}/src/ui/animations/FUiAnimScene.cpp ${UIFW_DIRECTORY}/src/ui/animations/FUiAnimMeshController.cpp -# ${UIFW_DIRECTORY}/src/ui/animations/FUiAnimCamera.cpp -# ${UIFW_DIRECTORY}/src/ui/animations/FUiAnim_CameraImpl.cpp + ${UIFW_DIRECTORY}/src/ui/animations/FUiAnimCamera.cpp + ${UIFW_DIRECTORY}/src/ui/animations/FUiAnim_CameraImpl.cpp ${UIFW_DIRECTORY}/src/ui/FUi_Matrix3Df.cpp ${UIFW_DIRECTORY}/src/ui/FUi_PropertyBase.cpp @@ -313,7 +322,9 @@ TARGET_LINK_LIBRARIES(${this_target} "-ldl" ) TARGET_LINK_LIBRARIES(${this_target} "-lEGL" ) TARGET_LINK_LIBRARIES(${this_target} "-lpixman-1" ) TARGET_LINK_LIBRARIES(${this_target} "-lcairo" ) -TARGET_LINK_LIBRARIES(${this_target} "-licuuc" ) +TARGET_LINK_LIBRARIES(${this_target} "-lxml2" ) +TARGET_LINK_LIBRARIES(${this_target} "-lglib-2.0" ) +#TARGET_LINK_LIBRARIES(${this_target} "-licuuc" ) ELSEIF(_WIN32) diff --git a/src/ui-core/src/UcApplication.cpp b/src/ui-core/src/UcApplication.cpp index 4a9fb7d..184e81b 100644 --- a/src/ui-core/src/UcApplication.cpp +++ b/src/ui-core/src/UcApplication.cpp @@ -1,4 +1,5 @@ #include + #include #include #include @@ -15,6 +16,7 @@ #include "FUiAnim_Win32Window.h" #endif + using namespace Tizen::Graphics; using namespace Tizen::Ui::Animations; @@ -63,6 +65,12 @@ Application::UpdateLayer(void) _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); if (pDisplayManager) { + _AnimationManager* pAnimManager = _AnimationManager::GetInstance(); + if (pAnimManager) + { + pAnimManager->ProcessAnimationTick(); + } + pDisplayManager->RenderAll(true); __pNativeLayer->Flush(); } @@ -103,7 +111,7 @@ Application::IterateMainLoop(void) if(pLooper->GetRawEvent(rawEvent, -1) != 0) { pLooper->DispatchRawEvent(rawEvent); - printf("OnMainLoop:event(%d) \n",rawEvent.type); +// printf("OnMainLoop:event(%d) \n",rawEvent.type); } #endif } diff --git a/src/ui-core/src/base/FBaseString.cpp b/src/ui-core/src/base/FBaseString.cpp index 524f6f4..9d5612e 100644 --- a/src/ui-core/src/base/FBaseString.cpp +++ b/src/ui-core/src/base/FBaseString.cpp @@ -531,9 +531,11 @@ String::Format(int length, const wchar_t* pFormat, ...) va_list args; va_start(args, pFormat); - +#ifdef LINUX + vswprintf(pStr.get(), length, tempStr.__pValue, args); +#else vswprintf(pStr.get(), tempStr.__pValue, args); - +#endif va_end(args); *this = pStr.get(); diff --git a/src/ui-core/src/base/FBaseSysLog.cpp b/src/ui-core/src/base/FBaseSysLog.cpp index 92d2a52..53126a8 100644 --- a/src/ui-core/src/base/FBaseSysLog.cpp +++ b/src/ui-core/src/base/FBaseSysLog.cpp @@ -13,7 +13,7 @@ void SysLogInternal(unsigned long id, const char* pFunction, int lineNumber, con va_list arg; va_start(arg, pFormat); vsprintf((char*)&buf, pFormat, arg); - sprintf((char*)&msg, "%i , %s, %i, %s", id, pFunction, lineNumber, &buf); + sprintf((char*)&msg, "%i , %s:%i, %s", id, pFunction, lineNumber, &buf); logMessage(msg); va_end(arg); @@ -27,7 +27,7 @@ void SysLogExceptionInternal(unsigned long id, result r, const char* pFunction, va_list arg; va_start(arg, pFormat); vsprintf((char*)&buf, pFormat, arg); - sprintf((char*)&msg, "%i , %s, %s, %i, %s", id, GetErrorMessage(r), pFunction, lineNumber, &buf); + sprintf((char*)&msg, "%i , %s, %s:%i, %s", id, GetErrorMessage(r), pFunction, lineNumber, &buf); logMessage(msg); va_end(arg); @@ -40,7 +40,7 @@ void SysLogTagInternal(unsigned long id, const char* pTag, const char* pFunction va_list arg; va_start(arg, pFormat); vsprintf((char*)&buf, pFormat, arg); - sprintf((char*)&msg, "%i , %s, %s, %i, %s", id, pTag, pFunction, lineNumber, &buf); + sprintf((char*)&msg, "%i , %s, %s:%i, %s", id, pTag, pFunction, lineNumber, &buf); logMessage(msg); va_end(arg); @@ -54,7 +54,7 @@ void SysLogExceptionTagInternal(unsigned long id, const char* pTag, result r, co va_list arg; va_start(arg, pFormat); vsprintf((char*)&buf, pFormat, arg); - sprintf((char*)&msg, "%i , %s, %s, %s, %i, %s", id, pTag, GetErrorMessage(r), pFunction, lineNumber, &buf); + sprintf((char*)&msg, "%i , %s, %s, %s:%i, %s", id, pTag, GetErrorMessage(r), pFunction, lineNumber, &buf); logMessage(msg); va_end(arg); @@ -62,7 +62,7 @@ void SysLogExceptionTagInternal(unsigned long id, const char* pTag, result r, co void SysAssertInternal(const char* pFileName, int lineNumber, const char* pFunction) { char msg[1024]; - sprintf((char*)&msg, "%s , %i, %s", pFileName, lineNumber, pFunction); + sprintf((char*)&msg, "%s:%i, %s", pFileName, lineNumber, pFunction); logMessage(msg); @@ -76,7 +76,7 @@ void SysAssertfInternal(const char* expr, const char* pFunction, int lineNumber, va_list arg; va_start(arg, pFormat); vsprintf((char*)&buf, pFormat, arg); - sprintf((char*)&msg, "%s, %s, %i, %s", expr, pFunction, lineNumber, &buf); + sprintf((char*)&msg, "%s, %s:%i, %s", expr, pFunction, lineNumber, &buf); logMessage(msg); va_end(arg); @@ -88,7 +88,7 @@ void SysPropagateInternal(const char* pFunction, int lineNumber, unsigned long n SetLastResult(r); char msg[1024]; - sprintf((char*)&msg, "%s, %i, %i, %s", pFunction, lineNumber, nid, GetErrorMessage(r)); + sprintf((char*)&msg, "%s:%i, %i, %s", pFunction, lineNumber, nid, GetErrorMessage(r)); logMessage(msg); } void SysTryReturnResultInternal(unsigned long id, result r, const char* pFunction, int lineNumber, const char* pFormat, ...) @@ -100,7 +100,7 @@ void SysTryReturnResultInternal(unsigned long id, result r, const char* pFunctio va_list arg; va_start(arg, pFormat); vsprintf((char*)&buf, pFormat, arg); - sprintf((char*)&msg, "%i , %s, %s, %i, %s", id, GetErrorMessage(r), pFunction, lineNumber, &buf); + sprintf((char*)&msg, "%i , %s, %s:%i, %s", id, GetErrorMessage(r), pFunction, lineNumber, &buf); logMessage(msg); va_end(arg);