1 /* 2 * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 #import <jni.h> 27 #import <pthread.h> 28 #import <QuartzCore/CVDisplayLink.h> 29 30 extern pthread_key_t GlassThreadDataKey; 31 32 extern CVDisplayLinkRef GlassDisplayLink; 33 34 extern JavaVM *jVM; 35 extern JNIEnv *jEnv; 36 37 extern jclass jApplicationClass; 38 extern jclass jWindowClass; 39 extern jclass jViewClass; 40 41 extern jclass jScreenClass; 42 extern jclass jMenuBarDelegateClass; 43 extern jclass jIntegerClass; 44 extern jclass jLongClass; 45 extern jclass jMapClass; 46 extern jclass jBooleanClass; 47 48 extern jmethodID jRunnableRun; 49 50 extern jmethodID jWindowNotifyMove; 51 extern jmethodID jWindowNotifyResize; 52 extern jmethodID jWindowNotifyClose; 53 extern jmethodID jWindowNotifyMoveToAnotherScreen; 54 extern jmethodID jWindowNotifyFocus; 55 extern jmethodID jWindowNotifyFocusUngrab; 56 extern jmethodID jWindowNotifyFocusDisabled; 57 extern jmethodID jWindowNotifyDestroy; 58 extern jmethodID jWindowNotifyDelegatePtr; 59 60 extern jmethodID jViewNotifyEvent; 61 extern jmethodID jViewNotifyRepaint; 62 extern jmethodID jViewNotifyResize; 63 extern jmethodID jViewNotifyKey; 64 extern jmethodID jViewNotifyMouse; 65 extern jmethodID jViewNotifyMenu; 66 extern jmethodID jViewNotifyInputMethod; 67 extern jmethodID jViewNotifyInputMethodMac; 68 extern jmethodID jViewNotifyInputMethodCandidatePosRequest; 69 extern jmethodID jViewNotifyDragEnter; 70 extern jmethodID jViewNotifyDragOver; 71 extern jmethodID jViewNotifyDragLeave; 72 extern jmethodID jViewNotifyDragDrop; 73 extern jmethodID jViewNotifyDragEnd; 74 extern jmethodID jViewGetAccessible; 75 76 extern jmethodID jScreenNotifySettingsChanged; 77 78 extern jmethodID jMapGetMethod; 79 extern jmethodID jBooleanValueMethod; 80 extern jmethodID jIntegerInitMethod; 81 extern jmethodID jIntegerValueMethod; 82 extern jmethodID jLongValueMethod; 83 84 extern jmethodID jSizeInit; 85 86 extern jmethodID jPixelsAttachData; 87 88 typedef struct _tagJavaIDs { 89 struct { 90 jmethodID init; 91 jmethodID enter; 92 jmethodID leave; 93 } EventLoop; 94 struct { 95 jmethodID add; 96 } List; 97 struct { 98 jmethodID init; 99 } ArrayList; 100 struct { 101 jmethodID init; 102 } MacFileNSURL; 103 struct { 104 jmethodID isFileNSURLEnabled; 105 } MacCommonDialogs; 106 struct { 107 jmethodID init; 108 } File; 109 struct { 110 jmethodID createPixels; 111 jmethodID getScaleFactor; 112 jmethodID reportException; 113 jmethodID enterNestedEventLoop; 114 jmethodID leaveNestedEventLoop; 115 } Application; 116 struct { 117 jmethodID notifyApplicationDidTerminate; 118 } MacApplication; 119 struct { 120 jmethodID rotateGesturePerformed; 121 jmethodID scrollGesturePerformed; 122 jmethodID swipeGesturePerformed; 123 jmethodID magnifyGesturePerformed; 124 jmethodID gestureFinished; 125 jmethodID notifyBeginTouchEvent; 126 jmethodID notifyNextTouchEvent; 127 jmethodID notifyEndTouchEvent; 128 } GestureSupport; 129 struct { 130 jmethodID getDescription; 131 jmethodID extensionsToArray; 132 } ExtensionFilter; 133 struct { 134 jmethodID init; 135 } FileChooserResult; 136 } JavaIDs; 137 extern JavaIDs javaIDs; 138 139 void initJavaIDsList(JNIEnv* env); 140 void initJavaIDsArrayList(JNIEnv* env); 141 void initJavaIDsFile(JNIEnv* env); 142 143