6143N/A/*
6143N/A * Copyright (c) 1999, 2013 Oracle and/or its affiliates. All rights reserved.
6143N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6143N/A *
6143N/A * This code is free software; you can redistribute it and/or modify it
6143N/A * under the terms of the GNU General Public License version 2 only, as
6143N/A * published by the Free Software Foundation. Oracle designates this
6143N/A * particular file as subject to the "Classpath" exception as provided
6143N/A * by Oracle in the LICENSE file that accompanied this code.
6143N/A *
6143N/A * This code is distributed in the hope that it will be useful, but WITHOUT
6143N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6143N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6143N/A * version 2 for more details (a copy is included in the LICENSE file that
6143N/A * accompanied this code).
6143N/A *
6143N/A * You should have received a copy of the GNU General Public License version
6143N/A * 2 along with this work; if not, write to the Free Software Foundation,
6143N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6143N/A *
6143N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6143N/A * or visit www.oracle.com if you need additional information or have any
6143N/A * questions.
6143N/A */
6143N/A
6143N/A#ifndef _JAVASOFT_JAWT_MD_H_
6143N/A#define _JAVASOFT_JAWT_MD_H_
6143N/A
6143N/A/*
6143N/A * To use jawt_X11DrawingSurfaceInfo you must define XAWT before including this header
6143N/A * file. You must also have the X11 headers installed on your system.
6143N/A */
6143N/A#ifdef XAWT
6143N/A#include <X11/Xlib.h>
6143N/A#include <X11/Xutil.h>
6143N/A#include <X11/Intrinsic.h>
6143N/A#endif // XAWT
6143N/A
6143N/A#include "jawt.h"
6143N/A
6143N/A#ifdef __OBJC__
6143N/A#import <QuartzCore/CALayer.h>
6143N/A#endif
6143N/A
6143N/A#ifdef __cplusplus
6143N/Aextern "C" {
6143N/A#endif
6143N/A
6143N/A/*
6143N/A * Mac OS X specific declarations for AWT native interface.
6143N/A * See notes in jawt.h for an example of use.
6143N/A */
6143N/A
6143N/A/*
6143N/A * When calling JAWT_GetAWT with a JAWT version less than 1.7, you must pass this
6143N/A * flag or you will not be able to get a valid drawing surface and JAWT_GetAWT will
6143N/A * return false. This is to maintain compatibility with applications that used the
6143N/A * interface with Java 6 which had multiple rendering models. This flag is not necessary
6143N/A * when JAWT version 1.7 or greater is used as this is the only supported rendering mode.
6143N/A *
6143N/A * Example:
6143N/A * JAWT awt;
6143N/A * awt.version = JAWT_VERSION_1_4 | JAWT_MACOSX_USE_CALAYER;
6143N/A * jboolean success = JAWT_GetAWT(env, &awt);
6143N/A */
6143N/A#define JAWT_MACOSX_USE_CALAYER 0x80000000
6143N/A
6143N/A/*
6143N/A * When the native Cocoa toolkit is in use, the pointer stored in
6143N/A * JAWT_DrawingSurfaceInfo->platformInfo points to a NSObject that conforms to the
6143N/A * JAWT_SurfaceLayers protocol. Setting the layer property of this object will cause the
6143N/A * specified layer to be overlaid on the Components rectangle. If the window the
6143N/A * Component belongs to has a CALayer attached to it, this layer will be accessible via
6143N/A * the windowLayer property.
6143N/A */
6143N/A#ifdef __OBJC__
6143N/A@protocol JAWT_SurfaceLayers
6143N/A@property (readwrite, retain) CALayer *layer;
6143N/A@property (readonly) CALayer *windowLayer;
6143N/A@end
6143N/A#endif
6143N/A
6143N/A#ifdef XAWT
6143N/A/*
6143N/A * X11-specific declarations for AWT native interface.
6143N/A * See notes in jawt.h for an example of use.
6143N/A *
6143N/A * WARNING: This interface is deprecated and will be removed in a future release.
6143N/A */
6143N/Atypedef struct jawt_X11DrawingSurfaceInfo {
6143N/A Drawable drawable;
6143N/A Display* display;
6143N/A VisualID visualID;
6143N/A Colormap colormapID;
6143N/A int depth;
6143N/A /*
6143N/A * Since 1.4
6143N/A * Returns a pixel value from a set of RGB values.
6143N/A * This is useful for paletted color (256 color) modes.
6143N/A */
6143N/A int (JNICALL *GetAWTColor)(JAWT_DrawingSurface* ds,
6143N/A int r, int g, int b);
6143N/A} JAWT_X11DrawingSurfaceInfo;
6143N/A#endif // XAWT
6143N/A
6143N/A#ifdef __cplusplus
6143N/A}
6143N/A#endif
6143N/A
6143N/A#endif /* !_JAVASOFT_JAWT_MD_H_ */