/*
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 */

#import <jni.h>
#import <pthread.h>

pthread_key_t GlassThreadDataKey = 0;

JavaVM *jVM = NULL;
JNIEnv *jEnv = NULL;

jclass jWindowClass = NULL;
jclass jViewClass = NULL;
jclass jGestureSupportClass = NULL;

jclass jScreenClass = NULL;
jclass jMenuBarDelegateClass = NULL;
jclass jIntegerClass = NULL;
jclass jMapClass = NULL;
jclass jBooleanClass = NULL;

jmethodID jRunnableRun = NULL;

jmethodID jWindowNotifyMove = NULL;
jmethodID jWindowNotifyResize = NULL;
jmethodID jWindowNotifyClose = NULL;
jmethodID jWindowNotifyMoveToAnotherScreen = NULL;
jmethodID jWindowNotifyFocus = NULL;
jmethodID jWindowNotifyFocusUngrab = NULL;
jmethodID jWindowNotifyFocusDisabled = NULL;
jmethodID jWindowNotifyDestroy = NULL;
jmethodID jWindowNotifyDelegatePtr = NULL;

jmethodID jHandleViewEvent = NULL;
jmethodID jViewNotifyRepaint = NULL;
jmethodID jViewNotifyResize = NULL;
jmethodID jViewNotifyKey = NULL;
jmethodID jViewNotifyMouse = NULL;
jmethodID jViewNotifyMenu = NULL;
jmethodID jViewNotifyScroll = NULL;
jmethodID jViewNotifyInputMethod = NULL;
jmethodID jViewNotifyDragEnter = NULL;
jmethodID jViewNotifyDragOver = NULL;
jmethodID jViewNotifyDragLeave  = NULL;
jmethodID jViewNotifyDragDrop = NULL;
jmethodID jViewNotifyDragEnd = NULL;

jmethodID jGestureSupportRotateGesturePerformed = NULL;
jmethodID jGestureSupportScrollGesturePerformed = NULL;
jmethodID jGestureSupportSwipeGesturePerformed = NULL;
jmethodID jGestureSupportMagnifyGesturePerformed = NULL;
jmethodID jGestureSupportGestureFinished = NULL;
jmethodID jGestureSupportNotifyBeginTouchEvent = NULL;
jmethodID jGestureSupportNotifyNextTouchEvent = NULL;
jmethodID jGestureSupportNotifyEndTouchEvent = NULL;

jmethodID jMapGetMethod = NULL;
jmethodID jBooleanValueMethod = NULL;
jmethodID jIntegerValueMethod = NULL;
jmethodID jListAddMethod = NULL;

jmethodID jSizeInit = NULL;

jmethodID jPixelsAttachData = NULL;
