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 <dlfcn.h> 27 #import <pthread.h> 28 #import <objc/runtime.h> 29 #import <Cocoa/Cocoa.h> 30 #import <Security/AuthSession.h> 31 #import <JavaNativeFoundation/JavaNativeFoundation.h> 32 #import <JavaRuntimeSupport/JavaRuntimeSupport.h> 33 34 #include "jni_util.h" 35 #import "CMenuBar.h" 36 #import "InitIDs.h" 37 #import "LWCToolkit.h" 38 #import "ThreadUtilities.h" 39 #import "AWT_debug.h" 40 #import "CSystemColors.h" 41 #import "NSApplicationAWT.h" 42 #import "PropertiesUtilities.h" 43 #import "ApplicationDelegate.h" 44 45 #import "sun_lwawt_macosx_LWCToolkit.h" 46 47 #import "sizecalc.h" 48 49 int gNumberOfButtons; 50 jint* gButtonDownMasks; 51 52 // Indicates that the app has been started with -XstartOnFirstThread 53 // (directly or via WebStart settings), and AWT should not run its 54 // own event loop in this mode. Even if a loop isn't running yet, 55 // we expect an embedder (e.g. SWT) to start it some time later. 56 static BOOL forceEmbeddedMode = NO; 57 58 // Indicates if awt toolkit is embedded into another UI toolkit 59 static BOOL isEmbedded = NO; 60 61 // This is the data necessary to have JNI_OnLoad wait for AppKit to start. 62 static BOOL sAppKitStarted = NO; 63 static pthread_mutex_t sAppKitStarted_mutex = PTHREAD_MUTEX_INITIALIZER; 64 static pthread_cond_t sAppKitStarted_cv = PTHREAD_COND_INITIALIZER; 65 66 @implementation AWTToolkit 67 68 static long eventCount; | 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 <dlfcn.h> 27 #import <pthread.h> 28 #import <objc/runtime.h> 29 #import <Cocoa/Cocoa.h> 30 #import <Security/AuthSession.h> 31 32 #include "jni_util.h" 33 #import "LWCToolkit.h" 34 #import "ThreadUtilities.h" 35 #import "CSystemColors.h" 36 #import "NSApplicationAWT.h" 37 #import "PropertiesUtilities.h" 38 #import "ApplicationDelegate.h" 39 40 #import "sun_lwawt_macosx_LWCToolkit.h" 41 42 #import "sizecalc.h" 43 44 #import <JavaRuntimeSupport/JavaRuntimeSupport.h> 45 46 int gNumberOfButtons; 47 jint* gButtonDownMasks; 48 49 // Indicates that the app has been started with -XstartOnFirstThread 50 // (directly or via WebStart settings), and AWT should not run its 51 // own event loop in this mode. Even if a loop isn't running yet, 52 // we expect an embedder (e.g. SWT) to start it some time later. 53 static BOOL forceEmbeddedMode = NO; 54 55 // Indicates if awt toolkit is embedded into another UI toolkit 56 static BOOL isEmbedded = NO; 57 58 // This is the data necessary to have JNI_OnLoad wait for AppKit to start. 59 static BOOL sAppKitStarted = NO; 60 static pthread_mutex_t sAppKitStarted_mutex = PTHREAD_MUTEX_INITIALIZER; 61 static pthread_cond_t sAppKitStarted_cv = PTHREAD_COND_INITIALIZER; 62 63 @implementation AWTToolkit 64 65 static long eventCount; |