Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/solaris/native/sun/awt/awt.h
32287 views
/*1* Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425/*26* Common AWT definitions27*/2829#ifndef _AWT_30#define _AWT_3132#include "jvm.h"33#include "jni_util.h"34#include "debug_util.h"3536#if defined(__ANDROID__) || (!defined(HEADLESS) && !defined(MACOSX))37#include <X11/Intrinsic.h>38#endif /* __ANDROID__ (!HEADLESS && !MACOSX) */394041/* The JVM instance: defined in awt_MToolkit.c */42extern JavaVM *jvm;4344extern jclass tkClass;45extern jmethodID awtLockMID;46extern jmethodID awtUnlockMID;47extern jmethodID awtWaitMID;48extern jmethodID awtNotifyMID;49extern jmethodID awtNotifyAllMID;50extern jboolean awtLockInited;5152/* Perform sanity and consistency checks on AWT locking */53#ifdef DEBUG54#define DEBUG_AWT_LOCK55#endif5657/*58* The following locking primitives should be defined59*60#define AWT_LOCK()61#define AWT_NOFLUSH_UNLOCK()62#define AWT_WAIT(tm)63#define AWT_NOTIFY()64#define AWT_NOTIFY_ALL()65*/6667/*68* Convenience macros based on AWT_NOFLUSH_UNLOCK69*/70extern void awt_output_flush();71#define AWT_UNLOCK() AWT_FLUSH_UNLOCK()72#define AWT_FLUSH_UNLOCK() do { \73awt_output_flush(); \74AWT_NOFLUSH_UNLOCK(); \75} while (0)7677#define AWT_UNLOCK_CHECK_EXCEPTION(env) \78do { \79AWT_UNLOCK(); \80JNU_CHECK_EXCEPTION(env); \81} while (0)8283#define AWT_LOCK_IMPL() \84(*env)->CallStaticVoidMethod(env, tkClass, awtLockMID)8586#define AWT_NOFLUSH_UNLOCK_IMPL() \87do { \88jthrowable pendingException; \89if ((pendingException = (*env)->ExceptionOccurred(env)) != NULL) { \90(*env)->ExceptionClear(env); \91} \92(*env)->CallStaticVoidMethod(env, tkClass, awtUnlockMID); \93if (pendingException) { \94if ((*env)->ExceptionCheck(env)) { \95(*env)->ExceptionDescribe(env); \96(*env)->ExceptionClear(env); \97} \98(*env)->Throw(env, pendingException); \99} \100} while (0)101#define AWT_WAIT_IMPL(tm) \102(*env)->CallStaticVoidMethod(env, tkClass, awtWaitMID, (jlong)(tm))103#define AWT_NOTIFY_IMPL() \104(*env)->CallStaticVoidMethod(env, tkClass, awtNotifyMID)105#define AWT_NOTIFY_ALL_IMPL() \106(*env)->CallStaticVoidMethod(env, tkClass, awtNotifyAllMID)107108/*109* Unfortunately AWT_LOCK debugging does not work with XAWT due to mixed110* Java/C use of AWT lock.111*/112#define AWT_LOCK() AWT_LOCK_IMPL()113#define AWT_NOFLUSH_UNLOCK() AWT_NOFLUSH_UNLOCK_IMPL()114#define AWT_WAIT(tm) AWT_WAIT_IMPL(tm)115#define AWT_NOTIFY() AWT_NOTIFY_IMPL()116#define AWT_NOTIFY_ALL() AWT_NOTIFY_ALL_IMPL()117118#if defined(__ANDROID__) || (!defined(HEADLESS) && !defined(MACOSX))119extern Display *awt_display; /* awt_GraphicsEnv.c */120extern Boolean awt_ModLockIsShiftLock; /* XToolkit.c */121#endif /* __ANDROID__ || (!HEADLESS && !MACOSX) */122123#endif /* ! _AWT_ */124125126