home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / out-of-phase-102-c / OutOfPhase 1.02 Source / OutOfPhase Folder / Level 1 Extensions 29Sep94 / GrowIcon.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-23  |  2.9 KB  |  90 lines  |  [TEXT/KAHL]

  1. /* GrowIcon.c */
  2. /*****************************************************************************/
  3. /*                                                                           */
  4. /*    System Dependency Library for Building Portable Software               */
  5. /*    Macintosh Version                                                      */
  6. /*    Written by Thomas R. Lawrence, 1993 - 1994.                            */
  7. /*                                                                           */
  8. /*    This file is Public Domain; it may be used for any purpose whatsoever  */
  9. /*    without restriction.                                                   */
  10. /*                                                                           */
  11. /*    This package is distributed in the hope that it will be useful,        */
  12. /*    but WITHOUT ANY WARRANTY; without even the implied warranty of         */
  13. /*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                   */
  14. /*                                                                           */
  15. /*    Thomas R. Lawrence can be reached at tomlaw@world.std.com.             */
  16. /*                                                                           */
  17. /*****************************************************************************/
  18.  
  19. #include "MiscInfo.h"
  20. #include "Audit.h"
  21. #include "Debug.h"
  22. #include "Definitions.h"
  23.  
  24. #include "GrowIcon.h"
  25. #include "Screen.h"
  26.  
  27.  
  28. static unsigned char                RawGrowIconEnabled[] =
  29.     {
  30.         0xFF,0xFF,0x80,0x01,0x80,0x01,0x9F,0xC1,
  31.         0x90,0x41,0x90,0x79,0x90,0x49,0x90,0x49,
  32.         0x90,0x49,0x9F,0xC9,0x84,0x09,0x84,0x09,
  33.         0x87,0xF9,0x80,0x01,0x80,0x01,0xFF,0xFF
  34.     };
  35.  
  36. static unsigned char                RawGrowIconDisabled[] =
  37.     {
  38.         0xFF,0xFF,0x80,0x01,0x80,0x01,0x80,0x01,
  39.         0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,
  40.         0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,
  41.         0x80,0x01,0x80,0x01,0x80,0x01,0xFF,0xFF
  42.     };
  43.  
  44. static Bitmap*        GrowIconEnabled = NIL;
  45. static Bitmap*        GrowIconDisabled = NIL;
  46.  
  47.  
  48. /* allocate the internal bitmap of the grow icon */
  49. MyBoolean                InitializeGrowIcon(void)
  50.     {
  51.         GrowIconEnabled = MakeBitmap(RawGrowIconEnabled,16,16,2);
  52.         if (GrowIconEnabled == NIL)
  53.             {
  54.              FailurePoint1:
  55.                 return False;
  56.             }
  57.         GrowIconDisabled = MakeBitmap(RawGrowIconDisabled,16,16,2);
  58.         if (GrowIconDisabled == NIL)
  59.             {
  60.              FailurePoint2:
  61.                 DisposeBitmap(GrowIconEnabled);
  62.                 goto FailurePoint1;
  63.             }
  64.         return True;
  65.     }
  66.  
  67.  
  68. /* dispose of the internal bitmap of the grow icon */
  69. void                        ShutdownGrowIcon(void)
  70.     {
  71.         DisposeBitmap(GrowIconEnabled);
  72.         DisposeBitmap(GrowIconDisabled);
  73.     }
  74.  
  75.  
  76. /* get a pointer to the bitmap.  The flag is used to choose the appropriate bitmap. */
  77. /* True means the window is active, so the grow icon should be returned.  False means */
  78. /* the window is inactive, so the empty box should be returned */
  79. struct Bitmap*    GetGrowIcon(MyBoolean GrowIconFlag)
  80.     {
  81.         if (GrowIconFlag)
  82.             {
  83.                 return GrowIconEnabled;
  84.             }
  85.          else
  86.             {
  87.                 return GrowIconDisabled;
  88.             }
  89.     }
  90.