Welcome to mirror list, hosted at ThFree Co, Russian Federation.

RenderActivity.cpp « maps « mapswithme « com « jni « android - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7c2738e17cbd710653550d283d336629a7b3c0e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "Framework.hpp"

#include "../core/jni_helper.hpp"

extern "C"
{

JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_RenderActivity_CreateEngine(JNIEnv * env, jobject thiz, jobject surface, jint destiny)
{
  return static_cast<jboolean>(g_framework->CreateDrapeEngine(env, surface, static_cast<int>(destiny)));
}

JNIEXPORT void JNICALL
Java_com_mapswithme_maps_RenderActivity_SurfaceResized(JNIEnv * env, jobject thiz, jint w, jint h)
{
  g_framework->Resize(static_cast<int>(w), static_cast<int>(h));
}

JNIEXPORT void JNICALL
Java_com_mapswithme_maps_RenderActivity_DestroyEngine(JNIEnv * env, jobject thiz)
{
  g_framework->DeleteDrapeEngine();
}

JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_RenderActivity_OnTouch(JNIEnv * env, jobject thiz, jint action, jboolean hasFirst, jboolean hasSecond,
                                                 jfloat x1, jfloat y1, jfloat x2, jfloat y2)
{
  int mask = 0;
  if (hasFirst == JNI_TRUE)
    mask |= 0x1;
  if (hasSecond == JNI_TRUE)
    mask |= 0x2;

  g_framework->Touch(static_cast<int>(action), mask,
                     static_cast<double>(x1),
                     static_cast<double>(y1),
                     static_cast<double>(x2),
                     static_cast<double>(y2));

  return JNI_TRUE;
}


}