src/java.desktop/macosx/native/include/jawt_md.h
author ccheung
Mon, 01 Oct 2018 11:36:48 -0700
changeset 51975 94b9b7a09001
parent 47216 71c04702a3d5
permissions -rw-r--r--
8211278: Update ProblemList Reviewed-by: iklam
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21129
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
     1
/*
30936
1a5cd4009d37 8080343: Incorrect GPL header causes RE script to miss swap to commercial header for licensee source bundle
ddehaven
parents: 25859
diff changeset
     2
 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
21129
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
     4
 *
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    10
 *
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    15
 * accompanied this code).
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    16
 *
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    20
 *
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    23
 * questions.
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    24
 */
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    25
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    26
#ifndef _JAVASOFT_JAWT_MD_H_
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    27
#define _JAVASOFT_JAWT_MD_H_
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    28
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    29
#include "jawt.h"
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    30
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    31
#ifdef __OBJC__
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    32
#import <QuartzCore/CALayer.h>
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    33
#endif
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    34
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    35
#ifdef __cplusplus
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    36
extern "C" {
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    37
#endif
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    38
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    39
/*
45017
7bd7767129ed 8179365: JAWT (AWT Native Interface) specification needs to be updated for JDK 9
prr
parents: 30936
diff changeset
    40
 * MacOS specific declarations for AWT native interface.
21129
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    41
 * See notes in jawt.h for an example of use.
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    42
 */
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    43
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    44
/*
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    45
 * When calling JAWT_GetAWT with a JAWT version less than 1.7, you must pass this
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    46
 * flag or you will not be able to get a valid drawing surface and JAWT_GetAWT will
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    47
 * return false. This is to maintain compatibility with applications that used the
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    48
 * interface with Java 6 which had multiple rendering models. This flag is not necessary
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    49
 * when JAWT version 1.7 or greater is used as this is the only supported rendering mode.
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    50
 *
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    51
 * Example:
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    52
 *   JAWT awt;
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    53
 *   awt.version = JAWT_VERSION_1_4 | JAWT_MACOSX_USE_CALAYER;
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    54
 *   jboolean success = JAWT_GetAWT(env, &awt);
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    55
 */
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    56
#define JAWT_MACOSX_USE_CALAYER 0x80000000
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    57
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    58
/*
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    59
 * When the native Cocoa toolkit is in use, the pointer stored in
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    60
 * JAWT_DrawingSurfaceInfo->platformInfo points to a NSObject that conforms to the
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    61
 * JAWT_SurfaceLayers protocol. Setting the layer property of this object will cause the
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    62
 * specified layer to be overlaid on the Components rectangle. If the window the
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    63
 * Component belongs to has a CALayer attached to it, this layer will be accessible via
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    64
 * the windowLayer property.
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    65
 */
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    66
#ifdef __OBJC__
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    67
@protocol JAWT_SurfaceLayers
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    68
@property (readwrite, retain) CALayer *layer;
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    69
@property (readonly) CALayer *windowLayer;
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    70
@end
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    71
#endif
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    72
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    73
#ifdef __cplusplus
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    74
}
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    75
#endif
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    76
e1f4474a6723 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents:
diff changeset
    77
#endif /* !_JAVASOFT_JAWT_MD_H_ */