jdk/src/java.desktop/unix/native/libawt_xawt/awt/wsutils.h
author martin
Thu, 30 Oct 2014 07:31:41 -0700
changeset 28059 e576535359cc
parent 26751 70bac69b37c9
permissions -rw-r--r--
8067377: My hobby: caning, then then canning, the the can-can Summary: Fix ALL the stutters! Reviewed-by: rriggs, mchung, lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     6
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     8
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/* $XConsortium: wsutils.h /main/3 1996/10/14 15:04:17 swick $ */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
/** ------------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
        This file contains routines for manipulating generic lists.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
        Lists are implemented with a "harness".  In other words, each
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
        node in the list consists of two pointers, one to the data item
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
        and one to the next node in the list.  The head of the list is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
        the same struct as each node, but the "item" ptr is used to point
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
        to the current member of the list (used by the first_in_list and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
        next_in_list functions).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 This file is available under and governed by the GNU General Public
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 License version 2 only, as published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 However, the following notice accompanied the original version of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 file:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
Copyright (c) 1994 Hewlett-Packard Co.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
Copyright (c) 1996  X Consortium
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
Permission is hereby granted, free of charge, to any person obtaining
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
a copy of this software and associated documentation files (the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
"Software"), to deal in the Software without restriction, including
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
without limitation the rights to use, copy, modify, merge, publish,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
distribute, sublicense, and sell copies of the Software, and to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
permit persons to whom the Software is furnished to do so, subject to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
the following conditions:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
The above copyright notice and this permission notice shall be included
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
in all copies or substantial portions of the Software.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
OTHER DEALINGS IN THE SOFTWARE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
Except as contained in this notice, the name of the X Consortium shall
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
not be used in advertising or otherwise to promote the sale, use or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
other dealings in this Software without prior written authorization
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
from the X Consortium.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    ------------------------------------------------------------------------ **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
/******************************************************************************
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * This file contains various typedef's, macros and procedure declarations for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * a set of example utility procedures contained in the file "wsutils.c".
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 ******************************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
/* This is the actual structure returned by the X server describing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * SERVER_OVERLAY_VISUAL property.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
typedef struct
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
  VisualID      visualID;               /* The VisualID of the overlay visual */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
  long  transparentType;        /* Can be None, TransparentPixel or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                                         * TransparentMask */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
  long  value;                  /* Pixel value */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
  long layer;                   /* Overlay planes will always be in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                                         * layer 1 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
} OverlayVisualPropertyRec;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
/* This is structure also describes the SERVER_OVERLAY_VISUAL property, but
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * should be more useful than the one actually returned by the X server
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * because it actually points to the visual's XVisualInfo struct rather than
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 * refering to the visual's ID.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
typedef struct
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
  XVisualInfo   *pOverlayVisualInfo;    /* Pointer to the XVisualInfo struct */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
  long transparentType; /* Can be None, TransparentPixel or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
                                         * TransparentMask */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
  long value;                   /* Pixel value */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
  long layer;                   /* Overlay planes will always be in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                                         * layer 1 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
} OverlayInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
/* These macros are the values of the "transparentType" above: */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
#ifndef None
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
#define None 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
#ifndef TransparentPixel
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
#define TransparentPixel        1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
/* These macros define how flexible a program is when it requests a window's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
 * creation with either the CreateImagePlanesWindow() or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
 * CreateOverlayPlanesWindow():
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
#ifndef NOT_FLEXIBLE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
#define NOT_FLEXIBLE            0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
#define FLEXIBLE                1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
/* These macros define the values of the "sbCmapHint" parameter of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
 * CreateImagePlanesWindow():
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
#ifndef SB_CMAP_TYPE_NORMAL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
#define SB_CMAP_TYPE_NORMAL     1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
#ifndef SB_CMAP_TYPE_MONOTONIC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
#define SB_CMAP_TYPE_MONOTONIC  2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
#ifndef SB_CMAP_TYPE_FULL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
#define SB_CMAP_TYPE_FULL       4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
/******************************************************************************
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
 * GetXVisualInfo()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
 * This routine takes an X11 Display, screen number, and returns whether the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
 * screen supports transparent overlays and three arrays:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
 *      1) All of the XVisualInfo struct's for the screen.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
 *      2) All of the OverlayInfo struct's for the screen.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
 *      3) An array of pointers to the screen's image plane XVisualInfo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
 *         structs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
 * The code below obtains the array of all the screen's visuals, and obtains
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
 * the array of all the screen's overlay visual information.  It then processes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
 * the array of the screen's visuals, determining whether the visual is an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
 * overlay or image visual.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
 * If the routine sucessfully obtained the visual information, it returns zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
 * If the routine didn't obtain the visual information, it returns non-zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
 ******************************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
extern int32_t GetXVisualInfo(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
#if NeedFunctionPrototypes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    Display     *display,               /* Which X server (aka "display"). */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    int32_t             screen,                 /* Which screen of the "display". */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    int32_t             *transparentOverlays,   /* Non-zero if there's at least one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
                                         * overlay visual and if at least one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                                         * of those supports a transparent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
                                         * pixel. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    int32_t             *numVisuals,            /* Number of XVisualInfo struct's
28059
e576535359cc 8067377: My hobby: caning, then then canning, the the can-can
martin
parents: 26751
diff changeset
   170
                                         * pointed to by pVisuals. */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    XVisualInfo **pVisuals,             /* All of the device's visuals. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    int32_t             *numOverlayVisuals,     /* Number of OverlayInfo's pointed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                                         * to by pOverlayVisuals.  If this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                                         * number is zero, the device does
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                                         * not have overlay planes. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    OverlayInfo **pOverlayVisuals,      /* The device's overlay plane visual
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                                         * information. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    int32_t             *numImageVisuals,       /* Number of XVisualInfo's pointed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                                         * to by pImageVisuals. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    XVisualInfo ***pImageVisuals        /* The device's image visuals. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                    );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
/******************************************************************************
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
 * FreeXVisualInfo()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
 * This routine frees the data that was allocated by GetXVisualInfo().
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
 ******************************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
extern void FreeXVisualInfo(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
#if NeedFunctionPrototypes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    XVisualInfo *pVisuals,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    OverlayInfo *pOverlayVisuals,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    XVisualInfo **pImageVisuals
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
                     );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
/******************************************************************************
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
 * FindImagePlanesVisual()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
 * This routine attempts to find a visual to use to create an image planes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
 * window based upon the information passed in.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
 * The "Hint" values give guides to the routine as to what the program wants.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
 * The "depthFlexibility" value tells the routine how much the program wants
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
 * the actual "depthHint" specified.  If the program can't live with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
 * screen's image planes visuals, the routine returns non-zero, and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
 * "depthObtained" and "pImageVisualToUse" return parameters are NOT valid.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
 * Otherwise, the "depthObtained" and "pImageVisualToUse" return parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
 * are valid and the routine returns zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
 * NOTE: This is just an example of what can be done.  It may or may not be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
 * useful for any specific application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
 ******************************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
extern int32_t FindImagePlanesVisual(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
#if NeedFunctionPrototypes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    Display     *display,               /* Which X server (aka "display"). */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    int32_t             screen,                 /* Which screen of the "display". */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    int32_t             numImageVisuals,        /* Number of XVisualInfo's pointed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                                         * to by pImageVisuals. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    XVisualInfo **pImageVisuals,        /* The device's image visuals. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    int32_t             sbCmapHint,             /* What Starbase cmap modes will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                                         * used with the visual.  NOTE: This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                                         * is a mask of the possible values. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    int32_t             depthHint,              /* Desired depth. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    int32_t             depthFlexibility,       /* How much the actual value in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                                         * "depthHint" is desired. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    Visual      **pImageVisualToUse,    /* The screen's image visual to use. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    int32_t             *depthObtained          /* Actual depth of the visual. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
                                     );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
/******************************************************************************
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
 * FindOverlayPlanesVisual()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
 * This routine attempts to find a visual to use to create an overlay planes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
 * window based upon the information passed in.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
 * While the CreateImagePlanesWindow() routine took a sbCmapHint, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
 * routine doesn't.  Starbase's CMAP_FULL shouldn't be used in overlay planes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
 * windows.  This is partially because this functionality is better suited in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
 * the image planes where there are generally more planes, and partially
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
 * because the overlay planes generally have PseudoColor visuals with one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
 * color being transparent (the transparent normally being the "white" color
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
 * for CMAP_FULL).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
 * The "depthHint" values give guides to the routine as to what depth the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
 * program wants the window to be.  The "depthFlexibility" value tells the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
 * routine how much the program wants the actual "depthHint" specified.  If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
 * the program can't live with the screen's overlay planes visuals, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
 * routine returns non-zero, and the "depthObtained" and "pOverlayVisualToUse"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
 * return parameters are NOT valid.  Otherwise, the "depthObtained" and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
 * "pOverlayVisualToUse" return parameters are valid and the routine returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
 * zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
 * NOTE: This is just an example of what can be done.  It may or may not be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
 * useful for any specific application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
 ******************************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
extern int32_t FindOverlayPlanesVisual(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
#if NeedFunctionPrototypes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    Display     *display,               /* Which X server (aka "display"). */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    int32_t             screen,                 /* Which screen of the "display". */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
    int32_t             numOverlayVisuals,      /* Number of OverlayInfo's pointed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
                                         * to by pOverlayVisuals. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    OverlayInfo *pOverlayVisuals,       /* The device's overlay plane visual
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
                                         * information. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    int32_t             depthHint,              /* Desired depth. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    int32_t             depthFlexibility,       /* How much the actual value in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
                                         * "depthHint" is desired. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    int32_t             transparentBackground,  /* Non-zero if the visual must have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
                                         * a transparent color. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    Visual      **pOverlayVisualToUse,  /* The screen's overlay visual to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
                                         * use. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    int32_t             *depthObtained,         /* Actual depth of the visual. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    int32_t             *transparentColor       /* The transparent color the program
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
                                         * can use with the visual. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
                                );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
/******************************************************************************
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
 * CreateImagePlanesWindow()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
 * This routine creates an image planes window, potentially creates a colormap
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
 * for the window to use, and sets the window's standard properties, based
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
 * upon the information passed in to the routine.  While "created," the window
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
 * has not been mapped.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
 * If the routine suceeds, it returns zero and the return parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
 * "imageWindow", "imageColormap" and "mustFreeImageColormap" are valid.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
 * Otherwise, the routine returns non-zero and the return parameters are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
 * NOT valid.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
 * NOTE: This is just an example of what can be done.  It may or may not be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
 * useful for any specific application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
 ******************************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
extern int32_t CreateImagePlanesWindow(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
#if NeedFunctionPrototypes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
    Display     *display,               /* Which X server (aka "display"). */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
    int32_t             screen,                 /* Which screen of the "display". */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
    Window      parentWindow,           /* Window ID of the parent window for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
                                         * the created window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
    int32_t             windowX,                /* Desired X coord. of the window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
    int32_t             windowY,                /* Desired Y coord of the window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
    int32_t             windowWidth,            /* Desired width of the window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
    int32_t             windowHeight,           /* Desired height of the window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    int32_t             windowDepth,            /* Desired depth of the window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
    Visual      *pImageVisualToUse,     /* The window's image planes visual. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
    int32_t             argc,                   /* Program's argc parameter. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
    char        *argv[],                /* Program's argv parameter. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    char        *windowName,            /* Name to put on window's border. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
    char        *iconName,              /* Name to put on window's icon. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
    Window      *imageWindow,           /* Window ID of the created window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
    Colormap    *imageColormap,         /* The window's colormap. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
    int32_t             *mustFreeImageColormap  /* Non-zero if the program must call
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
                                         * XFreeColormap() for imageColormap. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
                                );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
/******************************************************************************
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
 * CreateOverlayPlanesWindow()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
 * This routine creates an overlay planes window, potentially creates a colormap
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
 * for the window to use, and sets the window's standard properties, based
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
 * upon the information passed in to the routine.  While "created," the window
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
 * has not been mapped.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
 * If the routine suceeds, it returns zero and the return parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
 * "overlayWindow", "overlayColormap" and "mustFreeOverlayColormap" are valid.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
 * Otherwise, the routine returns non-zero and the return parameters are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
 * NOT valid.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
 * NOTE: This is just an example of what can be done.  It may or may not be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
 * useful for any specific application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
 ******************************************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
int32_t CreateOverlayPlanesWindow(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
#if NeedFunctionPrototypes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
    Display     *display,               /* Which X server (aka "display"). */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
    int32_t             screen,                 /* Which screen of the "display". */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
    Window      parentWindow,           /* Window ID of the parent window for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
                                         * the created window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
    int32_t             windowX,                /* Desired X coord. of the window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
    int32_t             windowY,                /* Desired Y coord of the window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
    int32_t             windowWidth,            /* Desired width of the window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
    int32_t             windowHeight,           /* Desired height of the window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
    int32_t             windowDepth,            /* Desired depth of the window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
    Visual      *pOverlayVisualToUse,   /* The window's overlay planes visual.*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    int32_t             argc,                   /* Program's argc parameter. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
    char        *argv[],                /* Program's argv parameter. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    char        *windowName,            /* Name to put on window's border. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
    char        *iconName,              /* Name to put on window's icon. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    int32_t             transparentBackground,  /* Non-zero if the window's background
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
                                         * should be a transparent color. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
    int32_t             *transparentColor,      /* The transparent color to use as the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
                                         * window's background. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    Window      *overlayWindow,         /* Window ID of the created window. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
    Colormap    *overlayColormap,       /* The window's colormap. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    int32_t             *mustFreeOverlayColormap/* Non-zero if the program must call
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
                                          * XFreeColormap() for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
                                          * overlayColormap. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
                                );