home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
x
/
xibm.zip
/
mpel
/
mpelData.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-11
|
15KB
|
405 lines
/***********************************************************
Copyright IBM Corporation 1988
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of IBM not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
/* $Header: /afs/athena.mit.edu/astaff/project/x11r5/src/athena/ibm/mpel/RCS/mpelData.c,v 5.1 1992/02/12 00:28:06 jfc Exp $ */
/* $Source: /afs/athena.mit.edu/astaff/project/x11r5/src/athena/ibm/mpel/RCS/mpelData.c,v $ */
#ifndef lint
static char *rcsid = "$Id: mpelData.c,v 5.1 1992/02/12 00:28:06 jfc Exp $";
#endif
#include "X.h"
#include "Xproto.h"
#include "miscstruct.h"
#include "scrnintstr.h"
#include "font.h"
#include "pixmapstr.h"
#include "window.h"
#include "gcstruct.h"
#include "colormapst.h"
#include "cursorstr.h"
#include "mistruct.h"
#include "mfb.h"
#include "OScursor.h"
#include "ibmScreen.h"
#include "ppc.h"
#include "ppcProcs.h"
#include "mpel.h"
#include "mpelProcs.h"
extern void miRecolorCursor() ;
extern void NoopDDA() ;
extern void ibmAbort();
static PixmapPtr BogusPixmap = (PixmapPtr) 1 ;
extern ScreenRec mpelScreenRec ; /* Forward Declaration */
PixmapFormatRec mpelFormats[]= { { 8, 8, 32 } } ;
VisualRec mpelVisuals[] = {
{
0, /* unsigned long vid */
PseudoColor, /* short class */
MPEL_BITS_PER_RGB, /* short bitsPerRGBValue */
1 << MPELMAXPLANES, /* short ColormapEntries */
MPELMAXPLANES, /* short nplanes */
0, /* unsigned long redMask */
0, /* unsigned long greenMask */
0, /* unsigned long blueMask */
0, /* int offsetRed */
0, /* int offsetGreen */
0 /* int offsetBlue */
}
} ;
static unsigned long int mpelDepthVID = 0 ;
DepthRec mpelDepths[] = {
/* depth numVid vids */
{ 1, 0, NULL },
{ MPELMAXPLANES, 1, &mpelDepthVID }
} ;
#define mpelGCInterestValidateMask \
( GCLineStyle | GCLineWidth | GCJoinStyle | GCBackground | GCForeground \
| GCFunction | GCPlaneMask | GCFillStyle | GC_CALL_VALIDATE_BIT \
| GCClipXOrigin | GCClipYOrigin | GCClipMask | GCSubwindowMode )
ppcPrivGC mpelPrototypeGCPriv = {
GXcopy, /* unsigned char rop */
0, /* unsigned char ropOpStip */
0, /* unsigned char ropFillArea */
TRUE, /* short fExpose */
FALSE, /* short freeCompClip */
NullPixmap, /* PixmapPtr pRotatedPixmap */
0, /* RegionPtr pCompositeClip */
ppcAreaFill, /* void (* FillArea)() */
{
MPEL_ALLPLANES, /* unsigned long planemask */
0, /* unsigned long fgPixel */
1, /* unsigned long bgPixel */
GXcopy, /* int alu */
FillSolid, /* int fillStyle */
}, /* ppcReducedRrop colorRrop */
-1, /* short lastDrawableType */
-1, /* short lastDrawableDepth */
ibmAbort, /* void (* cacheIGBlt)() */
ibmAbort, /* void (* cachePGBlt)() */
0 /* pointer devPriv */
} ;
GCFuncs mpelGCFuncs = {
ppcValidateGC, /* void (*ValidateGC)() */
NoopDDA, /* void (*ChangeGC)() */
NoopDDA, /* void (*CopyGC)() */
ppcDestroyGC, /* void (*DestroyGC)() */
ppcChangeClip, /* void (*ChangeClip)() */
ppcDestroyClip, /* void (*DestroyClip)() */
ppcCopyClip /* void (*CopyClip)() */
};
GCOps mpelGCOps = {
ppcSolidWindowFS, /* void (* FillSpans)() */
ppcSetSpans, /* void (* SetSpans)() */
miPutImage, /* void (* PutImage)() */
ppcCopyArea, /* RegionPtr (* CopyArea)() */
miCopyPlane, /* void (* CopyPlane)() */
mpelPolyPoint, /* void (* PolyPoint)() */
mpelZeroLine, /* void (* Polylines)() */
mpelPolySegment, /* void (* PolySegment)() */
miPolyRectangle, /* void (* PolyRectangle)() */
mpelPolyArc, /* void (* PolyArc)() */
mpelFillPolygon, /* void (* FillPolygon)() */
miPolyFillRect, /* void (* PolyFillRect)() */
miPolyFillArc, /* void (* PolyFillArc)() */
mpelPolyText8, /* int (* PolyText8)() */
mpelPolyText16, /* int (* PolyText16)() */
mpelImageText8, /* void (* ImageText8)() */
mpelImageText16, /* void (* ImageText16)() */
(void (*)()) ppcImageGlyphBlt, /* void (* ImageGlyphBlt)() */
(void (*)()) ppcPolyGlyphBlt, /* void (* PolyGlyphBlt)() */
ppcPushPixels, /* void (* PushPixels)() */
miMiter /* void (* LineHelper)() */
};
#if defined(AIXrt) && !defined(__HIGHC__)
GC mpelPrototypeGC;
#else
GC mpelPrototypeGC = {
&mpelScreenRec, /* ScreenPtr pScreen */
MPELMAXPLANES, /* int depth */
GXcopy, /* int alu */
0, /* int lineWidth */
0, /* int dashOffset */
0, /* int numInDashList */
0, /* unsigned char *dash */
LineSolid, /* int lineStyle */
CapButt, /* int capStyle */
JoinMiter, /* int joinStyle */
FillSolid, /* int fillStyle */
EvenOddRule, /* int fillRule */
ArcPieSlice, /* int arcMode */
ClipByChildren, /* int subWindowMode */
TRUE, /* Bool graphicsExposures */
CT_NONE, /* int clientClipType */
1, /* int miTranslate:1 */
1, /* unsigned int tileIsPixel:1 */
0, /* unused:16 */
MPEL_ALLPLANES, /* unsigned long planemask */
0, /* unsigned long fgPixel */
1, /* unsigned long bgPixel */
{0}, /* PixmapPtr tile */
0, /* PixmapPtr stipple */
{ 0, 0 }, /* DDXPointRec patOrg */
0, /* FontPtr font */
{ 0, 0 }, /* DDXPointRec clipOrg */
{ 0, 0 }, /* DDXPointRec lastWinOrg */
NULL, /* pointer clientClip */
/* (1<<(GCLastBit+1))-1, */ /* unsigned long stateChanges */
0, /* unsigned long stateChanges */
0, /* unsigned long serialNumber */
&mpelGCFuncs, /* GCFuncs *funcs */
&mpelGCOps, /* GCOps *ops */
NULL /* devUnion devPrivates */
};
#endif
ppcScrnPriv mpelScrnPriv = {
{
{
DRAWABLE_PIXMAP,/* unsigned char type */
0, /* unsigned char class */
MPELMAXPLANES, /* unsigned char depth */
1, /* unsigned char bitsPerPixel */
0, /* unsigned long id */
0, /* short x */
0, /* short y */
MPEL_WIDTH, /* unsigned short width */
MPEL_HEIGHT, /* unsigned short height */
0, /* ScreenPtr pScreen */
0 /* unsigned long serialNumber */
}, /* DrawableRec drawable */
1, /* int refcnt */
MPEL_WIDTH / 8, /* int devKind */
/* devPrivate initialized to zero by default
(no explicit initialization because AIX cc can't
initialize a union). */
}, /* PixmapRec pixmap */
0, /* void (* devHardwareInitBB)() */
0, /* void (* devHardwareInitAB)() */
&mpelPrototypeGC, /* GCPtr devPrototypeGC */
&mpelPrototypeGCPriv, /* ppcPrivGC *devPrototypeGCPriv */
mpelChangeGCtype, /* Mask (* changeGCtype)() */
mpelChangeWindowGC, /* Mask (* changeWindowGC)() */
0, /* Colormap InstalledColormap */
mpelBitBlt, /* void (* blit)() */
mpelFillSolid, /* void (* solidFill)() */
mpelTile, /* void (* tileFill)() */
ppcStipple, /* void (* stipFill)() */
ppcOpaqueStipple, /* void (* opstipFill)() */
mpelDrawColorImage, /* void (* imageFill)() */
mpelReadColorImage, /* void (* imageRead)() */
mpelBresLine, /* void (* lineBres)() */
mpelHorzLine, /* void (* lineHorz)() */
mpelVertLine, /* void (* lineVert)() */
(void (*)())mpelSetColor, /* void (* setColor)() */
mpel_ppcRecolorCursor, /* void (* RecolorCursor)() */
mpelDrawMonoImage, /* void (* monoFill)() */
mpelDrawMonoByteImage, /* void (* glyphFill)() */
mpelGetPlane, /* unsigned long *((* planeRead)()) */
ppcReplicateArea, /* void (* replicateArea)() */
mpelDestroyGCPriv, /* void (* DestroyGCPriv)() */
/* High Level Software Cursor Support !! */
&mpelcursorSemaphore, /* int * CursorSemaphore */
mpelCheckCursor, /* int (* CheckCursor)() */
mpelReplaceCursor, /* void (* ReplaceCursor)() */
0 /* ppcCacheInfoPtr cacheInfo */
} ;
ScreenRec mpelScreenRec = {
0, /* int myNum */
0, /* ATOM id */
MPEL_WIDTH, /* short width */
MPEL_HEIGHT, /* short height */
(MPEL_WIDTH * 254)/880, /* short mmWidth */
(MPEL_HEIGHT*254)/880, /* short mmHeight */
sizeof mpelDepths/sizeof (DepthRec), /* short numDepths */
MPELMAXPLANES, /* short rootDepth */
mpelDepths, /* DepthPtr allowedDepths */
0, /* unsigned long rootVisual */
0, /* unsigned long defColormap */
0, /* short minInstalledCmaps */
1, /* short maxInstalledCmaps */
Always, /* char backingStoreSupport */
NotUseful, /* char saveUnderSupport */
MPEL_WHITE_PIXEL, /* unsigned long whitePixel */
MPEL_BLACK_PIXEL, /* unsigned long blackPixel */
0, /* unsigned long rgf */
{ 0 }, /* GCPtr GCperDepth[MAXFORMATS+1] */
{ 0 }, /* PixmapPtr PixmapPerDepth[1] */
(pointer) &mpelScrnPriv, /* pointer devPrivate */
sizeof mpelVisuals/sizeof (VisualRec), /* short numVisuals */
&mpelVisuals[0], /* VisualPtr visuals */
0, /* int WindowPrivateLen; */
0, /* unsigned WindowPrivateSizes; */
0, /* unsigned totalWindowSize; */
0, /* int GCPrivateLen; */
0, /* unsigned GCPrivateSizes; */
0, /* unsigned totalGCSize; */
/* Random screen procedures */
mpelScreenClose, /* Bool (* CloseScreen)() */
ppcQueryBestSize, /* void (* QueryBestSize)() */
ibmSaveScreen, /* Bool (* SaveScreen)() */
ppcGetImage, /* void (* GetImage)() */
(void (*)()) ppcGetSpans, /* void (*GetSpans)() */
ibmAbort, /* void (* PointerNonInterestBox)() */
(void (*)()) NULL, /* void (* SourceValidate)() */
/* Window Procedures */
ppcCreateWindow, /* Bool (* CreateWindow)() */
ppcDestroyWindow, /* Bool (* DestroyWindow)() */
ppcPositionWindow, /* Bool (* PositionWindow)() */
mfbChangeWindowAttributes, /* Bool (* ChangeWindowAttributes)() */
mfbMapWindow, /* Bool (* RealizeWindow)() */
mfbUnmapWindow, /* Bool (* UnrealizeWindow)() */
miValidateTree, /* int (* ValidateTree)() */
NULL, /* PostValidateTree */
miWindowExposures, /* void (* WindowExposures)() */
ppcPaintWindow, /* void PaintWindowBackground */
ppcPaintWindow, /* void PaintWindowBorder */
ppcCopyWindow, /* void CopyWindow */
miClearToBackground, /* void ClearToBackground */
NULL,
/* Pixmap procedures */
ppcCreatePixmap, /* PixmapPtr (* CreatePixmap)() */
mfbDestroyPixmap, /* Bool (* DestroyPixmap)() */
/* Backing store Procedures */
NoopDDA, /* void SaveDoomedAreas */
(RegionPtr (*)())ppcRestoreAreas, /* RegionPtr RestoreAreas */
NoopDDA, /* void ExposeCopy */
(RegionPtr (*)())NoopDDA, /* void TranslateBackingStore */
(RegionPtr (*)())NoopDDA, /* void ClearBackingStore */
NoopDDA, /* void DrawGuarantee */
/* Font procedures */
mpelRealizeFont, /* Bool (* RealizeFont)() */
mpelUnrealizeFont, /* Bool (* UnrealizeFont)() */
/* Cursor Procedures */
OS_ConstrainCursor, /* void (* ConstrainCursor)() */
OS_CursorLimits, /* void (* CursorLimits)() */
mpelDisplayCursor, /* Bool (* DisplayCursor)() */
mpelRealizeCursor, /* Bool (* RealizeCursor)() */
mpelUnrealizeCursor, /* Bool (* UnrealizeCursor)() */
mpelRecolorCursor, /* void (* RecolorCursor)() */
OS_SetCursorPosition, /* Bool (* SetCursorPosition)() */
/* GC procedures */
ppcCreateGC, /* Bool (* CreateGC)() */
/* Colormap procedures */
ppcCreateColormapNoop, /* Bool (* CreateColormap)() */
NoopDDA, /* void (* DestroyColormap)() */
mpelInstallColormap, /* void (* InstallColormap)() */
ppcUninstallColormap, /* void (* UninstallColormap)() */
ppcListInstalledColormaps, /* int (* ListInstalledColormaps) () */
ppcStoreColors, /* void (* StoreColors)() */
ppcResolveColor, /* void (* ResolveColor)() */
/* Region procedures */
miRegionCreate, /* RegionPtr (* RegionCreate)() */
miRegionInit, /* void (* RegionInit)() */
miRegionCopy, /* void (* RegionCopy)() */
miRegionDestroy, /* void (* RegionDestroy)() */
miRegionUninit, /* void (* RegionUninit)() */
miIntersect, /* int (* Intersect)() */
miUnion, /* int (* Union)() */
miSubtract, /* int (* Subtract)() */
miInverse, /* int (* Inverse)() */
miRegionReset, /* void (* RegionReset)() */
miTranslateRegion, /* void (* TranslateRegion)() */
miRectIn, /* int (* RectIn)() */
miPointInRegion, /* Bool (* PointInRegion)() */
miRegionNotEmpty, /* Bool (* RegionNotEmpty)() */
miRegionEmpty, /* void (* RegionEmpty)() */
miRegionExtents, /* BoxPtr (*RegionExtents)() */
miRegionAppend, /* BoxPtr (*RegionAppend)() */
miRegionValidate, /* BoxPtr (*RegionValidate)() */
mfbPixmapToRegion, /* BoxPtr (*BitmapToRegion)() */
miRectsToRegion, /* BoxPtr (*RectsToRegion)() */
miSendGraphicsExpose, /* void (*SendGraphicsExpose)() */
/* os layer procedures */
NoopDDA, /* void (* BlockHandler)() */
NoopDDA, /* void (* WakeupHandler)() */
(pointer) 0, /* pointer blockData */
(pointer) 0, /* pointer wakeupData */
0 /* DevUnion devPrivate */
} ;
#if defined(AIXrt) && !defined(__HIGHC__)
void
mpelDataInit()
{
mpelPrototypeGC.pScreen = &mpelScreenRec;
mpelPrototypeGC.depth = MPELMAXPLANES;
mpelPrototypeGC.alu = GXcopy;
mpelPrototypeGC.lineWidth = 0;
mpelPrototypeGC.dashOffset = 0;
mpelPrototypeGC.numInDashList = 0;
mpelPrototypeGC.dash = 0;
mpelPrototypeGC.lineStyle = LineSolid;
mpelPrototypeGC.capStyle = CapButt;
mpelPrototypeGC.joinStyle = JoinMiter;
mpelPrototypeGC.fillStyle = FillSolid;
mpelPrototypeGC.fillRule = EvenOddRule;
mpelPrototypeGC.arcMode = ArcPieSlice;
mpelPrototypeGC.subWindowMode = ClipByChildren;
mpelPrototypeGC.graphicsExposures = TRUE;
mpelPrototypeGC.clientClipType = CT_NONE;
mpelPrototypeGC.miTranslate = 1;
mpelPrototypeGC.tileIsPixel = 1;
mpelPrototypeGC.unused = 0;
mpelPrototypeGC.planemask = MPEL_ALLPLANES;
mpelPrototypeGC.fgPixel = 0;
mpelPrototypeGC.bgPixel = 1;
mpelPrototypeGC.tile.pixmap = 0;
mpelPrototypeGC.stipple = 0;
mpelPrototypeGC.patOrg.x = 0;
mpelPrototypeGC.patOrg.y = 0;
mpelPrototypeGC.font = 0;
mpelPrototypeGC.clipOrg.x = 0;
mpelPrototypeGC.clipOrg.y = 0;
mpelPrototypeGC.lastWinOrg.x = 0;
mpelPrototypeGC.lastWinOrg.y = 0;
mpelPrototypeGC.clientClip = NULL;
mpelPrototypeGC.stateChanges = 0;
mpelPrototypeGC.serialNumber = 0;
mpelPrototypeGC.funcs = &mpelGCFuncs;
mpelPrototypeGC.ops = &mpelGCOps;
mpelPrototypeGC.devPrivates = NULL;
}
#endif