home *** CD-ROM | disk | FTP | other *** search
- /*
- Handles Layer, Rectangle, Region, RegionRectangle and ClipRect
- structures; LayerInfo structure will be implemented here
-
- Not implemented:
- Layer.LayerInfo
- Layer.Lock
- */
-
- #include "header/sb.h"
- #include <graphics/regions.h>
-
- extern int level; /* recursion level */
-
-
- /* PrLayer
-
- Put up the first page of data for a Layer structure.
- */
-
- PrLayer (string, layer)
- char *string;
- register struct Layer *layer;
- {
- static struct StructData structdata[] = {
- { " front", "struct Layer *", PRPTR, PTRSIZE },
- { " back", "struct Layer *", PRPTR, PTRSIZE },
- { " ClipRect", "struct ClipRect *", PRPTR, PTRSIZE },
- { " rp", "struct RastPort *", PRPTR, PTRSIZE },
- { " bounds", "struct Rectangle", PRNULL, SZ(Rectangle)},
- { " reserved[4]", "UBYTE", PRNULL, BYTESIZE * 4 },
- { "-priority", "UWORD", PRUINT, INTSIZE },
- { "-Flags", "UWORD", PRUINT, INTSIZE },
- { " SuperBitMap", "struct BitMap *", PRPTR, PTRSIZE },
- { " SuperClipRect", "struct ClipRect *", PRPTR, PTRSIZE },
- { " Window", "APTR", PRPTR, PTRSIZE },
- { "-Scroll_X", "SHORT", PRINT, INTSIZE },
- { "-Scroll_Y", "SHORT", PRINT, INTSIZE },
- { " cr", "struct ClipRect *", PRPTR, PTRSIZE },
- { " cr2", "struct ClipRect *", PRPTR, PTRSIZE },
- { " crnew", "struct ClipRect *", PRPTR, PTRSIZE },
- };
-
- int i, sum;
- int choice = -1;
-
- level++;
-
- while (choice)
- {
- sum = SetOptionText(string, structdata, (APTR)layer, DATASIZE, 0);
-
- switch (choice = GetChoice(MAXGADG + 1))
- {
- case 1:
- if (layer->front)
- PrLayer("The Layer in front",
- layer->front);
- break;
- case 2:
- if (layer->back)
- PrLayer("The Layer behind",
- layer->back);
- break;
- case 3:
- if (layer->ClipRect)
- PrClipRect("The ClipRect for this Layer", layer->ClipRect);
- break;
- case 4:
- if (layer->rp)
- PrRastPort("The RastPort for this Layer",
- layer->rp);
- break;
- case 5:
- PrRectangle("The bounds of this Layer", &layer->bounds);
- break;
- case 6:
- HexDump("Hexdump of this Layer's reserved bytes (group 1)",
- &layer->reserved[0], BYTESIZE, (long)BYTESIZE * 4);
- break;
- case 9:
- if (layer->SuperBitMap)
- PrBitMap("The SuperBitMap for this Layer",
- layer->SuperBitMap);
- break;
- case 10:
- if (layer->SuperClipRect)
- PrClipRect("The SuperClipRect for this Layer",
- layer->SuperClipRect);
- break;
- case 11:
- if (layer->Window)
- PrWindow("The Window corresponding to this Layer",
- layer->Window);
- break;
- case 14:
- if (layer->cr)
- PrClipRect("The ClipRect known as \"cr\"", layer->cr);
- break;
- case 15:
- if (layer->cr2)
- PrClipRect("The ClipRect known as \"cr2\"", layer->cr2);
- break;
- case 16:
- if (layer->crnew)
- PrClipRect("The ClipRect known as \"crnew\"", layer->crnew);
- break;
- case MOREGADG:
- PrLayer2("Layer members (page 2)", layer, sum);
- break;
- }
- }
- level--;
- }
-
-
- /* PrLayer2
-
- Put up the second page of data for a Layer structure.
- */
-
- PrLayer2 (string, layer, offset)
- char *string;
- struct Layer *layer;
- int offset;
- {
- static struct StructData structdata[] = {
- { " SuperSaveCl...","struct ClipRect *", PRPTR, PTRSIZE },
- { " _cliprects", "struct ClipRect *", PRPTR, PTRSIZE },
- { "(LayerInfo", "struct Layer_Info *)", PRPTR, PTRSIZE },
- { "(Lock", "struct SignalSemaphore)",PRPTR, SZ(SignalSemaphore)},
- { " reserved3[8]", "UBYTE", PRNULL,BYTESIZE * 8 },
- { " ClipRegion", "struct Region *", PRPTR, PTRSIZE },
- { " saveClipRects", "struct Region *", PRPTR, PTRSIZE },
- { " reserved2[22]", "UBYTE", PRNULL,BYTESIZE * 22 },
- { " DamageList", "struct Region *", PRPTR, PTRSIZE }
- };
-
- int i, sum;
- int choice = -1;
-
- level++;
-
- while (choice)
- {
- sum = SetOptionText(string, structdata, (APTR)layer, DATASIZE, offset);
-
- switch (choice = GetChoice(DATASIZE))
- {
- case 1:
- if (layer->SuperSaveClipRects)
- PrClipRect("This Layer's SuperSaveClipRects",
- layer->SuperSaveClipRects);
- break;
- case 2:
- if (layer->_cliprects)
- PrClipRect("This Layer's _cliprects", layer->_cliprects);
- break;
- case 5:
- HexDump("Hexdump of this Layer's reserved bytes (group 3)",
- &layer->reserved3[0], BYTESIZE, (long)BYTESIZE * 8);
- break;
- case 6:
- if (layer->ClipRegion)
- PrRegion("This Layer's ClipRegion", layer->ClipRegion);
- break;
- case 7:
- if (layer->saveClipRects)
- PrRegion("This Layer's saveClipRects", layer->saveClipRects);
- break;
- case 8:
- HexDump("Hexdump of this Layer's reserved bytes (group 2)",
- &layer->reserved2[0], BYTESIZE, (long)BYTESIZE * 22);
- break;
- case 9:
- if (layer->DamageList)
- PrRegion("This Layer's DamageList", layer->DamageList);
- break;
- }
- }
- level--;
- }
-
-
- /* PrRectangle
-
- Put up the data for a Rectangle structure.
- */
-
- PrRectangle (string, rectangle)
- char *string;
- struct Rectangle *rectangle;
- {
- static struct StructData structdata[] = {
- { "-MinX", "SHORT", PRINT, INTSIZE },
- { "-MinY", "SHORT", PRINT, INTSIZE },
- { "-MaxX", "SHORT", PRINT, INTSIZE },
- { "-MaxY", "SHORT", PRINT, INTSIZE }
- };
-
- int sum;
- int choice = -1;
-
- level++;
-
- while (choice)
- {
- sum = SetOptionText(string, structdata, (APTR)rectangle, DATASIZE, 0);
-
- choice = GetChoice(DATASIZE);
- }
- level--;
- }
-
-
- /* PrRegion
-
- Put up the data for a Region structure.
- */
-
- PrRegion (string, region)
- char *string;
- struct Region *region;
- {
- static struct StructData structdata[] = {
- { " bounds", "struct Rectangle", PRNULL, SZ(Rectangle) },
- { " RegionRecta...", "struct RegionRectangle *",PRPTR, PTRSIZE }
- };
-
- int i, sum;
- int choice = -1;
-
- level++;
-
- while (choice)
- {
- sum = SetOptionText(string, structdata, (APTR)region, DATASIZE, 0);
-
- switch (choice = GetChoice(DATASIZE))
- {
- case 1:
- PrRectangle("The bounds of this Region", ®ion->bounds);
- break;
- case 2:
- if (region->RegionRectangle)
- PrRegionRect("The RegionRectangle for this Region",
- region->RegionRectangle);
- break;
- }
- }
- level--;
- }
-
-
-
- /* PrRegionRect
-
- Put up the data for a RegionRectangle structure.
- */
-
- PrRegionRect (string, regionrect)
- char *string;
- struct RegionRectangle *regionrect;
- {
- static struct StructData structdata[] = {
- { " Next...", "struct RegionRectangle *",PRPTR, PTRSIZE },
- { " Prev...", "struct RegionRectangle *",PRPTR, PTRSIZE },
- { " bounds", "struct Rectangle", PRNULL, SZ(Rectangle) }
- };
-
- int i, sum;
- int choice = -1;
-
- level++;
-
- while (choice)
- {
- sum = SetOptionText(string, structdata, (APTR)regionrect, DATASIZE, 0);
-
- switch (choice = GetChoice(DATASIZE))
- {
- case 1:
- if (regionrect->Next)
- PrRegionRect("The next RegionRectangle", regionrect->Next);
- break;
- case 2:
- if (regionrect->Prev)
- PrRegionRect("The previous RegionRectangle",
- regionrect->Prev);
- break;
- case 3:
- PrRectangle("The bounds of this RegionRectangle",
- ®ionrect->bounds);
- break;
- }
- }
- level--;
- }
-
-
- /* PrClipRect
-
- Put up the data for a ClipRect structure.
- */
-
- PrClipRect (string, cliprect)
- char *string;
- struct ClipRect *cliprect;
- {
- static struct StructData structdata[] = {
- { " Next", "struct ClipRect *", PRPTR, PTRSIZE },
- { " prev", "struct ClipRect *", PRPTR, PTRSIZE },
- { " lobs", "struct Layer *", PRPTR, PTRSIZE },
- { " BitMap", "struct BitMap *", PRPTR, PTRSIZE },
- { " bounds", "struct Rectangle", PRNULL, SZ(Rectangle) },
- { " _p1", "struct ClipRect *", PRPTR, PTRSIZE },
- { " _p2", "struct ClipRect *", PRPTR, PTRSIZE },
- { "-reserved", "LONG", PRLONG, PTRSIZE },
- };
-
- int i, sum;
- int choice = -1;
-
- level++;
-
- while (choice)
- {
- sum = SetOptionText(string, structdata, (APTR)cliprect, DATASIZE, 0);
-
- switch (choice = GetChoice(DATASIZE))
- {
- case 1:
- if (cliprect->Next)
- PrClipRect("The next ClipRect", cliprect->Next);
- break;
- case 2:
- if (cliprect->prev)
- PrClipRect("The previous ClipRect", cliprect->prev);
- break;
- case 3:
- if (cliprect->lobs)
- PrLayer("The Layer for this ClipRect", cliprect->lobs);
- break;
- case 4:
- if (cliprect->BitMap)
- PrBitMap("The BitMap for this ClipRect", cliprect->BitMap);
- break;
- case 5:
- PrRectangle("The bounds of this ClipRect", &cliprect->bounds);
- break;
- case 6:
- if (cliprect->_p1)
- PrClipRect("The ClipRect known as \"_p1\"", cliprect->_p1);
- break;
- case 7:
- if (cliprect->_p2)
- PrClipRect("The ClipRect known as \"_p2\"", cliprect->_p2);
- break;
- }
- }
- level--;
- }
-
-
-