--- old/src/java.desktop/windows/native/libawt/windows/awt_DrawingSurface.cpp 2016-08-02 17:19:31.000000000 +0300 +++ new/src/java.desktop/windows/native/libawt/windows/awt_DrawingSurface.cpp 2016-08-02 17:19:30.000000000 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -272,3 +272,47 @@ { // Do nothing on Windows } + +// EmbeddedFrame support + +static char *const embeddedClassName = "sun/awt/windows/WEmbeddedFrame"; + +JNIEXPORT jobject JNICALL awt_CreateEmbeddedFrame +(JNIEnv* env, void* platformInfo) +{ + static jmethodID mid = NULL; + static jclass cls; + if (mid == NULL) { + cls = env->FindClass(embeddedClassName); + CHECK_NULL_RETURN(cls, NULL); + mid = env->GetMethodID(cls, "", "(J)V"); + CHECK_NULL_RETURN(mid, NULL); + } + return env->NewObject(cls, mid, platformInfo); +} + +JNIEXPORT void JNICALL awt_SetBounds +(JNIEnv *env, jobject embeddedFrame, jint x, jint y, jint w, jint h) +{ + static jmethodID mid = NULL; + if (mid == NULL) { + jclass cls = env->FindClass(embeddedClassName); + CHECK_NULL(cls); + mid = env->GetMethodID(cls, "setBoundsPrivate", "(IIII)V"); + CHECK_NULL(mid); + } + env->CallVoidMethod(embeddedFrame, mid, x, y, w, h); +} + +JNIEXPORT void JNICALL awt_SynthesizeWindowActivation +(JNIEnv *env, jobject embeddedFrame, jboolean doActivate) +{ + static jmethodID mid = NULL; + if (mid == NULL) { + jclass cls = env->FindClass(embeddedClassName); + CHECK_NULL(cls); + mid = env->GetMethodID(cls, "synthesizeWindowActivation", "(Z)V"); + CHECK_NULL(mid); + } + env->CallVoidMethod(embeddedFrame, mid, doActivate); +}