public class KanziNativeLibrary
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CURSOR_STATE_DOWN |
static int |
CURSOR_STATE_MOVE |
static int |
CURSOR_STATE_STATIONARY |
static int |
CURSOR_STATE_UP |
static int |
KEY_STATE_DOWN |
static int |
KEY_STATE_REPEAT |
static int |
KEY_STATE_UP |
static int |
SCREEN_ORIENTATION_LANDSCAPE |
static int |
SCREEN_ORIENTATION_PORTRAIT |
static int |
TOUCH_STATE_BEGIN |
static int |
TOUCH_STATE_CONTINUE |
static int |
TOUCH_STATE_END |
| Constructor and Description |
|---|
KanziNativeLibrary() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
applicationExists()
Checks if the native Kanzi application already exists.
|
static void |
createApplication()
Creates and initializes native Kanzi application.
|
static void |
destroyApplication()
Destroys the running native Kanzi application.
|
static void |
focusEvent(boolean focusState)
Updates the focus state of the output View to the native Kanzi application.
|
static void |
haltApplication()
Halts the running native Kanzi application.
|
static void |
keyEvent(int buttonCode,
int keyState,
int modifiers)
Passes a key event to the native Kanzi application.
|
static void |
orientateEvent(int orientation)
Updates the new orientation of the output surface to the native Kanzi application.
|
static void |
resizeEvent(int width,
int height)
After resize, updates the new dimensions of the output surface to the native Kanzi application.
|
static void |
runApplication(java.lang.Object surface)
Starts running the native Kanzi application.
|
static int |
submitTask(java.lang.Object runnable)
Submits a runnable task to Kanzi task dispatcher.
|
static long |
touchEventBegin(int cursorCount,
int touchState)
Begins a set of touch events in the native Kanzi application.
|
static void |
touchEventEnd()
Ends the active set of touch events in the native Kanzi application.
|
static void |
touchEventSetCursor(long touchEvent,
int index,
int id,
float x,
float y,
float pressure,
float area,
int cursorState)
Adds a touch event cursor to the set of touches in the native Kanzi application.
|
static void |
updateContextReference(java.lang.Object context)
Updates the native side references to current Context.
|
static void |
updateViewReference(java.lang.Object kanziView)
Updates the native side references to the Kanzi UI view.
|
public static final int SCREEN_ORIENTATION_LANDSCAPE
public static final int SCREEN_ORIENTATION_PORTRAIT
public static final int TOUCH_STATE_BEGIN
public static final int TOUCH_STATE_CONTINUE
public static final int TOUCH_STATE_END
public static final int CURSOR_STATE_DOWN
public static final int CURSOR_STATE_STATIONARY
public static final int CURSOR_STATE_MOVE
public static final int CURSOR_STATE_UP
public static final int KEY_STATE_DOWN
public static final int KEY_STATE_UP
public static final int KEY_STATE_REPEAT
public static void createApplication()
throws java.lang.IllegalThreadStateException
java.lang.IllegalThreadStateException - if native application already exists.public static boolean applicationExists()
public static void destroyApplication()
public static void runApplication(java.lang.Object surface)
throws java.lang.IllegalThreadStateException
surface - A render surface from KanziView.java.lang.IllegalThreadStateException - if native application is not created or is already running.public static void haltApplication()
public static void resizeEvent(int width,
int height)
KanziView calls this method internally.width - Width of the output surface in pixels.height - Height of the output surface in pixels.public static void orientateEvent(int orientation)
KanziView calls this method internally.orientation - SCREEN_ORIENTATION_LANDSCAPE or
SCREEN_ORIENTATION_PORTRAIT.public static void keyEvent(int buttonCode,
int keyState,
int modifiers)
KanziView calls this method internally.buttonCode - A key code that represents the button pressed from
android.view.KeyEvent.keyState - KEY_STATE_DOWN, KEY_STATE_UP
or KEY_STATE_REPEAT.modifiers - Modifier key states from android.view.KeyEvent#getMetaState().public static void focusEvent(boolean focusState)
KanziView calls this method internally.focusState - If KanziView has focus, true, otherwise false.public static long touchEventBegin(int cursorCount,
int touchState)
touchEventEnd().
KanziView calls this method internally.cursorCount - The number of cursors to allocate.touchState - TOUCH_STATE_BEGIN,
TOUCH_STATE_CONTINUE or
TOUCH_STATE_END.public static void touchEventSetCursor(long touchEvent,
int index,
int id,
float x,
float y,
float pressure,
float area,
int cursorState)
KanziView calls this method internally.touchEvent - A pointer to the currently active set of touches.index - Cursor index in touchEvent.id - Cursor ID from android.view.MotionEvent#getPointerId(int).x - X coordinate of the cursor from android.view.MotionEvent#getX().y - Y coordinate of the cursor from android.view.MotionEvent#getY().pressure - Pressure of the cursor from android.view.MotionEvent#getPressure().area - Area of the cursor from @link android.view.MotionEvent#getSize()}.cursorState - CURSOR_STATE_DOWN,
CURSOR_STATE_STATIONARY,
CURSOR_STATE_MOVE or
CURSOR_STATE_UP.public static void touchEventEnd()
KanziView calls this method internally.public static void updateViewReference(java.lang.Object kanziView)
kanziView - Reference to output.public static void updateContextReference(java.lang.Object context)
context - Reference to context.public static int submitTask(java.lang.Object runnable)
runnable - The task to be run.(c) Rightware. All rights reserved.