Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/solaris/native/sun/awt/awt_p.h
32287 views
/*1* Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425/*26* Motif-specific data structures for AWT Java objects.27*28*/29#ifndef _AWT_P_H_30#define _AWT_P_H_3132/* turn on to do event filtering */33#define NEW_EVENT_MODEL34/* turn on to only filter keyboard events */35#define KEYBOARD_ONLY_EVENTS3637#include <stdarg.h>38#include <stdio.h>39#include <stdlib.h>40#include <string.h>41#include <unistd.h>42#ifndef HEADLESS_Z43#include <X11/Intrinsic.h>44#include <X11/IntrinsicP.h>45#include <X11/Shell.h>46#include <X11/StringDefs.h>47#include <X11/Xatom.h>48#include <X11/keysym.h>49#include <X11/keysymdef.h>50#include <X11/extensions/Xrender.h>51#endif /* !HEADLESS_Z */52#include "awt.h"53#include "awt_util.h"54#include "color.h"55#include "colordata.h"56#include "gdefs.h"5758#ifndef HEADLESS_Z59#ifndef min60#define min(a,b) ((a) <= (b)? (a):(b))61#endif62#ifndef max63#define max(a,b) ((a) >= (b)? (a):(b))64#endif65#endif // !HEADLESS_Z6667#define RepaintPending_NONE 068#define RepaintPending_REPAINT (1 << 0)69#define RepaintPending_EXPOSE (1 << 1)70#define LOOKUPSIZE 327172#ifndef HEADLESS_Z7374typedef XRenderPictFormat *75XRenderFindVisualFormatFunc (Display *dpy, _Xconst Visual *visual);7677typedef struct _AwtGraphicsConfigData {78int awt_depth;79Colormap awt_cmap;80XVisualInfo awt_visInfo;81int awt_num_colors;82awtImageData *awtImage;83int (*AwtColorMatch)(int, int, int,84struct _AwtGraphicsConfigData *);85XImage *monoImage;86Pixmap monoPixmap; /* Used in X11TextRenderer_md.c */87int monoPixmapWidth; /* Used in X11TextRenderer_md.c */88int monoPixmapHeight;/* Used in X11TextRenderer_md.c */89GC monoPixmapGC; /* Used in X11TextRenderer_md.c */90int pixelStride; /* Used in X11SurfaceData.c */91ColorData *color_data;92struct _GLXGraphicsConfigInfo *glxInfo;93int isTranslucencySupported; /* Uses Xrender to find this out. */94XRenderPictFormat renderPictFormat; /*Used only if translucency supported*/95} AwtGraphicsConfigData;9697typedef AwtGraphicsConfigData* AwtGraphicsConfigDataPtr;9899typedef struct _AwtScreenData {100int numConfigs;101Window root;102unsigned long whitepixel;103unsigned long blackpixel;104AwtGraphicsConfigDataPtr defaultConfig;105AwtGraphicsConfigDataPtr *configs;106} AwtScreenData;107108typedef AwtScreenData* AwtScreenDataPtr;109110#define W_GRAVITY_INITIALIZED 1111#define W_IS_EMBEDDED 2112113typedef struct awtFontList {114char *xlfd;115int index_length;116int load;117char *charset_name;118XFontStruct *xfont;119} awtFontList;120121struct FontData {122int charset_num;123awtFontList *flist;124XFontSet xfs; /* for TextField & TextArea */125XFontStruct *xfont; /* Latin1 font */126};127128extern struct FontData *awtJNI_GetFontData(JNIEnv *env,jobject font, char **errmsg);129130extern AwtGraphicsConfigDataPtr getDefaultConfig(int screen);131extern AwtScreenDataPtr getScreenData(int screen);132#endif /* !HEADLESS_Z */133134/* allocated and initialize a structure */135#define ZALLOC(T) ((struct T *)calloc(1, sizeof(struct T)))136137#ifndef HEADLESS_Z138#define XDISPLAY awt_display;139140extern int awt_allocate_colors(AwtGraphicsConfigDataPtr);141extern void awt_allocate_systemcolors(XColor *, int, AwtGraphicsConfigDataPtr);142extern void awt_allocate_systemrgbcolors(jint *, int, AwtGraphicsConfigDataPtr);143144extern int awtJNI_GetColor(JNIEnv *, jobject);145extern int awtJNI_GetColorForVis (JNIEnv *, jobject, AwtGraphicsConfigDataPtr);146extern jobject awtJNI_GetColorModel(JNIEnv *, AwtGraphicsConfigDataPtr);147extern void awtJNI_CreateColorData (JNIEnv *, AwtGraphicsConfigDataPtr, int lock);148149#endif /* !HEADLESS_Z */150#endif /* _AWT_P_H_ */151152153