src/java.desktop/unix/native/common/awt/awt_p.h
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 58598 bdf0a922ae8a
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
57515
2db64810f4fc 8224171: The cleanup multi-font related code in the XFontPeer
serb
parents: 47216
diff changeset
     2
 * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2955
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2955
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2955
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2955
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2955
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * Motif-specific data structures for AWT Java objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#ifndef _AWT_P_H_
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#define _AWT_P_H_
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#include <stdarg.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#include <stdio.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#include <stdlib.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#include <string.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
#include <unistd.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#ifndef HEADLESS
2955
9327f093140c 6851515: awt_p.h incorporates a chunk of the XRender header
andrew
parents: 2807
diff changeset
    39
#include <X11/extensions/Xrender.h>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
#endif /* !HEADLESS */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
#include "awt.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
#include "awt_util.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
#include "color.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
#include "colordata.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#include "gdefs.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
#ifndef HEADLESS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
#ifndef min
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
#define min(a,b) ((a) <= (b)? (a):(b))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
#ifndef max
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
#define max(a,b) ((a) >= (b)? (a):(b))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
#endif /* !HEADLESS */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
#define LOOKUPSIZE 32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
#ifndef HEADLESS
2807
db01a7f6d657 6839999: Cumulative fix for 6762511 and 6838003
anthony
parents: 2760
diff changeset
    59
db01a7f6d657 6839999: Cumulative fix for 6762511 and 6838003
anthony
parents: 2760
diff changeset
    60
typedef XRenderPictFormat *
db01a7f6d657 6839999: Cumulative fix for 6762511 and 6838003
anthony
parents: 2760
diff changeset
    61
XRenderFindVisualFormatFunc (Display *dpy, _Xconst Visual *visual);
db01a7f6d657 6839999: Cumulative fix for 6762511 and 6838003
anthony
parents: 2760
diff changeset
    62
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
typedef struct _AwtGraphicsConfigData  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    int         awt_depth;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    Colormap    awt_cmap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    XVisualInfo awt_visInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    int         awt_num_colors;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    awtImageData *awtImage;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    int         (*AwtColorMatch)(int, int, int,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
                                 struct _AwtGraphicsConfigData *);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    XImage      *monoImage;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    Pixmap      monoPixmap;      /* Used in X11TextRenderer_md.c */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    int         monoPixmapWidth; /* Used in X11TextRenderer_md.c */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    int         monoPixmapHeight;/* Used in X11TextRenderer_md.c */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    GC          monoPixmapGC;    /* Used in X11TextRenderer_md.c */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    int         pixelStride;     /* Used in X11SurfaceData.c */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    ColorData      *color_data;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    struct _GLXGraphicsConfigInfo *glxInfo;
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1175
diff changeset
    79
    int         isTranslucencySupported; /* Uses Xrender to find this out. */
2807
db01a7f6d657 6839999: Cumulative fix for 6762511 and 6838003
anthony
parents: 2760
diff changeset
    80
    XRenderPictFormat renderPictFormat; /*Used only if translucency supported*/
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
} AwtGraphicsConfigData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
typedef AwtGraphicsConfigData* AwtGraphicsConfigDataPtr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
typedef struct _AwtScreenData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    int numConfigs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    Window root;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    unsigned long whitepixel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    unsigned long blackpixel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    AwtGraphicsConfigDataPtr defaultConfig;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    AwtGraphicsConfigDataPtr *configs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
} AwtScreenData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
typedef AwtScreenData* AwtScreenDataPtr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
extern AwtGraphicsConfigDataPtr getDefaultConfig(int screen);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
extern AwtScreenDataPtr getScreenData(int screen);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
#endif /* !HEADLESS */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
/* allocated and initialize a structure */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
#define ZALLOC(T)       ((struct T *)calloc(1, sizeof(struct T)))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
#ifndef HEADLESS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
extern int awt_allocate_colors(AwtGraphicsConfigDataPtr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
extern void awt_allocate_systemrgbcolors(jint *, int, AwtGraphicsConfigDataPtr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
extern int awtJNI_GetColorForVis (JNIEnv *, jobject, AwtGraphicsConfigDataPtr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
extern jobject awtJNI_GetColorModel(JNIEnv *, AwtGraphicsConfigDataPtr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
extern void awtJNI_CreateColorData (JNIEnv *, AwtGraphicsConfigDataPtr, int lock);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
#endif /* !HEADLESS */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
#endif           /* _AWT_P_H_ */