home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 (1993) / nebula.bin / SourceCode / MiniExamples / PerformanceTuning / Winfo / WinInfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-18  |  3.1 KB  |  99 lines

  1. /*
  2.  * Winfo
  3.  * by Paul S. Kleppner
  4.  *
  5.  * This program may be freely distributed, but not sold.
  6.  * It is provided without warranty of any kind, expressed or
  7.  * implied, as to its fitness for any particular use.
  8.  */
  9.  
  10. /*
  11.  * WinInfo class.  This is the controlling object of the application.
  12.  */
  13.  
  14. #import <objc/Object.h>
  15. #import <appkit/graphics.h>
  16.  
  17.  
  18. // The winfo struct holds information about a particular window.
  19.  
  20. struct winfo {
  21.   int num;                // window number (server's value, not appkit's)
  22.   NXRect place;            // location of window on screen
  23.   int hasAlpha;            // YES if has alpha value
  24.   int colors;            // number of color componentsa
  25.   int depth;            // depth of eachc olor
  26.   int level;            // level on screen
  27.   int context;            // DisplayPostscript context
  28.   BOOL origOnScreen;    // YES if window was originally on screen
  29.   BOOL onScreenNow;        // YES if window is on screen now
  30.   BOOL isMe;            // YES if this is one of Winfo's own windows
  31. };
  32.  
  33. @interface WinInfo:Object
  34. {
  35.   BOOL activeFlag;        // YES if active (i.e. start button is pressed)
  36.   BOOL outlineMode;        // YES if outline mode (== !show window contents)a
  37.   BOOL offScreenMode;    // YES if off-screen windows should be shown
  38.  
  39.   id myFont;            // display font
  40.   int numWins;            // number of existing windows
  41.   int *windowList;        // array of all DPS window numbers
  42.   int numOnScreen;        // number of existing windows on screen
  43.   int *onScreenList;    // array of on-screen DPS window numbers
  44.   struct winfo *wpList;    // array of info about each window
  45.  
  46.   BOOL highlightAlpha;    // YES if windows w/alpha should be highlighted
  47.   BOOL highlightColor;    // YES if windows w/color should be highlihgted
  48.   BOOL highlightDepth;    // YES if windows w/depth > 1 should be highlighted
  49.  
  50.   id displayWin;        // id of full-size window in which display is created
  51.   int selectedContext;    // context number for currently selected window
  52.  
  53.   id reportPanel;                // id of report panel
  54.   id timeDelay;                    // time delay field
  55.  
  56.                     // selected window fields in report panel
  57.   id repBox;                    // box surrounding all fields
  58.   id repContext;                // context
  59.   id repSize;                    // size
  60.   id repAlpha;                    // alpha
  61.   id repDepth;                    // depth
  62.   id repColors;                    // color
  63.   id repBackingStore;            // backing store
  64.  
  65.                     // all windows in contenxt fields in report panel
  66.   id repOnScreen;                // on-screen
  67.   id repOffScreen;                // off-screen
  68.   id repTotalScreen;            // total
  69.   id repTotalBackingStore;        // total amount of backing store
  70.  
  71.                     // other controls in report panel
  72.   id highlightOpt;                // highlighting check boxes
  73.   id showOutlinesButton;        // show outlines or contents check box
  74.   id showOffScreenButton;        // show off screen windows check box
  75.  
  76. }
  77.  
  78.  
  79. - startStop:sender;
  80. - start:sender;
  81. - stop:sender;
  82. - changeHighlight:sender;
  83. - getHighlightValues:sender;
  84. - showAllWindows;
  85. - showOutlineWindow:(struct winfo *)wp markBorder:(BOOL)mark;
  86. - (struct winfo *) mapPointToWindow:(NXPoint *)p;
  87. - clearReport;
  88. - showReportFor:(struct winfo *)wp;
  89. - (int) sizeBackingStore:(struct winfo *)wp;
  90. - (int) trueWinNumberFor:win;
  91. - showOutlines:sender;
  92. - showOffScreen:sender;
  93. - clearOffScreen;
  94. - moveOnScreen:(BOOL)how forContext:(int)context;
  95. - (struct winfo *) findWinfoByNumber:(int)wnum;
  96. - buildWindowList;
  97. - buildOnScreenList;
  98. @end
  99.