home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d913 / stickit.lha / StickIt / Source / Source.lha / about.c next >
C/C++ Source or Header  |  1993-08-02  |  8KB  |  214 lines

  1. /****************************************
  2.  *************   about.c   **************
  3.  ****************************************/
  4.  
  5. #include <dos/dos.h>
  6. #include <exec/types.h>
  7. #include <intuition/intuition.h>
  8. #include <intuition/classes.h>
  9. #include <intuition/classusr.h>
  10. #include <intuition/imageclass.h>
  11. #include <intuition/gadgetclass.h>
  12. #include <libraries/gadtools.h>
  13. #include <graphics/displayinfo.h>
  14. #include <graphics/gfxbase.h>
  15. #include <graphics/text.h>
  16. #include <workbench/workbench.h>
  17.  
  18. #include <clib/exec_protos.h>
  19. #include <clib/intuition_protos.h>
  20. #include <clib/gadtools_protos.h>
  21. #include <clib/graphics_protos.h>
  22. #include <clib/utility_protos.h>
  23. #include <clib/diskfont_protos.h>
  24. #include <clib/dos_protos.h>
  25. #include <clib/wb_protos.h>
  26.  
  27. #include <stdio.h>
  28. #include <stdlib.h>
  29. #include <string.h>
  30.  
  31. #include "stickit.h"
  32.  
  33. #include "consts.h"
  34. #include "structs.h"
  35. #include "prototype.h"
  36.  
  37. /***   Image   ****************************************************************/
  38.  
  39. USHORT chip ImageDataAbout[] =
  40. {
  41.     0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x01E5,0x0422,
  42.     0x0000,0x0000,0x0000,0x0000,0x0408,0x0844,0x0000,0x0000,
  43.     0x0000,0x0000,0x039E,0x6A4E,0x0000,0x0000,0x0000,0x0000,
  44.     0x0095,0x1888,0x0000,0x0000,0x0000,0x0000,0x0895,0x1488,
  45.     0x0000,0x0000,0x0000,0x0000,0x0E29,0xA510,0x0000,0x0000,
  46.     0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  47.     0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x4040,
  48.     0x0000,0x0000,0x0000,0x0000,0x0000,0x4C40,0x8000,0x0008,
  49.     0x0000,0x0000,0x0000,0x4C80,0x1040,0x0008,0x0000,0x0000,
  50.     0x0000,0x4C96,0x9C71,0xAB0B,0xA100,0x0000,0x0000,0x2A98,
  51.     0x9041,0x2D0C,0x9200,0x0000,0x0000,0x3290,0x9043,0x0908,
  52.     0x9200,0x0000,0x0000,0x3310,0x9042,0x0909,0x8A00,0x0000,
  53.     0x0000,0x3310,0x924A,0x290B,0x0C00,0x0000,0x0000,0x2110,
  54.     0x9C72,0x490E,0x0400,0x0000,0x0000,0x0000,0x0000,0x0000,
  55.     0x0800,0x0000,0x0000,0x0000,0x0000,0x0000,0x2800,0x0000,
  56.     0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  57.     0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0001,0xD000,
  58.     0x0000,0x0000,0x0000,0x0C00,0x1001,0x0800,0x0000,0x0000,
  59.     0x0000,0x0C08,0x1001,0x0400,0x0000,0x0000,0x0000,0x1254,
  60.     0x1421,0x04A3,0xAA00,0x0000,0x0000,0x1E64,0xD241,0x0534,
  61.     0x7200,0x0000,0x0000,0x2245,0x1241,0x0F80,0x6200,0x0000,
  62.     0x0000,0x2145,0x1141,0x1E03,0xE200,0x0000,0x0000,0x2146,
  63.     0x3181,0x3214,0x6200,0x0000,0x0000,0x40C6,0x5081,0xC129,
  64.     0xE200,0x0000,0x0000,0x0000,0x0100,0x0000,0x0000,0x0000,
  65.     0x0000,0x0000,0x0500,0x0000,0x0000,0x0000,0x0000,0x0000,
  66.     0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  67.     0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0003,0xFFE0,
  68.     0x0000,0x0000,0x0000,0x0000,0x00FC,0x0070,0x00E3,0x0C67,
  69.     0x0198,0x300C,0xE040,0x0000,0x0222,0x2521,0x0110,0x2025,
  70.     0x2020,0x0000,0x05D2,0x2526,0x00A0,0x2024,0x4030,0x0050,
  71.     0x0A24,0x39C2,0x0140,0x4049,0x0010,0x0000,0x0BA4,0x0842,
  72.     0x0080,0x404A,0x0010,0x0550,0x089C,0xE738,0x8101,0xC467,
  73.     0x8010,0x0000,0x0700,0x0000,0x8000,0x0000,0x0010,0x5540,
  74.     0x0000,0x0002,0x0000,0x0000,0x0010,0x0000,0x0000,0x0000,
  75.     0x0000,0x0000,0x001D,0x5400,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  76.     0xFFFF,0xFFF0,0xFE1A,0xFBDD,0xFFFF,0xFFFF,0xFFFF,0xFFF0,
  77.     0xFBF7,0xF7BB,0xFFFF,0xFFFF,0xFFFF,0xFFF0,0xFC61,0x95B1,
  78.     0xFFFF,0xFFFF,0xFFFF,0xFFF0,0xFF6A,0xE777,0xFFFF,0xFFFF,
  79.     0xFFFF,0xFFF0,0xF76A,0xEB77,0xFFFF,0xFFFF,0xFFFF,0xFFF0,
  80.     0xF1D6,0x5AEF,0xFFFF,0xFFFF,0xFFFF,0xFFF0,0x00E3,0x8138,
  81.     0x5C8B,0x9C2B,0x8DC0,0x3F40,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  82.     0xFFFF,0xFFF0,0xFFFF,0xBFBF,0xFFFF,0xFFFF,0xFFFF,0xFFF0,
  83.     0xFFFF,0xB3BF,0x7FFF,0xFFF7,0xFFFF,0xFFF0,0xFFFF,0xB37F,
  84.     0xEFBF,0xFFF7,0xFFFF,0xFFF0,0xFFFF,0xB369,0x638E,0x54F4,
  85.     0x5EFF,0xFFF0,0xFFFF,0xD567,0x6FBE,0xD2F3,0x6DFF,0xFFF0,
  86.     0xFFFF,0xCD6F,0x6FBC,0xF6F7,0x6DFF,0xFFF0,0xFFFF,0xCCEF,
  87.     0x6FBD,0xF6F6,0x75FF,0xFFF0,0xFFFF,0xCCEF,0x6DB5,0xD6F4,
  88.     0xF3FF,0xFFF0,0xFFFF,0xDEEF,0x638D,0xB6F1,0xFBFF,0xFFF0,
  89.     0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xF7FF,0xFFF0,0xFFFF,0xFFFF,
  90.     0xFFFF,0xFFFF,0xD7FF,0xFFF0,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  91.     0xFFFF,0xFFF0,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFF0,
  92.     0xFFFF,0xFFFF,0xFFFE,0x2FFF,0xFFFF,0xFFF0,0xFFFF,0xF3FF,
  93.     0xEFFE,0xF7FF,0xFFFF,0xFFF0,0xFFFF,0xF3F7,0xEFFE,0xFBFF,
  94.     0xFFFF,0xFFF0,0xFFFF,0xEDAB,0xEBDE,0xFB5C,0x55FF,0xFFF0,
  95.     0xFFFF,0xE19B,0x2DBE,0xFACB,0x8DFF,0xFFF0,0xFFFF,0xDDBA,
  96.     0xEDBE,0xF07F,0x9DFF,0xFFF0,0xFFFF,0xDEBA,0xEEBE,0xE1FC,
  97.     0x1DFF,0xFFF0,0xFFFF,0xDEB9,0xCE7E,0xCDEB,0x9DFF,0xFFF0,
  98.     0xFFFF,0xBF39,0xAF7E,0x3ED6,0x1DFF,0xFFF0,0xFFFF,0xFFFF,
  99.     0xFEFF,0xFFFF,0xFFFF,0xFFF0,0xFFFF,0xFFFF,0xFAFF,0xFFFF,
  100.     0xFFFF,0xFFF0,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFF0,
  101.     0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFF0,0xFFFF,0xFFFF,
  102.     0xFFFF,0xFFFF,0xFFFC,0x0010,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  103.     0xFF03,0xFF80,0xFF1C,0xF398,0xFE67,0xCFF3,0x1FBF,0xFFF0,
  104.     0xFDDD,0xDADE,0xFEEF,0xDFDA,0xDFDF,0xFFC0,0xFA2D,0xDAD9,
  105.     0xFF5F,0xDFDB,0xBFCF,0xFF00,0xF5DB,0xC63D,0xFEBF,0xBFB6,
  106.     0xFFEF,0xFC00,0xF45B,0xF7BD,0xFF7F,0xBFB5,0xFFEF,0xF000,
  107.     0xF763,0x18C7,0x7EFE,0x3B98,0x7FEF,0xC000,0xF8FF,0xFFFF,
  108.     0x7FFF,0xFFFF,0xFFEF,0x0000,0xFFFF,0xFFFD,0xFFFF,0xFFFF,
  109.     0xFFEC,0x0000,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFE0,0x0000
  110. };
  111.  
  112. struct Image ImageAbout =
  113. {
  114.     0,    /* X Offset from LeftEdge */
  115.     0,    /* Y Offset from TopEdge */
  116.     92,    /* Image Width */
  117.     46,    /* Image Height */
  118.     2,    /* Image Depth */
  119.     ImageDataAbout,    /* pointer to Image BitPlanes */
  120.     0x03,    /* PlanePick */
  121.     0x00,    /* PlaneOnOff */
  122.     NULL    /* next Image structure */
  123. };
  124.  
  125. /******************************************************************************/
  126.  
  127. USHORT chip ImageDataIcon[] =
  128. {
  129.     0x0000,0x0000,0x0000,0x1000,0x0000,0x0000,0x0000,0x1000,
  130.     0x0000,0x0000,0x0000,0x1000,0x0000,0x0000,0x0000,0x1000,
  131.     0x0000,0x0000,0x0000,0x1000,0x0007,0x2202,0x1C80,0x1000,
  132.     0x0010,0x4004,0x1100,0x1000,0x0010,0xEC74,0x9380,0x1000,
  133.     0x0018,0x890A,0x2200,0x1000,0x0004,0x890C,0x2200,0x1000,
  134.     0x0009,0x1214,0x4400,0x1000,0x0070,0xB9D2,0xE200,0x1000,
  135.     0x0000,0x0000,0x0000,0x1000,0x0000,0x0000,0x0000,0x1000,
  136.     0x0000,0x0000,0x0000,0x1000,0x0000,0x0000,0x0020,0x1000,
  137.     0x0000,0x0000,0x00A0,0x1000,0x0000,0x0000,0x02A0,0x1000,
  138.     0x0000,0x0000,0x0AA0,0x1000,0x0000,0x0000,0x0000,0x1000,
  139.     0x0000,0x0000,0x0000,0x1000,0x7FFF,0xFFFF,0xFFFF,0xF000,
  140.     0xFFFF,0xFFFF,0xFFFF,0xE000,0x9249,0x2492,0x4924,0x8000,
  141.     0xA5FF,0xFFFF,0xFFF9,0x2000,0xC9FF,0xFFFF,0xFFF2,0x4000,
  142.     0x93FF,0xFFFF,0xFFF4,0x8000,0xA5F8,0xDDFD,0xE379,0x2000,
  143.     0xC9EF,0xBFFB,0xEEF2,0x4000,0x93EF,0x138B,0x6C74,0x8000,
  144.     0xA5E7,0x76F5,0xDDF9,0x2000,0xC9FB,0x76F3,0xDDF2,0x4000,
  145.     0x93F6,0xEDEB,0xBBF4,0x8000,0xA58F,0x462D,0x1DF9,0x2000,
  146.     0xC9FF,0xFFFF,0xFFF2,0x4000,0x93FF,0xFFFF,0x8004,0x8000,
  147.     0xA5FF,0xFFFF,0xBF99,0x2000,0xC9FF,0xFFFF,0xBE52,0x4000,
  148.     0x93FF,0xFFFF,0xB954,0x8000,0xA5FF,0xFFFF,0xB159,0x2000,
  149.     0xC9FF,0xFFFF,0xA552,0x4000,0x9249,0x2492,0x4924,0x8000,
  150.     0xA492,0x4924,0x9249,0x2000,0x8000,0x0000,0x0000,0x0000
  151. };
  152.  
  153. struct Image ImageIcon =
  154. {
  155.     0,    /* X Offset from LeftEdge */
  156.     0,    /* Y Offset from TopEdge */
  157.     52,    /* Image Width */
  158.     22,    /* Image Height */
  159.     2,    /* Image Depth */
  160.     ImageDataIcon,    /* pointer to Image BitPlanes */
  161.     0x03,    /* PlanePick */
  162.     0x00,    /* PlaneOnOff */
  163.     NULL    /* next Image structure */
  164. };
  165.  
  166.  
  167. struct DiskObject appicon =
  168.     {
  169.     WB_DISKMAGIC,
  170.     WB_DISKVERSION,
  171.         {
  172.         NULL,
  173.         87,30,
  174.         52,22,            /* Width, height */
  175.         GADGHCOMP,
  176.         RELVERIFY,
  177.         BOOLGADGET,
  178.         (APTR)&ImageIcon,    /* Image 1 */
  179.         NULL,            /* Image 2 */
  180.         NULL,
  181.         NULL,
  182.         NULL,
  183.         NULL,
  184.         NULL
  185.         },
  186.     WBAPPICON,
  187.     NULL,
  188.     NULL,
  189.     NO_ICON_POSITION,
  190.     NO_ICON_POSITION,
  191.     NULL,
  192.     NULL,
  193.     NULL
  194.     };
  195.  
  196. extern prjptr prj;
  197. extern struct Window *aboutWnd;
  198.  
  199. void openabout()
  200.    {
  201.    if (!aboutWnd)
  202.       if (OpenaboutWindow())     /* If can't open it, don't bother */
  203.          {
  204.          CloseaboutWindow();
  205.          return;
  206.          }
  207.  
  208.    /***   Draw nice logo...   ***/
  209.  
  210.    DrawImage(aboutWnd->RPort,&ImageAbout,aboutWnd->BorderLeft,
  211.                                                       aboutWnd->BorderTop);
  212.    }
  213.  
  214.