home *** CD-ROM | disk | FTP | other *** search
- /*
- Handles the Gadget, StringInfo and PropInfo structures
-
- Not implemented:
- StringInfo.AltKeyMap
- */
-
- #include "header/sb.h"
-
- extern int level;
-
- /* PrGadget
-
- Put up the data for a Gadget structure.
- */
-
- PrGadget(string, gadget)
- char *string;
- struct Gadget *gadget;
- {
- static struct StructData structdata [] = {
- { " NextGadget", "struct Gadget *", PRPTR, PTRSIZE },
- { "-LeftEdge", "SHORT", PRINT, INTSIZE },
- { "-TopEdge", "SHORT", PRINT, INTSIZE },
- { "-Width", "SHORT", PRINT, INTSIZE },
- { "-Height", "SHORT", PRINT, INTSIZE },
- { " Flags", "USHORT", PRUINT, INTSIZE },
- { " Activation", "USHORT", PRUINT, INTSIZE },
- { " GadgetType", "USHORT", PRUINT, INTSIZE },
- { " GadgetRender", "APTR", PRPTR, PTRSIZE },
- { " SelectRender", "APTR", PRPTR, PTRSIZE },
- { "-GadgetText", "struct IntuiText *", PRPTR, PTRSIZE },
- { "-MutualExclude","LONG", PRLONG, PTRSIZE },
- { " SpecialInfo", "APTR", PRPTR, PTRSIZE },
- { "-GadgetID", "USHORT", PRUINT, INTSIZE },
- { "-UserData", "APTR", PRPTR, PTRSIZE },
- };
-
- static char *flagnames[16] = {
- "GADGHBOX", "GADGHIMAGE", "GADGIMAGE", "GRELBOTTOM",
- "GRELRIGHT", "GRELWIDTH", "GRELHEIGHT", "SELECTED",
- "GADGDISABLED"
- };
-
- static char *activenames[16] = {
- "RELVERIFY", "GADGIMMEDIATE", "ENDGADGET", "FOLLOWMOUSE",
- "RIGHTBORDER", "LEFTBORDER", "TOPBORDER", "BOTTOMBORDER",
- "TOGGLESELECT", "STRINGCENTER", "STRINGRIGHT", "LONGINT",
- "ALTKEYMAP", "BOOLEXTEND"
- };
-
- static char *systypenames[16] = {
- "SIZING", "WDRAGGING", "SDRAGGING", "WUPFRONT",
- "SUPFRONT", "WDOWNBACK", "SDOWNBACK", "CLOSE",
- NULL, NULL, NULL, NULL,
- "REQGADGET", "GZZGADGET", "SCRGADGET", "SYSGADGET"
- };
-
- static char *applitypenames[16] = {
- "BOOLGADGET", "GADGET0002", "PROPGADGET", "STRGADGET",
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- "REQGADGET", "GZZGADGET", "SCRGADGET", "SYSGADGET"
- };
-
- int i, sum, choice = -1;
- USHORT bits;
-
- level++;
-
- while (choice)
- {
- sum = SetOptionText(string, structdata, (APTR)gadget, DATASIZE, 0);
-
- switch (choice = GetChoice(DATASIZE))
- {
- case 1:
- if (gadget->NextGadget)
- PrGadget("The next gadget in Intuition's list",
- gadget->NextGadget);
- break;
- case 6:
- bits = gadget->Flags;
-
- switch (bits & GADGHIGHBITS)
- {
- case 0:
- flagnames[0] = "GADGHCOMP";
- bits |= 0x01;
- break;
- case 1:
- flagnames[0] = "GADGHBOX";
- break;
- case 2:
- flagnames[1] = "GADGHIMAGE";
- break;
- case 3:
- flagnames[1] = "GADGHNONE";
- bits ^= 0x01;
- break;
- }
- FlagPrint("Flags set for this gadget", flagnames, (ULONG)bits);
- break;
- case 7:
- FlagPrint("Activation flags set for this gadget",
- activenames, (ULONG)gadget->Activation);
- break;
- case 8:
- bits = gadget->GadgetType;
- if (bits & SYSGADGET) {
- bits = (bits & 0xff00) | (1 << (((bits & 0xf0) >> 4) - 1));
- FlagPrint("Gadget type flags set for this gadget",
- systypenames, (ULONG)bits);
- }
- else {
- bits = (bits & 0xff00) | (1 << ((bits & 0x0f) - 1));
- FlagPrint("Gadget type flags set for this gadget",
- applitypenames, (ULONG)bits);
- }
- break;
- case 9:
- if (gadget->GadgetRender)
- if (gadget->Flags & GADGIMAGE)
- PrImage("This Gadget's Image structure",
- gadget->GadgetRender);
- else
- PrBorder("This Gadget's Border structure",
- gadget->GadgetRender);
- break;
- case 10:
- if (gadget->SelectRender)
- if (gadget->Flags & GADGIMAGE)
- PrImage("This Gadget's alternate Image structure",
- gadget->SelectRender);
- else
- PrBorder("This Gadget's alternate Border structure",
- gadget->SelectRender);
- break;
- case 13:
- if (gadget->SpecialInfo)
- if (gadget->GadgetType & STRGADGET)
- PrStringInfo("This Gadget's StringInfo structure",
- gadget->SpecialInfo);
- else if (gadget->GadgetType & PROPGADGET)
- PrPropInfo("This Gadget's PropInfo structure",
- gadget->SpecialInfo);
- break;
- }
- }
- level--;
- }
-
-
- /* PrStringInfo
-
- Put up the data for a StringInfo structure.
- */
-
- PrStringInfo (string, stringinfo)
- char *string;
- struct StringInfo *stringinfo;
- {
- static struct StructData structdata[] = {
- { " *Buffer", "UBYTE *", PRSTRING, PTRSIZE },
- { " *UndoBuffer", "UBYTE *", PRSTRING, PTRSIZE },
- { "-BufferPos", "SHORT", PRINT, INTSIZE },
- { "-MaxChars", "SHORT", PRINT, INTSIZE },
- { "-DispPos", "SHORT", PRINT, INTSIZE },
- { "-UndoPos", "SHORT", PRINT, INTSIZE },
- { "-NumChars", "SHORT", PRINT, INTSIZE },
- { "-DispCount", "SHORT", PRINT, INTSIZE },
- { "-CLeft", "SHORT", PRINT, INTSIZE },
- { "-CTop", "SHORT", PRINT, INTSIZE },
- { " LayerPtr", "struct Layer *", PRPTR, PTRSIZE },
- { "-LongInt", "LONG", PRLONG, PTRSIZE },
- { "(AltKeyMap", "struct KeyMap *)", PRPTR, PTRSIZE }
- };
-
- int i, sum;
- int choice = -1;
-
- level++;
-
- while (choice)
- {
- sum = SetOptionText(string, structdata, (APTR)stringinfo, DATASIZE, 0);
-
- switch (choice = GetChoice(DATASIZE))
- {
- case 1:
- if (stringinfo->Buffer)
- PrString("The contents of the String Gadget's text buffer",
- stringinfo->Buffer);
- break;
- case 2:
- if (stringinfo->UndoBuffer)
- PrString("The contents of the String Gadget's undo buffer",
- stringinfo->UndoBuffer);
- break;
- case 11:
- if (stringinfo->LayerPtr)
- PrLayer("The Layer structure for this String Gadget",
- stringinfo->LayerPtr);
- break;
- }
- }
- level--;
- }
-
-
- /* PrPropInfo
-
- Put up the data for a PropInfo structure.
- */
-
- PrPropInfo (string, propinfo)
- char *string;
- struct PropInfo *propinfo;
- {
- static struct StructData structdata[] = {
- { " Flags", "USHORT", PRUINT, INTSIZE },
- { "-HorizPot", "USHORT", PRUINT, INTSIZE },
- { "-VertPot", "USHORT", PRUINT, INTSIZE },
- { "-HorizBody", "USHORT", PRUINT, INTSIZE },
- { "-VertBody", "USHORT", PRUINT, INTSIZE },
- { "-CWidth", "USHORT", PRUINT, INTSIZE },
- { "-CHeight", "USHORT", PRUINT, INTSIZE },
- { "-HPotRes", "USHORT", PRUINT, INTSIZE },
- { "-VPotRes", "USHORT", PRUINT, INTSIZE },
- { "-LeftBorder", "USHORT", PRUINT, INTSIZE },
- { "-TopBorder", "USHORT", PRUINT, INTSIZE }
- };
-
- static char *flagnames[16] = {
- "AUTOKNOB", "FREEHORIZ", "FREEVERT", "PROPBORDERLESS",
- NULL, NULL, NULL, NULL,
- "KNOBHIT"
- };
-
- int choice;
-
- level++;
-
- do
- {
- SetOptionText(string, structdata, (APTR)propinfo, DATASIZE, 0);
-
- switch (choice = GetChoice(DATASIZE))
- {
- case 1:
- FlagPrint("Flags set for this PropInfo structure",
- flagnames, (ULONG)propinfo->Flags);
- break;
- }
- } while (choice);
-
- level--;
- }
-
-
-
-