Path: blob/master/src/java.desktop/unix/native/common/awt/awt_p.h
41153 views
/*1* Copyright (c) 1995, 2020, 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#include <stdarg.h>33#include <stdio.h>34#include <stdlib.h>35#include <string.h>36#include <unistd.h>37#ifndef HEADLESS38#include <X11/extensions/Xrender.h>39#endif /* !HEADLESS */40#include "awt.h"41#include "awt_util.h"42#include "color.h"43#include "colordata.h"44#include "gdefs.h"4546#ifndef HEADLESS47#ifndef min48#define min(a,b) ((a) <= (b)? (a):(b))49#endif50#ifndef max51#define max(a,b) ((a) >= (b)? (a):(b))52#endif53#endif /* !HEADLESS */5455#define LOOKUPSIZE 325657#ifndef HEADLESS5859typedef XRenderPictFormat *60XRenderFindVisualFormatFunc (Display *dpy, _Xconst Visual *visual);6162typedef struct _AwtGraphicsConfigData {63int awt_depth;64Colormap awt_cmap;65XVisualInfo awt_visInfo;66int awt_num_colors;67awtImageData *awtImage;68int (*AwtColorMatch)(int, int, int,69struct _AwtGraphicsConfigData *);70XImage *monoImage;71Pixmap monoPixmap; /* Used in X11TextRenderer_md.c */72int monoPixmapWidth; /* Used in X11TextRenderer_md.c */73int monoPixmapHeight;/* Used in X11TextRenderer_md.c */74GC monoPixmapGC; /* Used in X11TextRenderer_md.c */75int pixelStride; /* Used in X11SurfaceData.c */76ColorData *color_data;77struct _GLXGraphicsConfigInfo *glxInfo;78int isTranslucencySupported; /* Uses Xrender to find this out. */79XRenderPictFormat renderPictFormat; /*Used only if translucency supported*/80} AwtGraphicsConfigData;8182typedef AwtGraphicsConfigData* AwtGraphicsConfigDataPtr;8384typedef struct _AwtScreenData {85int numConfigs;86Window root;87unsigned long whitepixel;88unsigned long blackpixel;89AwtGraphicsConfigDataPtr defaultConfig;90AwtGraphicsConfigDataPtr *configs;91} AwtScreenData;9293typedef AwtScreenData* AwtScreenDataPtr;9495extern AwtGraphicsConfigDataPtr getDefaultConfig(int screen);96#endif /* !HEADLESS */9798/* allocated and initialize a structure */99#define ZALLOC(T) ((struct T *)calloc(1, sizeof(struct T)))100101#ifndef HEADLESS102103extern int awt_allocate_colors(AwtGraphicsConfigDataPtr);104extern void awt_allocate_systemrgbcolors(jint *, int, AwtGraphicsConfigDataPtr);105106extern jobject awtJNI_GetColorModel(JNIEnv *, AwtGraphicsConfigDataPtr);107extern void awtJNI_CreateColorData (JNIEnv *, AwtGraphicsConfigDataPtr, int lock);108109#endif /* !HEADLESS */110#endif /* _AWT_P_H_ */111112113