*
* 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.
*/
/*
* TransOvl.c - the client side interface to the Transparent Overlays
* extension.
*/
#define NEED_EVENTS
#define NEED_REPLIES
#include <limits.h>
typedef struct {
int numVisPairs;
int visdatatypes;
typedef struct {
int depth;
} XOvlVisInfo;
typedef struct {
} XOvlVisPair;
#ifdef _LP64
#define XOVL_MAX_BUFFERS (~0L)
#define XOVL_ALL_PLANES (~0L)
#define XOVL_ANY_POOL (~0L)
#else /* _LP64 */
#define XOVL_MAX_BUFFERS (~0)
#define XOVL_ALL_PLANES (~0)
#define XOVL_ANY_POOL (~0)
#endif /* _LP64 */
typedef struct {
int datatypes;
int numBuffers;
unsigned long ovplanes;
unsigned long unplanes;
unsigned long clutpool;
int clutcount;
typedef struct {
typedef struct {
int screen;
unsigned long hardfailures;
unsigned long softfailures;
int numhardfailures;
int numsoftfailures;
typedef struct {
int nDepths;
int depth;
int nVisuals;
static int close_display();
NULL, /* create_gc */
NULL, /* copy_gc */
NULL, /* flush_gc */
NULL, /* free_gc */
NULL, /* create_font */
NULL, /* free_font */
close_display, /* close_display */
NULL, /* wire_to_event */
NULL, /* event_to_wire */
NULL, /* error */
NULL, /* error_string */
};
static
static
/**********************************************************************/
/*
* The utility function _XVIDtoVisual could be used, but we already
* know the screen structure where the visual is to be found, so there
* is no need to scan all the screens on the display. This procedure
* performs a more direct scan for the visual.
*/
static Bool
int *depthReturn
)
{
vis++)
{
return True;
}
}
}
}
return False;
}
static void
)
{
visEnumData->depth = 0;
visEnumData->nVisuals = 0;
}
static Bool
int *depthReturn
)
{
int ndepths;
if (!visEnumData->nVisuals) {
while (ndepths) {
break;
}
ndepths--;
depth++;
}
if (!ndepths) {
return False;
}
}
visEnumData->nVisuals--;
return True;
}
static XOvlScrExtData *
int screen,
)
{
unsigned long nbytes;
unsigned long numPairs;
*vispair;
scrextdata = (XOvlScrExtData *)
if (!scrextdata) {
if (scrextdata && vispairs) {
/* BugId: 4126680 - Purify detects reads in uninitialized
memory generating random results. culprit was id'd to
be the uninitialized field visdatatypes */
scrextdata->visdatatypes = 0;
while (numPairs--) {
{
scrextdata = NULL;
if (numPairs) {
}
break;
}
vispair++;
}
if (scrextdata) {
&(scrextdata->extdata));
}
} else {
scrextdata = NULL;
}
}
}
return scrextdata;
}
static XOvlVisExtData *
)
{
visextdata = (XOvlVisExtData *)
if (!visextdata) {
if (visextdata) {
visextdata->datatypes = 0;
&(visextdata->extdata));
}
}
return visextdata;
}
static int
unsigned long mask
)
{
int count;
count = 0;
while (mask) {
count++;
}
return count;
}
static int
int screen,
{
int i,
int depth;
if (!candidateData) {
/*
* Cannot store data for this visual, assume the worst case.
*/
return 0;
}
/*
* We haven't queried the MBX extension for the buffer
* data on this screen yet. Call XmbufGetScreenInfo
* and fill in the data for all the returned visuals.
*/
&nstereo, &stereo_info);
for (i = 0; i < nmono; i++) {
if (visextdata) {
if (!visextdata->numBuffers) {
}
} else {
/*
* We were unable to finish the query, so mark
* the data as unqueried so we can try again later.
*/
}
}
}
}
/*
* No data was returned from MBX for this visual,
* so fill in a default value. Only mark the
* data valid if the server query completed.
*/
candidateData->numBuffers = 0;
}
}
}
return candidateData->numBuffers;
}
static Bool
int screen,
{
unsigned int i;
int depth;
unsigned long commonplanes;
if (!candidateData || !partnerData) {
/*
* Cannot store data for these visuals, assume the worst case.
*/
return True;
}
{
/*
* We haven't queried the server for plane group data
* on this screen yet. Send the query and fill in
* the data for the visuals indicated in the reply.
*/
for (i = 0; i < rep.numPGInfos; i++) {
if (visextdata) {
} else {
/*
* We were unable to finish the query, so mark
* the data as unqueried so we can try again later.
*/
}
}
}
}
}
/*
* No data was returned from the server for this
* visual, so fill in a default value. Only mark
* the data valid if the server query completed.
*/
}
}
/*
* No data was returned from the server for this
* visual, so fill in a default value. Only mark
* the data valid if the server query completed.
*/
}
}
}
if (searchtype == XSolarisOvlSelectBestOverlay) {
} else {
}
}
static Bool
int screen,
{
unsigned int i;
int depth;
if (!candidateData || !partnerData) {
/*
* Cannot store data for these visuals, assume the worst case.
*/
return True;
}
{
/*
* We haven't queried the server for clut pool data
* on this screen yet. Send the query and fill in
* the data for the visuals indicated in the reply.
*/
for (i = 0; i < rep.numClutInfos; i++) {
if (visextdata) {
} else {
/*
* We were unable to finish the query, so mark
* the data as unqueried so we can try again later.
*/
}
}
}
}
}
/*
* No data was returned from the server for this
* visual, so fill in a default value. Only mark
* the data valid if the server query completed.
*/
}
}
/*
* No data was returned from the server for this
* visual, so fill in a default value. Only mark
* the data valid if the server query completed.
*/
}
}
}
? True
: False;
}
static void
{
unsigned long hardmask,
mask;
unsigned long hardfailures,
hardfailures = 0;
softfailures = 0;
if ( (mask & XSolarisOvlVisualClass)
{
}
if ( (mask & XSolarisOvlDepth)
{
}
if ( (mask & XSolarisOvlMinColors)
{
}
if ( (mask & XSolarisOvlMinRed)
{
}
if ( (mask & XSolarisOvlMinGreen)
{
}
if ( (mask & XSolarisOvlMinBlue)
{
}
if ( (mask & XSolarisOvlMinBitsPerRGB)
{
}
if ( (mask & XSolarisOvlMinBuffers)
< pCriteria->minBuffers))
{
}
if ( (mask & XSolarisOvlUnsharedPixels)
{
}
if ( (mask & XSolarisOvlUnsharedColors)
{
}
if ( (mask & XSolarisOvlPreferredPartner)
&& (!match->partnerpreferred))
{
}
}
#define XSolarisOvlAllCriteria \
XSolarisOvlDepth | \
static void
)
{
}
static void
)
{
}
/**********************************************************************/
int *event_basep,
int *error_basep
)
{
if (XextHasExtension(info)) {
return True;
} else {
return False;
}
}
int *major_versionp,
int *minor_versionp)
{
SyncHandle();
return 0;
}
SyncHandle();
return 1;
}
int x,
int y,
unsigned int width,
unsigned int height,
unsigned int border_width,
int depth,
unsigned int class,
unsigned long valuemask,
)
{
/*
* REMIND: Is there a proper return value to indicate error?
*/
req->x = x;
req->y = y;
if (visual == CopyFromParent) {
} else {
}
valuemask &= AllMaskBits;
/* BugId 4130905 - There were only 3 args to this call instead of 4 -
the last argument attr was missing - causing Bad Xerror Request. When
the client lin libXext was recompiled, the bus error caused the
client code to fail. Big change between 2.6 and 2.7 file. */
}
SyncHandle();
return wid;
}
Window w
)
{
}
SyncHandle();
}
void
Window w)
{
SyncHandle();
return;
}
)
{
gcextdata = (XOvlGCExtData *)
if (!gcextdata) {
if (paintType == XSolarisOvlPaintOpaque) {
/*
* No use creating an extension structure just to hold
* the default value.
*/
SyncHandle();
return 1;
}
if (!gcextdata) {
SyncHandle();
return 0;
}
}
}
SyncHandle();
return 1;
}
)
{
gcextdata = (XOvlGCExtData *)
SyncHandle();
return paintType;
}
int src_x,
int src_y,
unsigned int width,
unsigned int height,
int dest_x,
int dest_y,
unsigned long action_mask,
unsigned long planemask
)
{
SyncHandle();
return 1;
}
int colorSrcX,
int colorSrcY,
int paintTypeSrcX,
int paintTypeSrcY,
unsigned int width,
unsigned int height,
int colorDstX,
int colorDstY,
int paintTypeDstX,
int paintTypeDstY,
unsigned long action_mask,
unsigned long planemask)
{
SyncHandle();
return 1;
}
XImage *
Window w,
int x,
int y,
unsigned int width,
unsigned int height,
)
{
char *data;
long nbytes;
req->x = x;
req->y = y;
{
SyncHandle();
return NULL;
}
} else {
}
if (!data) {
SyncHandle();
return NULL;
}
dpy->bitmap_pad, 0);
if (image) {
} else {
}
SyncHandle();
return image;
}
int screen,
int numCriteria,
unsigned long *unmetCriteriaReturn
)
{
int i,
j;
unsigned long hardpreferred,
if (!scrextdata) {
SyncHandle();
return XSolarisOvlFailure;
}
{
SyncHandle();
return XSolarisOvlFailure;
}
for (i = numCriteria; i > 0; --i) {
for (j = scrextdata->numVisPairs; j > 0; --j) {
if (vid ==
{
if (IsPerfectMatch(&curMatch)) {
SyncHandle();
return XSolarisOvlSuccess;
}
}
}
vispair++;
}
if (!scrextdata->pairsRestricted) {
while (vis_enum_next(&visEnumData,
{
if (IsPerfectMatch(&curMatch)) {
SyncHandle();
return XSolarisOvlSuccess;
}
}
}
}
if (IsQualifiedMatch(&betterMatch)) {
SyncHandle();
return XSolarisOvlQualifiedSuccess;
}
}
pCriteria++;
}
SyncHandle();
return XSolarisOvlCriteriaFailure;
}
int screen,
int numCriteria,
unsigned long *unmetOvCriteriaReturn,
unsigned long *unmetUnCriteriaReturn)
{
int i,
j;
if (!scrextdata) {
SyncHandle();
return XSolarisOvlFailure;
}
for (i = numCriteria; i > 0; --i) {
for (j = scrextdata->numVisPairs; j > 0; --j) {
SyncHandle();
return XSolarisOvlSuccess;
}
{
}
vispair++;
}
if (!scrextdata->pairsRestricted) {
while (vis_enum_next(&ovVisEnumData,
{
while (vis_enum_next(&unVisEnumData,
{
SyncHandle();
return XSolarisOvlSuccess;
}
{
}
}
}
}
SyncHandle();
return XSolarisOvlQualifiedSuccess;
}
&bestOvMatch, &bestUnMatch))
{
}
pCriteria++;
}
SyncHandle();
return XSolarisOvlCriteriaFailure;
}