home *** CD-ROM | disk | FTP | other *** search
/ YPA: Your Privacy Assured / YPA.ISO / other_goodies / utilities / amigaguid.lha / AmigaGuide / AG_V39 / Source / HyperBrowser / window.c < prev   
C/C++ Source or Header  |  1993-01-08  |  6KB  |  146 lines

  1. /* window.c
  2.  *
  3.  * (c) Copyright 1992 Commodore-Amiga, Inc.  All rights reserved.
  4.  *
  5.  * This software is provided as-is and is subject to change; no warranties
  6.  * are made.  All use is at your own risk.  No liability or responsibility
  7.  * is assumed.
  8.  *
  9.  */
  10.  
  11. #include "hyperbrowser.h"
  12.  
  13. /*****************************************************************************/
  14.  
  15. STRPTR DumpWindowFlags (struct GlobalData * gd, struct Window * win)
  16. {
  17.     ULONG flags = win->Flags;
  18.  
  19.     memset (gd->gd_FBuffer, 0, sizeof (gd->gd_FBuffer));
  20.  
  21.     /* Gadget information */
  22.     if (flags & WFLG_SIZEGADGET)
  23.     strcat (gd->gd_FBuffer, "size ");
  24.  
  25.     if (flags & WFLG_DRAGBAR)
  26.     strcat (gd->gd_FBuffer, "drag ");
  27.  
  28.     if (flags & WFLG_DEPTHGADGET)
  29.     strcat (gd->gd_FBuffer, "depth ");
  30.  
  31.     if (flags & WFLG_CLOSEGADGET)
  32.     strcat (gd->gd_FBuffer, "close ");
  33.  
  34.     if (flags & WFLG_HASZOOM)
  35.     strcat (gd->gd_FBuffer, "zoom ");
  36.  
  37.     /* Refresh */
  38.     switch (flags & WFLG_REFRESHBITS)
  39.     {
  40.     case WFLG_SMART_REFRESH:
  41.         strcat (gd->gd_FBuffer, "smart ");
  42.         break;
  43.  
  44.     case WFLG_SIMPLE_REFRESH:
  45.         strcat (gd->gd_FBuffer, "simple ");
  46.         break;
  47.  
  48.     case WFLG_SUPER_BITMAP:
  49.         strcat (gd->gd_FBuffer, "super ");
  50.         break;
  51.  
  52.     case WFLG_OTHER_REFRESH:
  53.         strcat (gd->gd_FBuffer, "other ");
  54.         break;
  55.     }
  56.  
  57.     /* Misc. */
  58.     if (flags & WFLG_GIMMEZEROZERO)
  59.     strcat (gd->gd_FBuffer, "gzz ");
  60.  
  61.     if (flags & WFLG_RMBTRAP)
  62.     strcat (gd->gd_FBuffer, "rmb ");
  63.  
  64.     if (flags & WFLG_NOCAREREFRESH)
  65.     strcat (gd->gd_FBuffer, "nocare ");
  66.  
  67.     if (flags & WFLG_NW_EXTENDED)
  68.     strcat (gd->gd_FBuffer, "ext. ");
  69.  
  70.     if (flags & WFLG_NEWLOOKMENUS)
  71.     strcat (gd->gd_FBuffer, "nlm ");
  72.  
  73.     if (flags & WFLG_VISITOR)
  74.     strcat (gd->gd_FBuffer, "visitor ");
  75.  
  76.     if (flags & WFLG_ZOOMED)
  77.     strcat (gd->gd_FBuffer, "zoomed ");
  78.  
  79.     return (gd->gd_FBuffer);
  80. }
  81.  
  82. /*****************************************************************************/
  83.  
  84. void showwindow (struct GlobalData * gd, ULONG address)
  85. {
  86.     struct Screen *scr;
  87.     struct Window *win;
  88.     BOOL found = FALSE;
  89.     ULONG lock;
  90.  
  91.     /* Just in case we don't find the screen */
  92.     strcpy (gd->gd_Node, "@{b}window gone@{ub}\n");
  93.  
  94.     /* Search for the screen */
  95.     lock = LockIBase (0);
  96.     for (scr = IntuitionBase->FirstScreen; scr && !found; scr = scr->NextScreen)
  97.     {
  98.     for (win = scr->FirstWindow; win && !found; win = win->NextWindow)
  99.     {
  100.         /* Is this the window we were looking for? */
  101.         if (win == (struct Window *) address)
  102.         {
  103.         /* Build the screen information */
  104.         strcpy (gd->gd_Node, "@{b}Window@{ub}\n\n");
  105.         bprintf (gd, "        Address: @{\"%08lx\" link HYPERNOZY.MEMORY.(%08lx)}\n", (void *) address, (void *) address);
  106.         bprintf (gd, "    Next Window: @{\"%08lx\" link HYPERNOZY.WINDOW.(%08lx)}\n", win->NextWindow, win->NextWindow);
  107.         bprintf (gd, "            Box: %ld, %ld, %ld, %ld\n", (void *) win->LeftEdge, (void *) win->TopEdge, (void *) win->Width, (void *) win->Height);
  108.         bprintf (gd, "   Minimum Size: %ld, %ld\n", (void *) win->MinWidth, (void *) win->MinHeight);
  109.         bprintf (gd, "   Maximum Size: %ld, %ld\n", (void *) win->MaxWidth, (void *) win->MaxHeight);
  110.         bprintf (gd, "          Flags: %s\n", DumpWindowFlags (gd, win));
  111.         bprintf (gd, "           Menu: @{\"%08lx\" link HYPERNOZY.MENU.(%08lx)}\n", (void *) win->MenuStrip, (void *) win->MenuStrip);
  112.         bprintf (gd, "          Title: %s\n", ((win->Title) ? win->Title : ""));
  113.         bprintf (gd, "   FirstRequest: @{\"%08lx\" link HYPERNOZY.REQUESTER.(%08lx)}\n", win->FirstRequest, win->FirstRequest);
  114.         bprintf (gd, "     DMRRequest: @{\"%08lx\" link HYPERNOZY.REQUESTER.(%08lx)}\n", win->DMRequest, win->DMRequest);
  115.         bprintf (gd, "     Req. Count: %ld\n", (void *) win->ReqCount);
  116.         bprintf (gd, "         Screen: @{\"%08lx\" link HYPERNOZY.SCREEN.(%08lx)}\n", win->WScreen, win->WScreen);
  117.         bprintf (gd, "       RastPort: @{\"%08lx\" link HYPERNOZY.RASTPORT.(%08lx)}\n", win->RPort, win->RPort);
  118.         bprintf (gd, "   Border Sizes: %ld, %ld, %ld, %ld\n", (void *) win->BorderLeft, (void *) win->BorderTop, (void *) win->BorderRight, (void *) win->BorderBottom);
  119.         bprintf (gd, "Border RastPort: @{\"%08lx\" link HYPERNOZY.RASTPORT.(%08lx)}\n", win->BorderRPort, win->BorderRPort);
  120.         bprintf (gd, "   First Gadget: @{\"%08lx\" link HYPERNOZY.GADGETLIST.(%08lx)}\n", win->FirstGadget, win->FirstGadget);
  121.         bprintf (gd, "  Parent Window: @{\"%08lx\" link HYPERNOZY.WINDOW.(%08lx)}\n", win->Parent, win->Parent);
  122.         bprintf (gd, "   Desc. Window: @{\"%08lx\" link HYPERNOZY.WINDOW.(%08lx)}\n", win->Descendant, win->Descendant);
  123.         bprintf (gd, "   Pointer Data: @{\"%08lx\" link HYPERNOZY.MEMORY.(%08lx)}\n", win->Pointer, win->Pointer);
  124.         bprintf (gd, "    Pointer Box: %ld, %ld, %ld, %ld\n", (void *)win->XOffset, (void *)win->YOffset, (void *)win->PtrWidth, (void *) win->PtrHeight);
  125.         bprintf (gd, "    IDCMP Flags: %08lx\n", (void *) win->IDCMPFlags);
  126.         bprintf (gd, "      User Port: @{\"%08lx\" link HYPERNOZY.MSGPORT.(%08lx)}\n", win->UserPort, win->UserPort);
  127.         bprintf (gd, "    Window Port: @{\"%08lx\" link HYPERNOZY.MSGPORT.(%08lx)}\n", win->WindowPort, win->WindowPort);
  128.         bprintf (gd, "    Message Key: @{\"%08lx\" link HYPERNOZY.MEMORY.(%08lx)}\n", win->MessageKey, win->MessageKey);
  129.         bprintf (gd, "  Detail, Block: %ld, %ld\n", (void *) win->DetailPen, (void *) win->BlockPen);
  130.         bprintf (gd, "     Check Mark: @{\"%08lx\" link HYPERNOZY.IMAGE.(%08lx)}\n", win->CheckMark, win->CheckMark);
  131.         bprintf (gd, "   Screen Title: %s\n", (win->ScreenTitle) ? win->ScreenTitle : "");
  132.         bprintf (gd, "      Ext. Data: @{\"%08lx\" link HYPERNOZY.MEMORY.(%08lx)}\n", win->ExtData, win->ExtData);
  133.         bprintf (gd, "      User Data: @{\"%08lx\" link HYPERNOZY.MEMORY.(%08lx)}\n", win->UserData, win->UserData);
  134.         bprintf (gd, "          Layer: @{\"%08lx\" link HYPERNOZY.LAYER.(%08lx)}\n", win->WLayer, &win->WLayer);
  135.         bprintf (gd, "           Font: @{\"%08lx\" link HYPERNOZY.FONT.(%08lx)}\n", win->IFont, win->IFont);
  136.         bprintf (gd, "     More Flags: %08lx\n", (void *) win->MoreFlags);
  137.  
  138.         /* Show that we found it */
  139.         found = TRUE;
  140.         }
  141.     }
  142.     }
  143.     UnlockIBase (lock);
  144.  
  145. }
  146.