multivis.h revision 919
#ifndef _MULTIVIS_H
#define _MULTIVIS_H
/*-
* multivis.h - Header file for Mechanism for GetImage across Multiple Visuals
*
* Copyright 1990 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Original author:
* Milind M. Pansare
* Window Systems Group
* Sun Microsystems, Inc.
*
* Revision History:
* 11-15-90 Written
*/
#include <stdio.h>
/*
* Data Structures used ...
*/
typedef struct _colmap { /* Colormap Information */
int doComposite; /* True for Direct & TrueColor */
unsigned long red_mask, /* All these valid only for */
green_mask, /* Direct & TrueColor */
unsigned long rmax, /* Max indices into each primary */
gmax,
bmax;
int rshft, /* Quick calcs for later */
} MVColmap;
typedef struct _winVisInfo { /* A window & it's VisualInfo */
int depth;
#ifdef SHAPE
#endif /* SHAPE */
} MVWinVisInfo;
typedef struct _winVisInfoList { /* An Array of winVisInfo */
typedef struct _pel { /* One for each pixel position */
unsigned long pixel; /* pixel value */
} MVPel;
/*
* CAUTION: There will be one _pel for each pixel position in the
* requested dump area. This could potentially explode the data space.
* There are 2 remedies for this.
* 1. Dump small areas at a time
* 2. Change this data structure to contain only the final RGB value,
* if the pixel value is not of consequence to the application.
* Pixel Examination type of clients (eg. XMag) require the
* pixel value, and operate on a relatively small dump area, so this
* is not a problem.
*/
/*
* Defines & macros ...
*/
/* Return MVPel * for this pixel position */
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) < (b) ? (a) : (b))
/* This is the number of windows we typically expect on a desktop */
#define MV_WIN_TUNE1 20
/* If not, this is a likely multiplier ... */
#define MV_WIN_TUNE2 2
#ifdef UPDATE_HACK
typedef void (*mvCallbackFunc)(void *);
#endif /* UPDATE_HACK */
/*
* extern declarations ... These are the mvLib's PUBLIC routines
* There are no other PUBLIC interfaces to mvLib.
* None of the Data Structures are PUBLIC.
*/
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif /* __cplusplus */
#ifdef UPDATE_HACK
#else
#endif /* UPDATE_HACK */
void mvReset();
#ifdef SHAPE
#endif /* SHAPE */
);
int mvIsMultiVis();
void mvDoWindowsFrontToBack();
XColor *mvFindColorInColormap(int x, int y);
#else /* ! __STDC__ */
extern int mvShifts();
extern int mvOnes();
extern void mvInit();
extern void mvReset();
extern void mvWalkTree();
extern int mvIsMultiVis();
extern int mvCreatImg();
extern void mvDoWindowsFrontToBack();
extern XColor *mvFindColorInColormap();
#endif /* __STDC__ */
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif /* __cplusplus */
#endif /* _MULTIVIS_H */