changeset 6139:fa856e37c8ef

7181710: [macosx] jawt_md.h shipped with jdk is outdated Reviewed-by: anthony, art
author ddehaven
date Fri, 07 Jun 2013 14:56:56 +0400
parents 99a0d93eb8cf
children 3b589265048d
files make/common/Defs.gmk make/sun/jawt/Makefile src/macosx/javavm/export/jawt_md.h src/macosx/javavm/export/jni_md.h src/macosx/javavm/export/jvm_md.h src/macosx/native/sun/awt/AWTSurfaceLayers.h src/macosx/native/sun/awt/CMenuComponent.h src/macosx/native/sun/awt/jawt.m src/macosx/native/sun/font/CoreTextSupport.h src/share/javavm/export/jawt.h
diffstat 10 files changed, 251 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/Defs.gmk	Fri Jun 07 12:28:53 2013 +0400
+++ b/make/common/Defs.gmk	Fri Jun 07 14:56:56 2013 +0400
@@ -431,7 +431,12 @@
 # namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific
 # relatives.
 #
-VPATH0.h =   $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
+ifeq ($(PLATFORM), macosx)
+  VPATH0.h =   $(PLATFORM_SRC_MACOS)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
+else
+  VPATH0.h =   $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
+endif
+
 ifdef OPENJDK
   VPATH.h = $(VPATH0.h)
 else
--- a/make/sun/jawt/Makefile	Fri Jun 07 12:28:53 2013 +0400
+++ b/make/sun/jawt/Makefile	Fri Jun 07 14:56:56 2013 +0400
@@ -30,6 +30,9 @@
 
 include $(BUILDDIR)/common/Defs.gmk
 
+# default to PLATFORM_SRC to copy export headers from
+PLATFORM_EXPORT_BASE = $(PLATFORM_SRC)
+
 #
 # Files
 #
@@ -37,6 +40,8 @@
 FILES_cpp = jawt.cpp
 else ifeq ($(PLATFORM), macosx) # PLATFORM
 FILES_objc = jawt.m
+# pick up the correct export headers for Mac OS X
+PLATFORM_EXPORT_BASE = $(PLATFORM_SRC_MACOS)
 else # PLATFORM
 FILES_c = jawt.c
 endif # PLATFORM
@@ -160,7 +165,7 @@
 #
 $(INCLUDEDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
 	$(install-file)
-$(PLATFORM_INCLUDE)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
+$(PLATFORM_INCLUDE)/%.h: $(PLATFORM_EXPORT_BASE)/javavm/export/%.h
 	$(install-file)
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/javavm/export/jawt_md.h	Fri Jun 07 14:56:56 2013 +0400
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 1999, 2013 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _JAVASOFT_JAWT_MD_H_
+#define _JAVASOFT_JAWT_MD_H_
+
+/*
+ * To use jawt_X11DrawingSurfaceInfo you must define XAWT before including this header
+ * file. You must also have the X11 headers installed on your system.
+ */
+#ifdef XAWT
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Intrinsic.h>
+#endif // XAWT
+
+#include "jawt.h"
+
+#ifdef __OBJC__
+#import <QuartzCore/CALayer.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Mac OS X specific declarations for AWT native interface.
+ * See notes in jawt.h for an example of use.
+ */
+
+/*
+ * When calling JAWT_GetAWT with a JAWT version less than 1.7, you must pass this
+ * flag or you will not be able to get a valid drawing surface and JAWT_GetAWT will
+ * return false. This is to maintain compatibility with applications that used the
+ * interface with Java 6 which had multiple rendering models. This flag is not necessary
+ * when JAWT version 1.7 or greater is used as this is the only supported rendering mode.
+ *
+ * Example:
+ *   JAWT awt;
+ *   awt.version = JAWT_VERSION_1_4 | JAWT_MACOSX_USE_CALAYER;
+ *   jboolean success = JAWT_GetAWT(env, &awt);
+ */
+#define JAWT_MACOSX_USE_CALAYER 0x80000000
+
+/*
+ * When the native Cocoa toolkit is in use, the pointer stored in
+ * JAWT_DrawingSurfaceInfo->platformInfo points to a NSObject that conforms to the
+ * JAWT_SurfaceLayers protocol. Setting the layer property of this object will cause the
+ * specified layer to be overlaid on the Components rectangle. If the window the
+ * Component belongs to has a CALayer attached to it, this layer will be accessible via
+ * the windowLayer property.
+ */
+#ifdef __OBJC__
+@protocol JAWT_SurfaceLayers
+@property (readwrite, retain) CALayer *layer;
+@property (readonly) CALayer *windowLayer;
+@end
+#endif
+
+#ifdef XAWT
+/*
+ * X11-specific declarations for AWT native interface.
+ * See notes in jawt.h for an example of use.
+ *
+ * WARNING: This interface is deprecated and will be removed in a future release.
+ */
+typedef struct jawt_X11DrawingSurfaceInfo {
+    Drawable drawable;
+    Display* display;
+    VisualID visualID;
+    Colormap colormapID;
+    int depth;
+    /*
+     * Since 1.4
+     * Returns a pixel value from a set of RGB values.
+     * This is useful for paletted color (256 color) modes.
+     */
+    int (JNICALL *GetAWTColor)(JAWT_DrawingSurface* ds,
+        int r, int g, int b);
+} JAWT_X11DrawingSurfaceInfo;
+#endif // XAWT
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_JAVASOFT_JAWT_MD_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/javavm/export/jni_md.h	Fri Jun 07 14:56:56 2013 +0400
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1996, 2000, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _JAVASOFT_JNI_MD_H_
+#define _JAVASOFT_JNI_MD_H_
+
+#define JNIEXPORT
+#define JNIIMPORT
+#define JNICALL
+
+typedef int jint;
+#ifdef _LP64 /* 64-bit */
+typedef long jlong;
+#else
+typedef long long jlong;
+#endif
+typedef signed char jbyte;
+
+#endif /* !_JAVASOFT_JNI_MD_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/javavm/export/jvm_md.h	Fri Jun 07 14:56:56 2013 +0400
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 1997, 2008, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _JAVASOFT_JVM_MD_H_
+#define _JAVASOFT_JVM_MD_H_
+
+/*
+ * This file is currently collecting Mac OS X specific dregs for the
+ * JNI conversion, which should be sorted out later.
+ */
+
+#include <dirent.h>             /* For DIR */
+#include <sys/param.h>          /* For MAXPATHLEN */
+#include <unistd.h>             /* For F_OK, R_OK, W_OK */
+#include <stddef.h>             /* For ptrdiff_t */
+#include <stdint.h>             /* For uintptr_t */
+
+#define JNI_ONLOAD_SYMBOLS   {"JNI_OnLoad"}
+#define JNI_ONUNLOAD_SYMBOLS {"JNI_OnUnload"}
+
+#define JNI_LIB_PREFIX "lib"
+#define JNI_LIB_SUFFIX ".dylib"
+#define VERSIONED_JNI_LIB_NAME(NAME, VERSION) JNI_LIB_PREFIX NAME "." VERSION JNI_LIB_SUFFIX
+#define JNI_LIB_NAME(NAME) JNI_LIB_PREFIX NAME JNI_LIB_SUFFIX
+
+#define JVM_MAXPATHLEN MAXPATHLEN
+
+#define JVM_R_OK    R_OK
+#define JVM_W_OK    W_OK
+#define JVM_X_OK    X_OK
+#define JVM_F_OK    F_OK
+
+/*
+ * File I/O
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/signal.h>
+
+/* O Flags */
+
+#define JVM_O_RDONLY     O_RDONLY
+#define JVM_O_WRONLY     O_WRONLY
+#define JVM_O_RDWR       O_RDWR
+#define JVM_O_O_APPEND   O_APPEND
+#define JVM_O_EXCL       O_EXCL
+#define JVM_O_CREAT      O_CREAT
+#define JVM_O_DELETE     0x10000
+
+/* Signals */
+
+#define JVM_SIGINT     SIGINT
+#define JVM_SIGTERM    SIGTERM
+
+
+#endif /* !_JAVASOFT_JVM_MD_H_ */
--- a/src/macosx/native/sun/awt/AWTSurfaceLayers.h	Fri Jun 07 12:28:53 2013 +0400
+++ b/src/macosx/native/sun/awt/AWTSurfaceLayers.h	Fri Jun 07 14:56:56 2013 +0400
@@ -23,8 +23,7 @@
  * questions.
  */
 
-// REMIND: import <jawt_md.h>
-#import <JavaVM/jawt_md.h>
+#import <jawt_md.h>
 
 /*
  * The CALayer-based rendering model returns an object conforming
--- a/src/macosx/native/sun/awt/CMenuComponent.h	Fri Jun 07 12:28:53 2013 +0400
+++ b/src/macosx/native/sun/awt/CMenuComponent.h	Fri Jun 07 14:56:56 2013 +0400
@@ -24,7 +24,7 @@
  */
 
 #import <AppKit/AppKit.h>
-#import <JavaVM/jni.h>
+#import <jni.h>
 
 @interface CMenuComponent : NSObject {
 
--- a/src/macosx/native/sun/awt/jawt.m	Fri Jun 07 12:28:53 2013 +0400
+++ b/src/macosx/native/sun/awt/jawt.m	Fri Jun 07 14:56:56 2013 +0400
@@ -24,9 +24,7 @@
  */
 
 #import <jawt.h>
-
-// REMIND: import <jawt_md.h>
-#import <JavaVM/jawt_md.h>
+#import <jawt_md.h>
 
 #import "awt_DrawingSurface.h"
 
--- a/src/macosx/native/sun/font/CoreTextSupport.h	Fri Jun 07 12:28:53 2013 +0400
+++ b/src/macosx/native/sun/font/CoreTextSupport.h	Fri Jun 07 14:56:56 2013 +0400
@@ -24,7 +24,7 @@
  */
 
 #import <Cocoa/Cocoa.h>
-#import <JavaVM/jni.h>
+#import <jni.h>
 #import <JavaRuntimeSupport/JavaRuntimeSupport.h>
 
 #include "AWTFont.h"
--- a/src/share/javavm/export/jawt.h	Fri Jun 07 12:28:53 2013 +0400
+++ b/src/share/javavm/export/jawt.h	Fri Jun 07 14:56:56 2013 +0400
@@ -154,7 +154,9 @@
     /*
      * Pointer to the platform-specific information.  This can be safely
      * cast to a JAWT_Win32DrawingSurfaceInfo on Windows or a
-     * JAWT_X11DrawingSurfaceInfo on Solaris.  See jawt_md.h for details.
+     * JAWT_X11DrawingSurfaceInfo on Solaris. On Mac OS X, when using the
+     * native Cocoa toolkit this is a pointer to a NSObject that conforms
+     * to the JAWT_SurfaceLayers protocol. See jawt_md.h for details.
      */
     void* platformInfo;
     /* Cached pointer to the underlying drawing surface */