1 /*
2 * Copyright (c) 1996, 2018, 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
2448 reasonLock = GetStaticObject(env, reasonClassLocal, "LOCK",
2449 "Ljava/awt/desktop/UserSessionEvent$Reason;");
2450 CHECK_NULL (reasonLock);
2451 reasonLock = env->NewGlobalRef(reasonLock);
2452
2453
2454 AwtToolkit::userSessionMID =
2455 env->GetStaticMethodID(dPeerClassLocal, "userSessionCallback",
2456 "(ZLjava/awt/desktop/UserSessionEvent$Reason;)V");
2457 DASSERT(AwtToolkit::userSessionMID != 0);
2458 CHECK_NULL(AwtToolkit::userSessionMID);
2459
2460 AwtToolkit::systemSleepMID =
2461 env->GetStaticMethodID(dPeerClassLocal, "systemSleepCallback", "(Z)V");
2462 DASSERT(AwtToolkit::systemSleepMID != 0);
2463 CHECK_NULL(AwtToolkit::systemSleepMID);
2464
2465 CATCH_BAD_ALLOC;
2466 }
2467
2468
2469 /*
2470 * Class: sun_awt_windows_Toolkit
2471 * Method: disableCustomPalette
2472 * Signature: ()V
2473 */
2474 JNIEXPORT void JNICALL
2475 Java_sun_awt_windows_WToolkit_disableCustomPalette(JNIEnv *env, jclass cls) {
2476 AwtPalette::DisableCustomPalette();
2477 }
2478
2479 /*
2480 * Class: sun_awt_windows_WToolkit
2481 * Method: embeddedInit
2482 * Signature: ()Z
2483 */
2484 JNIEXPORT jboolean JNICALL
2485 Java_sun_awt_windows_WToolkit_embeddedInit(JNIEnv *env, jclass cls)
2486 {
2487 TRY;
2488
2489 AwtToolkit::SetEnv(env);
2490
2491 return AwtToolkit::GetInstance().Initialize(FALSE);
2492
2493 CATCH_BAD_ALLOC_RET(JNI_FALSE);
2494 }
2495
2496 /*
2497 * Class: sun_awt_windows_WToolkit
2498 * Method: embeddedDispose
|
1 /*
2 * Copyright (c) 1996, 2020, 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
2448 reasonLock = GetStaticObject(env, reasonClassLocal, "LOCK",
2449 "Ljava/awt/desktop/UserSessionEvent$Reason;");
2450 CHECK_NULL (reasonLock);
2451 reasonLock = env->NewGlobalRef(reasonLock);
2452
2453
2454 AwtToolkit::userSessionMID =
2455 env->GetStaticMethodID(dPeerClassLocal, "userSessionCallback",
2456 "(ZLjava/awt/desktop/UserSessionEvent$Reason;)V");
2457 DASSERT(AwtToolkit::userSessionMID != 0);
2458 CHECK_NULL(AwtToolkit::userSessionMID);
2459
2460 AwtToolkit::systemSleepMID =
2461 env->GetStaticMethodID(dPeerClassLocal, "systemSleepCallback", "(Z)V");
2462 DASSERT(AwtToolkit::systemSleepMID != 0);
2463 CHECK_NULL(AwtToolkit::systemSleepMID);
2464
2465 CATCH_BAD_ALLOC;
2466 }
2467
2468 /*
2469 * Class: sun_awt_windows_WToolkit
2470 * Method: embeddedInit
2471 * Signature: ()Z
2472 */
2473 JNIEXPORT jboolean JNICALL
2474 Java_sun_awt_windows_WToolkit_embeddedInit(JNIEnv *env, jclass cls)
2475 {
2476 TRY;
2477
2478 AwtToolkit::SetEnv(env);
2479
2480 return AwtToolkit::GetInstance().Initialize(FALSE);
2481
2482 CATCH_BAD_ALLOC_RET(JNI_FALSE);
2483 }
2484
2485 /*
2486 * Class: sun_awt_windows_WToolkit
2487 * Method: embeddedDispose
|