home *** CD-ROM | disk | FTP | other *** search
- /*
- Handles the Screen structure
-
- Not implemented:
- Screen.LayerInfo
- Screen.ExtData
- Screen.UserData
- */
-
- #include "header/sb.h"
-
- extern int level;
-
- PrScreen (string, screen)
- char *string;
- struct Screen *screen;
- {
- static struct StructData structdata [] = {
- { " NextScreen", "struct Screen *", PRPTR, PTRSIZE },
- { " FirstWindow", "struct Window *", PRPTR, PTRSIZE },
- { "-LeftEdge", "SHORT", PRINT, INTSIZE },
- { "-TopEdge", "SHORT", PRINT, INTSIZE },
- { "-Width", "SHORT", PRINT, INTSIZE },
- { "-Height", "SHORT", PRINT, INTSIZE },
- { "-MouseY", "SHORT", PRINT, INTSIZE },
- { "-MouseX", "SHORT", PRINT, INTSIZE },
- { " Flags", "USHORT", PRUINT, INTSIZE },
- { " Title", "UBYTE *", PRSTRING, PTRSIZE },
- { " DefaultTitle", "UBYTE *", PRSTRING, PTRSIZE },
- { "-BarHeight", "BYTE", PRBYTE, BYTESIZE },
- { "-BarVBorder", "BYTE", PRBYTE, BYTESIZE },
- { "-BarHBorder", "BYTE", PRBYTE, BYTESIZE },
- { "-MenuVBorder", "BYTE", PRBYTE, BYTESIZE },
- { "-MenuHBorder", "BYTE", PRBYTE, BYTESIZE }
- };
-
- static char *flagnames[8] = {
- "WBENCHSCREEN", "CUSTOMSCREEN", NULL, NULL,
- "SHOWTITLE", "BEEPING", "CUSTOMBITMAP", NULL
- };
-
- int i, sum;
- int choice = -1;
- ULONG bits;
-
- level++;
-
- while (choice)
- {
- sum = SetOptionText(string, structdata, (APTR)screen, DATASIZE, 0);
-
- switch (choice = GetChoice(MAXGADG + 1)) {
- case 1:
- if (screen->NextScreen)
- PrScreen("The next screen in Intuition's list",
- screen->NextScreen);
- break;
- case 2:
- if (screen->FirstWindow)
- PrWindow("The screen's first window", screen->FirstWindow);
- break;
- case 9:
- if ((bits = screen->Flags) & 2)
- bits ^= 1;
- FlagPrint("The Screen's Flags", flagnames, bits);
- break;
- case 10:
- PrString("The Screen's Title", screen->Title);
- break;
- case 11:
- PrString("The Screen's Default Title", screen->DefaultTitle);
- break;
- case MOREGADG:
- PrScreen2("Screen members (page 2)", screen, sum);
- break;
- }
- }
- level--;
- }
-
- PrScreen2 (string, screen, offset)
- char *string;
- struct Screen *screen;
- int offset;
- {
- static struct StructData structdata[] = {
- { "-WBorTop", "BYTE", PRBYTE, BYTESIZE },
- { "-WBorLeft", "BYTE", PRBYTE, BYTESIZE },
- { "-WBorRight", "BYTE", PRBYTE, BYTESIZE },
- { "-WBorBottom", "BYTE", PRBYTE, INTSIZE },
- { " Font", "struct TextAttr *", PRPTR, PTRSIZE },
- { " ViewPort", "struct ViewPort", PRNULL, SZ(ViewPort) },
- { " RastPort", "struct RastPort ", PRNULL, SZ(RastPort) },
- { " BitMap", "struct BitMap", PRNULL, SZ(BitMap) },
- { "(LayerInfo", "struct Layer_Info)", PRNULL, SZ(Layer_Info) },
- { " FirstGadget", "struct Gadget *", PRPTR, PTRSIZE },
- { "-DetailPen", "UBYTE", PRUBYTE, BYTESIZE },
- { "-BlockPen", "UBYTE", PRUBYTE, BYTESIZE },
- { "-SaveColor0", "USHORT", PRUINT, INTSIZE },
- { " BarLayer", "struct Layer *", PRPTR, PTRSIZE },
- { "(ExtData", "UBYTE *)", PRPTR, PTRSIZE },
- { "(UserData", "UBYTE *)", PRPTR, PTRSIZE }
- };
-
- int i, sum;
- int choice = -1;
-
- level++;
-
- while (choice)
- {
- sum = SetOptionText(string, structdata, (APTR)screen, DATASIZE, offset);
-
- switch (choice = GetChoice(DATASIZE))
- {
- case 5:
- if (screen->Font)
- PrTextAttr("The font attributes for this Screen",
- screen->Font);
- break;
- case 6:
- PrViewPort("The screen's ViewPort", &screen->ViewPort);
- break;
- case 7:
- PrRastPort("The screen's RastPort", &screen->RastPort);
- break;
- case 8:
- PrBitMap("The screen's BitMap", &screen->BitMap);
- break;
- case 10:
- if (screen->FirstGadget)
- PrGadget("The screen's first gadget", screen->FirstGadget);
- break;
- case 14:
- if (screen->BarLayer)
- PrLayer("The Layer for the Screen's title bar",
- screen->BarLayer);
- break;
- }
- }
- level--;
- }
-