src/java.desktop/macosx/native/libawt_lwawt/awt/awt_DrawingSurface.m
author sveerabhadra
Fri, 22 Dec 2017 11:00:06 +0530
changeset 48640 42ad9a781f51
parent 47216 71c04702a3d5
permissions -rw-r--r--
8190192: Double click on the title bar no longer repositions the window Reviewed-by: serb, prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     1
/*
40708
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
     2
 * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     4
 *
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    10
 *
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    15
 * accompanied this code).
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    16
 *
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    20
 *
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    23
 * questions.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    24
 */
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    25
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    26
#import <JavaNativeFoundation/JavaNativeFoundation.h>
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    27
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    28
#import "AWTSurfaceLayers.h"
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    29
40708
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
    30
#import "jni_util.h"
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
    31
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    32
JNIEXPORT JAWT_DrawingSurfaceInfo* JNICALL awt_DrawingSurface_GetDrawingSurfaceInfo
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    33
(JAWT_DrawingSurface* ds)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    34
{
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    35
    JAWT_DrawingSurfaceInfo* dsi = (JAWT_DrawingSurfaceInfo*)malloc(sizeof(JAWT_DrawingSurfaceInfo));
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    36
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    37
    JNIEnv *env = ds->env;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    38
    jobject target = ds->target;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    39
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    40
    static JNF_CLASS_CACHE(jc_Component, "java/awt/Component");
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    41
    static JNF_MEMBER_CACHE(jf_peer, jc_Component, "peer", "Ljava/awt/peer/ComponentPeer;");
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    42
    jobject peer = JNFGetObjectField(env, target, jf_peer);
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    43
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    44
    static JNF_CLASS_CACHE(jc_ComponentPeer, "sun/lwawt/LWComponentPeer");
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    45
    static JNF_MEMBER_CACHE(jf_platformComponent, jc_ComponentPeer,
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    46
                            "platformComponent", "Lsun/lwawt/PlatformComponent;");
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    47
    jobject platformComponent = JNFGetObjectField(env, peer, jf_platformComponent);
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    48
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    49
    static JNF_CLASS_CACHE(jc_PlatformComponent, "sun/lwawt/macosx/CPlatformComponent");
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    50
    static JNF_MEMBER_CACHE(jm_getPointer, jc_PlatformComponent, "getPointer", "()J");
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    51
    AWTSurfaceLayers *surfaceLayers = jlong_to_ptr(JNFCallLongMethod(env, platformComponent, jm_getPointer));
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    52
    // REMIND: assert(surfaceLayers)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    53
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    54
    dsi->platformInfo = surfaceLayers;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    55
    dsi->ds = ds;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    56
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    57
    static JNF_MEMBER_CACHE(jf_x, jc_Component, "x", "I");
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    58
    static JNF_MEMBER_CACHE(jf_y, jc_Component, "y", "I");
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    59
    static JNF_MEMBER_CACHE(jf_width, jc_Component, "width", "I");
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    60
    static JNF_MEMBER_CACHE(jf_height, jc_Component, "height", "I");
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    61
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    62
    dsi->bounds.x = JNFGetIntField(env, target, jf_x);
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    63
    dsi->bounds.y = JNFGetIntField(env, target, jf_y);
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    64
    dsi->bounds.width = JNFGetIntField(env, target, jf_width);
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    65
    dsi->bounds.height = JNFGetIntField(env, target, jf_height);
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    66
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    67
    dsi->clipSize = 1;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    68
    dsi->clip = &(dsi->bounds);
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    69
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    70
    return dsi;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    71
}
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    72
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    73
JNIEXPORT jint JNICALL awt_DrawingSurface_Lock
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    74
(JAWT_DrawingSurface* ds)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    75
{
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    76
    // TODO: implement
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    77
    return 0;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    78
}
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    79
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    80
JNIEXPORT void JNICALL awt_DrawingSurface_Unlock
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    81
(JAWT_DrawingSurface* ds)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    82
{
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    83
    // TODO: implement
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    84
}
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    85
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    86
JNIEXPORT void JNICALL awt_DrawingSurface_FreeDrawingSurfaceInfo
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    87
(JAWT_DrawingSurfaceInfo* dsi)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    88
{
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    89
    free(dsi);
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    90
}
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    91
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    92
JNIEXPORT JAWT_DrawingSurface* JNICALL awt_GetDrawingSurface
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    93
(JNIEnv* env, jobject target)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    94
{
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    95
    JAWT_DrawingSurface* ds = (JAWT_DrawingSurface*)malloc(sizeof(JAWT_DrawingSurface));
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    96
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    97
    // TODO: "target instanceof" check
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    98
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
    99
    ds->env = env;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   100
    ds->target = (*env)->NewGlobalRef(env, target);
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   101
    ds->Lock = awt_DrawingSurface_Lock;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   102
    ds->GetDrawingSurfaceInfo = awt_DrawingSurface_GetDrawingSurfaceInfo;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   103
    ds->FreeDrawingSurfaceInfo = awt_DrawingSurface_FreeDrawingSurfaceInfo;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   104
    ds->Unlock = awt_DrawingSurface_Unlock;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   105
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   106
    return ds;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   107
}
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   108
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   109
JNIEXPORT void JNICALL awt_FreeDrawingSurface
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   110
(JAWT_DrawingSurface* ds)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   111
{
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   112
    JNIEnv *env = ds->env;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   113
    (*env)->DeleteGlobalRef(env, ds->target);
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   114
    free(ds);
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   115
}
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   116
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   117
JNIEXPORT void JNICALL awt_Lock
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   118
(JNIEnv* env)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   119
{
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   120
    // TODO: implement
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   121
}
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   122
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   123
JNIEXPORT void JNICALL awt_Unlock
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   124
(JNIEnv* env)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   125
{
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   126
    // TODO: implement
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   127
}
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   128
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   129
JNIEXPORT jobject JNICALL awt_GetComponent
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   130
(JNIEnv* env, void* platformInfo)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   131
{
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   132
    // TODO: implement
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   133
    return NULL;
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
diff changeset
   134
}
40708
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   135
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   136
// EmbeddedFrame support
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   137
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   138
static char *const embeddedClassName = "sun/lwawt/macosx/CViewEmbeddedFrame";
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   139
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   140
JNIEXPORT jobject JNICALL awt_CreateEmbeddedFrame
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   141
(JNIEnv* env, void* platformInfo)
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   142
{
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   143
    static jmethodID mid = NULL;
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   144
    static jclass cls;
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   145
    if (mid == NULL) {
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   146
        cls = (*env)->FindClass(env, embeddedClassName);
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   147
        CHECK_NULL_RETURN(cls, NULL);
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   148
        mid = (*env)->GetMethodID(env, cls, "<init>", "(J)V");
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   149
        CHECK_NULL_RETURN(mid, NULL);
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   150
    }
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   151
    return (*env)->NewObject(env, cls, mid, platformInfo);
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   152
}
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   153
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   154
JNIEXPORT void JNICALL awt_SetBounds
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   155
(JNIEnv *env, jobject embeddedFrame, jint x, jint y, jint w, jint h)
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   156
{
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   157
    static jmethodID mid = NULL;
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   158
    if (mid == NULL) {
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   159
        jclass cls = (*env)->FindClass(env, embeddedClassName);
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   160
        CHECK_NULL(cls);
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   161
        mid = (*env)->GetMethodID(env, cls, "setBoundsPrivate", "(IIII)V");
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   162
        CHECK_NULL(mid);
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   163
    }
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   164
    (*env)->CallVoidMethod(env, embeddedFrame, mid, x, y, w, h);
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   165
}
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   166
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   167
JNIEXPORT void JNICALL awt_SynthesizeWindowActivation
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   168
(JNIEnv *env, jobject embeddedFrame, jboolean doActivate)
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   169
{
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   170
    static jmethodID mid = NULL;
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   171
    if (mid == NULL) {
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   172
        jclass cls = (*env)->FindClass(env, embeddedClassName);
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   173
        CHECK_NULL(cls);
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   174
        mid = (*env)->GetMethodID(env, cls, "synthesizeWindowActivation", "(Z)V");
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   175
        CHECK_NULL(mid);
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   176
    }
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   177
    (*env)->CallVoidMethod(env, embeddedFrame, mid, doActivate);
2516b180bfc0 8148109: [SWT] Provide a supported mechanism to use EmbeddedFrame
serb
parents: 26751
diff changeset
   178
}