0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A/* $XConsortium: wsutils.h /main/3 1996/10/14 15:04:17 swick $ */ 0N/A/** ------------------------------------------------------------------------ 0N/A This file contains routines for manipulating generic lists. 0N/A Lists are implemented with a "harness". In other words, each 0N/A node in the list consists of two pointers, one to the data item 0N/A and one to the next node in the list. The head of the list is 0N/A the same struct as each node, but the "item" ptr is used to point 0N/A to the current member of the list (used by the first_in_list and 0N/A next_in_list functions). 0N/A This file is available under and governed by the GNU General Public 0N/A License version 2 only, as published by the Free Software Foundation. 0N/A However, the following notice accompanied the original version of this 0N/ACopyright (c) 1994 Hewlett-Packard Co. 0N/ACopyright (c) 1996 X Consortium 0N/APermission is hereby granted, free of charge, to any person obtaining 0N/Aa copy of this software and associated documentation files (the 0N/A"Software"), to deal in the Software without restriction, including 0N/Awithout limitation the rights to use, copy, modify, merge, publish, 0N/Adistribute, sublicense, and sell copies of the Software, and to 0N/Apermit persons to whom the Software is furnished to do so, subject to 0N/Athe following conditions: 0N/AThe above copyright notice and this permission notice shall be included 0N/Ain all copies or substantial portions of the Software. 0N/ATHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 0N/AOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 0N/AMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 0N/AIN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR 0N/AOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 0N/AARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 0N/AOTHER DEALINGS IN THE SOFTWARE. 0N/AExcept as contained in this notice, the name of the X Consortium shall 0N/Anot be used in advertising or otherwise to promote the sale, use or 0N/Aother dealings in this Software without prior written authorization 0N/Afrom the X Consortium. 0N/A ------------------------------------------------------------------------ **/ 0N/A/****************************************************************************** 0N/A * This file contains various typedef's, macros and procedure declarations for 0N/A * a set of example utility procedures contained in the file "wsutils.c". 0N/A ******************************************************************************/ 0N/A/* This is the actual structure returned by the X server describing the 0N/A * SERVER_OVERLAY_VISUAL property. 0N/A * TransparentMask */ 0N/A long layer;
/* Overlay planes will always be in 0N/A/* This is structure also describes the SERVER_OVERLAY_VISUAL property, but 0N/A * should be more useful than the one actually returned by the X server 0N/A * because it actually points to the visual's XVisualInfo struct rather than 0N/A * refering to the visual's ID. 0N/A * TransparentMask */ 0N/A long layer;
/* Overlay planes will always be in 0N/A/* These macros are the values of the "transparentType" above: */ 0N/A/* These macros define how flexible a program is when it requests a window's 0N/A * creation with either the CreateImagePlanesWindow() or 0N/A * CreateOverlayPlanesWindow(): 0N/A/* These macros define the values of the "sbCmapHint" parameter of the 0N/A * CreateImagePlanesWindow(): 0N/A/****************************************************************************** 0N/A * This routine takes an X11 Display, screen number, and returns whether the 0N/A * screen supports transparent overlays and three arrays: 0N/A * 1) All of the XVisualInfo struct's for the screen. 0N/A * 2) All of the OverlayInfo struct's for the screen. 0N/A * 3) An array of pointers to the screen's image plane XVisualInfo 0N/A * The code below obtains the array of all the screen's visuals, and obtains 0N/A * the array of all the screen's overlay visual information. It then processes 0N/A * the array of the screen's visuals, determining whether the visual is an 0N/A * overlay or image visual. 0N/A * If the routine sucessfully obtained the visual information, it returns zero. 0N/A * If the routine didn't obtain the visual information, it returns non-zero. 0N/A ******************************************************************************/ 0N/A * overlay visual and if at least one 0N/A * of those supports a transparent 0N/A * pointed to to by pVisuals. */ 0N/A * to by pOverlayVisuals. If this 0N/A * number is zero, the device does 0N/A * not have overlay planes. */ 0N/A * to by pImageVisuals. */ 0N/A/****************************************************************************** 0N/A * This routine frees the data that was allocated by GetXVisualInfo(). 0N/A ******************************************************************************/ 0N/A/****************************************************************************** 0N/A * FindImagePlanesVisual() 0N/A * This routine attempts to find a visual to use to create an image planes 0N/A * window based upon the information passed in. 0N/A * The "Hint" values give guides to the routine as to what the program wants. 0N/A * The "depthFlexibility" value tells the routine how much the program wants 0N/A * the actual "depthHint" specified. If the program can't live with the 0N/A * screen's image planes visuals, the routine returns non-zero, and the 0N/A * "depthObtained" and "pImageVisualToUse" return parameters are NOT valid. 0N/A * Otherwise, the "depthObtained" and "pImageVisualToUse" return parameters 0N/A * are valid and the routine returns zero. 0N/A * NOTE: This is just an example of what can be done. It may or may not be 0N/A * useful for any specific application. 0N/A ******************************************************************************/ 0N/A * to by pImageVisuals. */ 0N/A * used with the visual. NOTE: This 0N/A * is a mask of the possible values. */ 0N/A * "depthHint" is desired. */ 0N/A/****************************************************************************** 0N/A * FindOverlayPlanesVisual() 0N/A * This routine attempts to find a visual to use to create an overlay planes 0N/A * window based upon the information passed in. 0N/A * While the CreateImagePlanesWindow() routine took a sbCmapHint, this 0N/A * routine doesn't. Starbase's CMAP_FULL shouldn't be used in overlay planes 0N/A * windows. This is partially because this functionality is better suited in 0N/A * the image planes where there are generally more planes, and partially 0N/A * because the overlay planes generally have PseudoColor visuals with one 0N/A * color being transparent (the transparent normally being the "white" color 0N/A * The "depthHint" values give guides to the routine as to what depth the 0N/A * program wants the window to be. The "depthFlexibility" value tells the 0N/A * routine how much the program wants the actual "depthHint" specified. If 0N/A * the program can't live with the screen's overlay planes visuals, the 0N/A * routine returns non-zero, and the "depthObtained" and "pOverlayVisualToUse" 0N/A * return parameters are NOT valid. Otherwise, the "depthObtained" and 0N/A * "pOverlayVisualToUse" return parameters are valid and the routine returns 0N/A * NOTE: This is just an example of what can be done. It may or may not be 0N/A * useful for any specific application. 0N/A ******************************************************************************/ 0N/A * to by pOverlayVisuals. */ 0N/A * "depthHint" is desired. */ 0N/A * a transparent color. */ 0N/A * can use with the visual. */ 0N/A/****************************************************************************** 0N/A * CreateImagePlanesWindow() 0N/A * This routine creates an image planes window, potentially creates a colormap 0N/A * for the window to use, and sets the window's standard properties, based 0N/A * upon the information passed in to the routine. While "created," the window 0N/A * has not been mapped. 0N/A * If the routine suceeds, it returns zero and the return parameters 0N/A * "imageWindow", "imageColormap" and "mustFreeImageColormap" are valid. 0N/A * Otherwise, the routine returns non-zero and the return parameters are 0N/A * NOTE: This is just an example of what can be done. It may or may not be 0N/A * useful for any specific application. 0N/A ******************************************************************************/ 0N/A * the created window. */ 0N/A char *
argv[],
/* Program's argv parameter. */ 0N/A * XFreeColormap() for imageColormap. */ 0N/A/****************************************************************************** 0N/A * CreateOverlayPlanesWindow() 0N/A * This routine creates an overlay planes window, potentially creates a colormap 0N/A * for the window to use, and sets the window's standard properties, based 0N/A * upon the information passed in to the routine. While "created," the window 0N/A * has not been mapped. 0N/A * If the routine suceeds, it returns zero and the return parameters 0N/A * "overlayWindow", "overlayColormap" and "mustFreeOverlayColormap" are valid. 0N/A * Otherwise, the routine returns non-zero and the return parameters are 0N/A * NOTE: This is just an example of what can be done. It may or may not be 0N/A * useful for any specific application. 0N/A ******************************************************************************/ 0N/A * the created window. */ 0N/A char *
argv[],
/* Program's argv parameter. */ 0N/A * should be a transparent color. */ 0N/A * window's background. */ 0N/A * XFreeColormap() for 0N/A * overlayColormap. */