< prev index next >

src/java.desktop/windows/native/libawt/windows/awt_DrawingSurface.cpp

Print this page


   1 /*
   2  * Copyright (c) 1996, 2008, 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


 255 {
 256     TRY_NO_VERIFY;
 257 
 258     if (ds == NULL) {
 259         DTRACE_PRINTLN("Drawing Surface is NULL");
 260     }
 261     delete static_cast<JAWTDrawingSurface*>(ds);
 262 
 263     CATCH_BAD_ALLOC;
 264 }
 265 
 266 extern "C" JNIEXPORT void JNICALL DSLockAWT(JNIEnv* env)
 267 {
 268     // Do nothing on Windows
 269 }
 270 
 271 extern "C" JNIEXPORT void JNICALL DSUnlockAWT(JNIEnv* env)
 272 {
 273     // Do nothing on Windows
 274 }












































   1 /*
   2  * Copyright (c) 1996, 2016, 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


 255 {
 256     TRY_NO_VERIFY;
 257 
 258     if (ds == NULL) {
 259         DTRACE_PRINTLN("Drawing Surface is NULL");
 260     }
 261     delete static_cast<JAWTDrawingSurface*>(ds);
 262 
 263     CATCH_BAD_ALLOC;
 264 }
 265 
 266 extern "C" JNIEXPORT void JNICALL DSLockAWT(JNIEnv* env)
 267 {
 268     // Do nothing on Windows
 269 }
 270 
 271 extern "C" JNIEXPORT void JNICALL DSUnlockAWT(JNIEnv* env)
 272 {
 273     // Do nothing on Windows
 274 }
 275 
 276 // EmbeddedFrame support
 277 
 278 static char *const embeddedClassName = "sun/awt/windows/WEmbeddedFrame";
 279 
 280 JNIEXPORT jobject JNICALL awt_CreateEmbeddedFrame
 281 (JNIEnv* env, void* platformInfo)
 282 {
 283     static jmethodID mid = NULL;
 284     static jclass cls;
 285     if (mid == NULL) {
 286         cls = env->FindClass(embeddedClassName);
 287         CHECK_NULL_RETURN(cls, NULL);
 288         mid = env->GetMethodID(cls, "<init>", "(J)V");
 289         CHECK_NULL_RETURN(mid, NULL);
 290     }
 291     return env->NewObject(cls, mid, platformInfo);
 292 }
 293 
 294 JNIEXPORT void JNICALL awt_SetBounds
 295 (JNIEnv *env, jobject embeddedFrame, jint x, jint y, jint w, jint h)
 296 {
 297     static jmethodID mid = NULL;
 298     if (mid == NULL) {
 299         jclass cls = env->FindClass(embeddedClassName);
 300         CHECK_NULL(cls);
 301         mid = env->GetMethodID(cls, "setBoundsPrivate", "(IIII)V");
 302         CHECK_NULL(mid);
 303     }
 304     env->CallVoidMethod(embeddedFrame, mid, x, y, w, h);
 305 }
 306 
 307 JNIEXPORT void JNICALL awt_SynthesizeWindowActivation
 308 (JNIEnv *env, jobject embeddedFrame, jboolean doActivate)
 309 {
 310     static jmethodID mid = NULL;
 311     if (mid == NULL) {
 312         jclass cls = env->FindClass(embeddedClassName);
 313         CHECK_NULL(cls);
 314         mid = env->GetMethodID(cls, "synthesizeWindowActivation", "(Z)V");
 315         CHECK_NULL(mid);
 316     }
 317     env->CallVoidMethod(embeddedFrame, mid, doActivate);
 318 }
< prev index next >