/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#import <dlfcn.h>
#include "jni_util.h"
#import "CMenuBar.h"
#import "InitIDs.h"
#import "LWCToolkit.h"
#import "ThreadUtilities.h"
#import "AWT_debug.h"
#import "CSystemColors.h"
#import "NSApplicationAWT.h"
#import "sun_lwawt_macosx_LWCToolkit.h"
#import "sizecalc.h"
int gNumberOfButtons;
static long eventCount;
+ (long) getEventCount{
return eventCount;
}
+ (void) eventCountPlusPlus{
eventCount++;
}
@end
@interface AWTRunLoopObject : NSObject {
}
@end
}
return self;
}
- (BOOL) shouldEndRunLoop {
return _shouldEndRunLoop;
}
- (void) endRunLoop {
}
@end
/*
* Class: sun_lwawt_macosx_LWCToolkit
* Method: nativeSyncQueue
* Signature: (J)Z
*/
{
} else {
// could happen if we are embedded inside SWT application,
// in this case just spin a single empty block through
// the event loop to give it a chance to process pending events
}
return JNI_TRUE;
}
return JNI_FALSE;
}
static JNF_MEMBER_CACHE(jf_Component_appContext, jc_Component, "appContext", "Lsun/awt/AppContext;");
static JNF_MEMBER_CACHE(jf_MenuComponent_appContext, jc_MenuComponent, "appContext", "Lsun/awt/AppContext;");
/*
* Class: sun_awt_SunToolkit
* Method: getAppContext
*/
{
}
return appContext;
}
/*
* Class: sun_awt_SunToolkit
* Method: setAppContext
*/
{
}
return isComponent;
}
/*
* Class: sun_lwawt_macosx_LWCToolkit
* Method: beep
* Signature: ()V
*/
{
NSBeep(); // produces both sound and visual flash, if configured in System Preferences
}
/*
* Class: sun_lwawt_macosx_LWCToolkit
* Method: initIDs
* Signature: ()V
*/
// set thread names
dispatch_async(dispatch_get_main_queue(), ^(void){
static JNF_STATIC_MEMBER_CACHE(jsm_installToolkitThreadNameInJava, jc_LWCToolkit, "installToolkitThreadNameInJava", "()V");
});
jmethodID getButtonDownMasksID = (*env)->GetStaticMethodID(env, inputEventClazz, "getButtonDownMasks", "()[I");
jintArray obj = (jintArray)(*env)->CallStaticObjectMethod(env, inputEventClazz, getButtonDownMasksID);
if (gButtonDownMasks == NULL) {
gNumberOfButtons = 0;
return;
}
int i;
for (i = 0; i < gNumberOfButtons; i++) {
gButtonDownMasks[i] = tmp[i];
}
}
if (c == nil)
{
return -1; // opaque white
}
CGFloat r, g, b, a;
// NSLog(@"%@ %d, %d, %d", c, ir, ig, ib);
}
NSUInteger i;
for (i = 0; i < len; i++) {
}
}];
}
/**
* Class: sun_lwawt_macosx_LWCToolkit
* Method: loadNativeColors
* Signature: ([I[I)V
*/
{
}
/*
* Class: sun_lwawt_macosx_LWCToolkit
* Method: createAWTRunLoopMediator
* Signature: ()J
*/
{
AWTRunLoopObject *o = nil;
// We double retain because this object is owned by both main thread and "other" thread
// We release in both doAWTRunLoop and stopAWTRunLoop
if (o) {
CFRetain(o); // GC
CFRetain(o); // GC
[o release];
}
return ptr_to_jlong(o);
}
/*
* Class: sun_lwawt_macosx_LWCToolkit
* Method: doAWTRunLoop
* Signature: (JZZ)V
*/
{
if (mediatorObject == nil) return;
// Don't use acceptInputForMode because that doesn't setup autorelease pools properly
if (processEvents) {
//We do not spin a runloop here as date is nil, so does not matter which mode to use
}
}
}
}
/*
* Class: sun_lwawt_macosx_LWCToolkit
* Method: stopAWTRunLoop
* Signature: (J)V
*/
{
[ThreadUtilities performOnMainThread:@selector(endRunLoop) on:mediatorObject withObject:nil waitUntilDone:NO];
}
/*
* Class: sun_lwawt_macosx_LWCToolkit
* Method: isCapsLockOn
* Signature: ()Z
*/
{
}];
return isOn;
}
/*
* Class: sun_lwawt_macosx_LWCToolkit
* Method: isApplicationActive
* Signature: ()Z
*/
{
}];
return active;
}
/*
* Class: sun_awt_SunToolkit
* Method: closeSplashScreen
* Signature: ()V
*/
{
if (!hSplashLib) return;
if (splashClose) {
splashClose();
}
}
// TODO: definitely doesn't belong here (copied from fontpath.c in the
// solaris tree)...
{
}
// This isn't yet used on unix, the implementation is added since shared
// code calls this method in preparation for future use.
(JNIEnv *env, jclass obj, jobject fontToFileMap, jobject fontToFamilyMap, jobject familyToFontListMap, jobject locale)
{
}